java - Trigger GWT class' method from inside other class -


i have gwt page contains lot of different fields, user needs fill out. when user done filling out form, can click on button on page, opens popuppanel summary of have input. if user decides data they've entered correct, have option of clicking on "ok" button on popuppanel. achieve when user clicks on ok, popuppanel closes , method in initial class (and using initial class' variables) triggered. unable use eventbus because of restraints.

in initial class have click handler:

buttonanle.addclickhandler(new clickhandler()     {          @override         public void onclick(clickevent event)         {              if ( validatetimespan(subs) && validatesubumfeldtimespan(subs) )             {                 summary();             }          }     }); 

the method summary() shows popuppanel:

    private void summary() {     int subumfeldernr = subs.getrowcount();     int werbeformennr = kats.getrowcount();     int days = (int) (datumbis.getvalue().gettime() - datumvon.getvalue().gettime()) / 86400000;     new subprogrampopup(umfeldtext.gettextboxtext(), subumfeldernr - 1, werbeformennr - 1, days + 1).show();  } 

the popup appears, need way ok button's click trigger method in initial class. appreciated.

one possible solution using interface inside subprogrampopup. add code subprogrampopup class:

interface myhandler {     void dosomething(); } 

and add myhandler parameter constructor of subprogrampopup.

subprogrampopup(textbox textbox,                 int value01,                 int value02,                 int value03,                 myhandler handler) {} 

now, if creating subprogrampopup can use handler add something, should executed if needed.

new subprogrampopup(umfeldtext.gettextboxtext(),                     subumfeldernr - 1,                     werbeformennr - 1,                     days + 1,                     new myhandler() {                       public void dosomething() {                         // enter code here ...                        }                     }).show(); 

Comments

Popular posts from this blog

php - How to add and update images or image url in Volusion using Volusion API -

javascript - jQuery UI Splitter/Resizable for unlimited amount of columns -

javascript - IE9 error '$'is not defined -