Navigation issue

11 views
Skip to first unread message

ein...@gmail.com

unread,
Sep 22, 2016, 3:54:01 AM9/22/16
to CodenameOne Discussions
In IDE: NetBeans: i am having issue in calling new form after performing an action. Below is the line of code
protected void onFindTrans_FindGetButtonAction(Component c, ActionEvent event) {
        final String findName =  findFindTranNameComboBox(c.getComponentForm()).getSelectedItem().toString();
        final String findPort =  findFindTranPortComboBox(c.getComponentForm()).getSelectedItem().toString();
        final String findSour =  findFindSourceTextField(c.getComponentForm()).getText();
        final String findDest =  findFindDestinateTextField(c.getComponentForm()).getText();
        final String findStat =  findFindStationTextField(c.getComponentForm()).getText();
        final String findDate =  findFindDatePicker(c.getComponentForm()).getText();
        final Boolean findCheck = (Boolean)findFindCheckBox(c.getComponentForm()).isSelected();
        if (("".equals(findName)) || ("".equals(findPort)) || ("".equals(findSour)) || ("".equals(findDest)) || ("".equals(findDate))) {
           Dialog.show("Error", "All fields are required", "OK", null);
        }
        else{
            if(findFindCheckBox(c.getComponentForm()).isSelected()){
                if(!"".equals(findStat)){
                      
                        finCheck = "TRUE";
                        findTran(findName,findPort,findSour,findDest,findStat,findDate,finCheck);
                        showForm("Main", null);
                } else {
                      
                        finCheck = "TRUE";
                        finStat  = "NONE";
                        findTran(findName,findPort,findSour,findDest,finStat,findDate,finCheck);
                        showForm("Main", null);
                }
            }else{
                if(!findFindCheckBox(c.getComponentForm()).isSelected()){
                    if(!"".equals(findStat)){                       
                        finCheck = "FALSE";
                        findTran(findName,findPort,findSour,findDest,findStat,findDate,finCheck);
                        showForm("Main", null);
                } else {
                    finCheck = "FALSE";
                    finStat  = "NONE";
                    findTran(findName,findPort,findSour,findDest,finStat,findDate,finCheck);
                    showForm("Main", null);
                }
                }
            }
        }
       
    }

Shai Almog

unread,
Sep 23, 2016, 1:57:19 AM9/23/16
to CodenameOne Discussions, ein...@gmail.com
What's the issue? Do you get an error?
Reply all
Reply to author
Forward
0 new messages