Opening another gui if a condition is met?

57 views
Skip to first unread message

Marko Vidalis

unread,
Sep 8, 2013, 11:20:15 AM9/8/13
to codenameone...@googlegroups.com
hi all,

I'm doing a basic login screen where when the user presses the 'login' button, the entered username and password are searched for in the database and if a match is found then only can the user proceed to the next gui, otherwise the user must re enter their details and not be granted access to the next gui window.

Could someone please tell me how to open the next GUI only if the username and password entered are valid? is there a line of code that i can put in the if statement which will open the next window? because currently the next window opens whether the details are valid or not. 

Thanks in advance. 

Marko

Shai Almog

unread,
Sep 8, 2013, 2:53:48 PM9/8/13
to codenameone...@googlegroups.com
Hi,
either use an action event and invoke showForm(..., null) only if login is good.
Or use a navigation command and select go to code, the navigation will happen based on the boolean flag returned from that method.
Reply all
Reply to author
Forward
0 new messages