How to pass input.TypedValue as input parameter of popup?

Hi,

How can I pass the value of an input field (TypedValue) as an input parameter of a Popup?

I am using MyInputField.TypedValue, and even though the field has a value, it's always blank.

Thank you for your help.

Add an input parameter to your popup screen and set that value when you activate the pop-up.   You shouldn't be accessing the TypedValue. An input field is bound to a variable. Send that variable to the pop-up parameter

Hi David,

Unless you have a very specific scenario, you should probably follow Stacey's advice and not use TypedValue but the variable bound to the MyInputField.

Regarding the Popup, if you want to use your user's input as an Input Parameter of a popup, you will need to:

  • submit said user input;
  • Refresh/Ajax-Refresh the link/button that is going to be open in the popup, so that the URL will include the new value of the variable.

Hi,

Using the variable bound to MyInputField does not work. I don't know why, but perhaps it's because its not contained in a form. There's no "submit" being done, its just a text box where you enter something and then click on a button that opens a popup with that text box's value.

My first attempt just used the MyInputField, but like I said the value is not reflected unto the input field of the popup. I even tried using refresh-ajax on the button that opens the popup onchange of the text box, to sort of force the button to regenerate the correct url, but it doesn't work.

It's a simple use case, create a blank screen, add a text local variable, add a text input field bound to that local variable, add a button, add popup editor linked to that button going to a popup that takes a text input - and you can see it not pass the value.

I'm sure I'm missing something here... any help appreciated, and thank you!

Is this your real use case or just something you are testing. If you want to share your OML, that might help. If not, I'll try to build a sample for you later.

Hi Stacey, 

I created an OML so that this is easy to see. See attached.

Of course, if I add an onchange event to the text box to ajax refresh the Open Popup button - then it works. So I think I can mark this all as resolved...

Thank you!

Hi David,

That is indeed the solution.

Like I was (trying to?) explain above, when your page was initially rendered it generated the HTML for your button with the (then) current value of MyInputField. This means that when you type something into your input field and press the button, you're not going to be using the input's current value but the original value it had when first rendered.

If you want the button to use the current value of your MyInputField, you have to either use the OnChange destination to trigger an Ajax Refresh of the Button (maybe include the Popup_Editor too?) or somehow trigger it when the input looses the focus (trickier, requires a bit of JavaScript and some extra "tape").

I'm curious though, at first you mentioned that this approach hadn't worked:

My first attempt just used the MyInputField, but like I said the value is not reflected unto the input field of the popup. I even tried using refresh-ajax on the button that opens the popup onchange of the text box, to sort of force the button to regenerate the correct url, but it doesn't work.

What where you doing differently then?

Anyways, glad you solved your problem!


Hi Jorge,

Thanks such much for your input, and sorry if I misunderstood what you meant - I'm still relatively new to OS.

What I was doing differently when it didn't work, I believe, is initiating a click on the button that triggers the popup right away and not once the ajax refresh completed. I will do some more testing to work this out.

Thanks again,

David