wei-spring / codenameone

Automatically exported from code.google.com/p/codenameone
0 stars 0 forks source link

back() function never called on form #551

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
@Override
public void back(Component c) {

   System.out.println("in back()");          // never prints ???

   super.back(c);
}

Function back() never seems to be called. Expected to be called when a form's 
back action is executed.

Original issue reported on code.google.com by bry...@webbtide.com on 21 Feb 2013 at 11:55

GoogleCodeExporter commented 9 years ago
I've added a method to the UIBuilder called: onBackNavigation() 
It should be invoked before initiating any backwards navigation operation and 
solve your use case. 
The back() method probably won't be called for all cases.

Original comment by shai.almog on 22 Feb 2013 at 8:15

GoogleCodeExporter commented 9 years ago
How can I test this ? I checked out the source via svn but not sure how I
should update my project.

In my use case, not all forms may have breadcrumbs, so can I do:

public void onBackNavigation()
    Form f = Display.getInstance().getCurrent();
    if (f.getName().equals("......")) breadcrumb.pop();
}

Original comment by bry...@webbtide.com on 22 Feb 2013 at 9:43

GoogleCodeExporter commented 9 years ago
This won't be trivial to test, you will need to compile the JavaSE port and the 
Codename One port and update your libraries. We'll try to make a release early 
next week with some fixes.

Original comment by shai.almog on 22 Feb 2013 at 2:39

GoogleCodeExporter commented 9 years ago
OK. Any chance of  the setBackDestination() mod also ?

I have to say (once again !) what a great toolkit CN1 is, and the support
is superb.

Original comment by bry...@webbtide.com on 22 Feb 2013 at 8:46

GoogleCodeExporter commented 9 years ago
Thanks. setBackDestination(String) is already there.

Original comment by shai.almog on 23 Feb 2013 at 8:49