Sending ComboBox value to another page and opening page in another tab as well

Sending ComboBox value to another page and opening page in another tab as well

  

After 2 days of frustration trying to get this to work I thought I better post, somebody else is bound to have the same problem.

When using a link or button to click and then navigate to another page where a parameter is passed that is obtained from a combo box on the current page then 0 is always passed for the combo box selected value. There MUST be a SUBMIT on a page with a combo box else the value cannot be passed to another page.

In my specific case I want to generate a report and the user selects the contract for which the report is to be generated from a list in a ComboBox and then I want to open the report in a new browser tab page.

The things I tried to make it work that you should not try:

I tried putting the selected ComboBox value into a local variable in the OnChange event of the ComboBox, but that is also always passing zero to the other page.

Then I thought I can use a technique I used on other combo boxes where in OnChange event I needed to popup a question to warn user the combo box change will have effects on data being deleted, I implemented this by using a hidden link linked to the popup that I clicked with Widget_Click in the ComboBox OnChange event (Oh and it must be hidden using extended property style='display:none' you cannot use the Visible=False property because that removes the link from the page entirely, it does not only not display it but annihilates it).

So the idea was to use a hidden link then when I click on the button to generate the report (which is now a submit and no longer a navigate) and then have a hidden link set as "navigate" with the “target=_blank’” extended property set, then when the button is clicked it will submit and I will use Widget_Click to click the link and it will navigate to the report page.  I tried this and it does not work, this technique ONLY works if the navigate link is used with a popup to open the popup. If it is not associated with a popup but navigates to another page, the Widget_Click does not work on the link, it does not get clicked.

To solve that problem I rather then use a hidden button, so then it works the Widget_Click does click the a navigate button and does open the other page. But I forgot that off course extended property "target=’_blank’"  does not work on buttons, so it opens the report now with the correct ComboBox value but it does not open it in a new tab.

So now I am stuck with a conundrum, I cannot use a hidden link because Widget_Click will only work on hidden link if it is associated with a popup or not a "navigate" link, I also cannot use a button because it does not work with "target=’_blank’".

My solution:

  • Create a local Text variable ‘ReportUrl’
  • On screen I have the ComboBox the user selects the Contract to print the report for
  • In the Preparation set a default value to the ‘Report Url’
  • Create the Link-button to “Generate” the report (I style my link to look like a button), it is set as Method ‘Navigate’, the Destination for this is ‘Common\ExternalUrl’ with the Url set to the variable ‘ReportUrl’
  • Next to the Link-button I create an actual button with Method “Submit” and extended property style=’display:none’.
  • In OnChange of the ComboBox I call Widget-Click for to click the hidden submit button, then I build the required report page URL and assign it to “ReportUrl” variable.

The screen with a "Generate Report" link that looks like a button with the "target='_blank'" set and the hidden submit button:




The "OnChange" event of the ComboBox:

Solution

Elize van der Riet wrote:

After 2 days of frustration trying to get this to work I thought I better post, somebody else is bound to have the same problem.

Thanks for posting your problem, and solution here! We appreciate it and am glad you were able to figure it out.


Thanks,

Alexandra


Solution