cancel
Showing results for 
Search instead for 
Did you mean: 

BSP : Calling script on onClientClick - how to get the result event?

prabhu_s2
Active Contributor
0 Kudos

Hi All

In my application (BSP) there is a new button created which calls a javascript "Script_DS()":

      <htmlb:button id            = "RelLockButton"

                     design        = "emphasized"

                     text          = "Unlock shift report"

                     tooltip       = "<%= tool_tip %>"

                     disabled      = "<%= unlock %>"

                     onClick       = "OnInputProcessing"

                     onClientClick = "htmlbevent.cancelSubmit=!Script_DS('<%= shopflr %>')" />

The calling script open a new window "RelConfirmation.htm" using:

function Script_DS(args)

{

    var settings = 'dialogHeight: 190px; dialogWidth: 380px; dialogTop: 500px; dialogLeft: 500px; edge: Raised; center: Yes; help: No; resizable: No; status: No; toolbar: No; menubar: No; scroll : no';

    var arg = new Object();

    arg.val = args;

    var return_detail = window.showModalDialog('RelConfirmation.htm',arg, settings);

     if (return_detail != null)

     {

       return true;

     }

     return false;

}

The window "RelConfirmation.htm" just has some text displayed and a button "confirm" or "Cancel" button....Since some of the validation in the main page "Main.htm" from where the page RelConfirmation.htm called are dependant on the user selection (either "confirm" or "Cancel" ) there is a need for me to retrieve the user selection back to the main page....can u please advise on how to handle this?

Accepted Solutions (0)

Answers (1)

Answers (1)

gabriel_candrian
Explorer
0 Kudos

Hello Prabhu S

You can use the BSP-Tag <bsp:htmlbEvent> in your main page "Main.htm" to generate a javascript function which can be triggered by the dialog "RelConfirmation.htm" depending on the button pressed by the user (by using the opener reference to access the main page). This javascript function will trigger a HTMLB event that can be handled by your application. You can define up to three parameters for the generated javascript function whose values will be passed to the HTMLB event.

The parameter "onClick       = "OnInputProcessing"" of the button is not needed anymore then.


Regards

Gabriel