how do i transfer data between forms

16 views
Skip to first unread message

cheta...@gmail.com

unread,
Sep 16, 2015, 3:30:13 PM9/16/15
to CodenameOne Discussions
If you are experiencing an issue please mention the full platform your issue applies to:
IDE: Eclipse
Desktop OS : Windows
Simulator : All
Device : ALL


i am creating forms at runtime  and is not been using the GUI builder. I want to know how can i transfer data from FORM A to FORM B.  What i am trying to is, when the user click some button, i want to transfer the button id , and depending upon the id i get on the new form, i want to show the details to the user.

Any help would be greatly appreciated.

Regards
Chetan Kokil

Shai Almog

unread,
Sep 16, 2015, 10:59:08 PM9/16/15
to CodenameOne Discussions, cheta...@gmail.com
Just like you transfer data in every application, thru method arguments, class members etc.
E.g.: https://www.udemy.com/learn-mobile-programming-by-example-with-codename-one/
http://codenameone.com/blog/building-a-chat-app-with-codename-one-part-1.html

So e.g. (using the new Java8 Lambda syntax: http://www.codenameone.com/blog/java-8-support.html ) :
btn.addActionListener((e) -> {
     
Form myNewForm = createForm(passMyDetails);
     myForm
.show();
});




Reply all
Reply to author
Forward
0 new messages