What is the best practice with the new GUI Builder, to simply navigate from "form A" to another "form B" by clicking a button in "form A", with use of the action events?
If I create Form B inside Form A like this
public void oncreateAccountActionEvent(com.codename1.ui.events.ActionEvent ev) {
new FormB().show();
}
Then I am obviously not able to modify Form B from inside the main class (start, stop, destroy methods) before I do new FormB().show()
. In this case new FormA().show();
is located in the start-method of the main class.
I want to be able to specfiy e.g. a back-button to Form B to navigate back to Form A, but I want to add this inside the start-method of the Main class.
Thanks!
Edit:
I have the Main-class (with start(), stop(), destroy()-methods), in this class I do new FormA().show()
.
But inside the class of FormA I have the oncreateAccountActionEvent
-method (and button) which shows FormB by new FormB().show()
.
However I want to be able to specify formB.setBackCommand()
(into the toolbar of FormB inside the main-class.
So to say I want to specify both forms in the main class with new FormA/B()
- then modify the forms like adding buttons to the toolbar - and then tell FormA that FormB should be used inside the action event method.