cancel
Showing results for 
Search instead for 
Did you mean: 

sending data back to GUI from MII tranx

shaji_chandran
Participant
0 Kudos

Hi All,

         I have got a specific requirement and I am struggling to find a solution for the same. It would be great if any one has some idea how to achieve it.

1) I have a GUI (jsp/irpt/html) to capture the data from browser

2) Once I capture the data I submit the GUI page and I want to send this data to a MII Tranx/SQL Query which will invoke a procedure at database.

3) This proceduers has got an output parameter which will return a value

4) depending on the output parameter value I want to route the control to a different GUI's

Could you please let me know how can I achieve this. I am using MII version 12.1.9

Any help on this very much appreciated

Thanks

Shaji

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

1) call the transaction however you want. Either through AJAX calls or an iCommand. Don't do a form submit, just use a simple button input and on click execute the transaction.

     <input type="button" value="process" onclick="submitTrx()" />

     function submitTrx()

     {

          document.command.executeCommand();

2) When you get the result do your logic to find the URL you want to redirect to.

          var outputValue = document.command.getDataObject().getValue(1,1);

          if(outputValue == 1)

              redirectPage("URL1.irpt");

          else if(outputValue == 2)

               redirectPage("URL2.irpt");

     }

3) Set the window to that url

     function redirectPage(url)

     {

          //If in the MII portal set the src to the url.

          if(document.parent.MainContentFrame)

               document.parent.MainContentFrame.src = url;

          //If in its own window or tab just set the window location.

          else

               window.location = url;

     }