cancel
Showing results for 
Search instead for 
Did you mean: 

navigation to diff views depends on If conditions

Former Member
0 Kudos

HI experts..

depends on the if condition i want to transfer the control to respective pages ..

for eg: if uname and pwd matches to admin the control have to move admin view.. or if it matches to emp then move emp view or else error view

and my doubt here is where we need write ie whether it is wdInit() or wdModify()

and how to write..

please explain in clear manner

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

we write it in wdModify()

Answers (4)

Answers (4)

Former Member
0 Kudos

Raj,

Here is the code I use in an action method that's bound to a button in the app. If the password doesn't match, it issues an error message, clears the password input field and gives it input focus. If the password matches, it fires the plug that leads to the password-protected application function.

    // Validate password
    String password = wdContext.currentContextElement().getPassword();

    if ((password == null) ||   ( ! password.equals("thePassword")))   {
            wdComponentAPI.getMessageManager().reportException (
                "Please enter administrator password", true);
        
        // Clear the input field and give it focus.
        wdContext.currentContextElement().setPassword (null);
        setInputFocus();
        }
    else    {
        // Password OK. Got to admin view.
        wdThis.wdFirePlugToSystemAdminView();
    }

Former Member
0 Kudos

Hi,

best way is to create two out bound plugs and put your " if " condition in the respective action method of the button.

call the necessary plug depending upon the condition.

Former Member
0 Kudos

Hi,

wdDoModify() will be called whenever <b>any</b> action belonging to the view controller is processed.

So, best choice for you will be, to have a button, and in the action for the button, you can have the 'if' condition to navigate to different views.

Regards,

Prabhakar.

former_member186016
Active Contributor
0 Kudos

Most probably on sybmit of button you will have the navigation.

Create two OutBound plugs. Connect one to one view and other to other view.

On Press of button, the action will be called. In the action check the "if" statement and file corressponding plug.

Regards,

Ashwani Kr Sharma