NetTalk Central

Author Topic: Other button on a browse not execute embed code if open popup  (Read 3135 times)

Robert Iliuta

  • Sr. Member
  • ****
  • Posts: 472
    • View Profile
    • Email
Other button on a browse not execute embed code if open popup
« on: December 03, 2014, 12:33:24 AM »
Hallo,


In a browse I have a button which open a popup form. The problem is that if I choose to open a popup form then the code I have in embed (Validate::Other18) will not execute... WHY? is this a limitation? or a bug? then how can I pass parameters to the popup window? any workaround please?

thank you for any help,
Robert

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Other button on a browse not execute embed code if open popup
« Reply #1 on: December 03, 2014, 01:34:23 AM »
>> WHY?

Because the browser is making "a request". The request to open the popup. If it also wanted to run some code on the server side, that would be a separate request. That's do'able (on my side) but is a bad idea because you can't guarantee which of the 2 requests will run first. So "setting" a value in one, and then "using" it in the other would work some of the time, but not at other times.

>> is this a limitation? or a bug?

It's not a bug :) - and I'm not sure if it's a limitation. It's just the way that a request/response architecture works.

>>  then how can I pass parameters to the popup window?

there is a "parameters" option for the button itself. This takes the form of

'parameter=value&anotherparameter=someothervalue'

In the destination procedure you can "store"the parameter in the SessionQueue

p_web.StoreValue('parameter')

And then in that procedure you just use the SessionValue as you would naturally do.

Robert Iliuta

  • Sr. Member
  • ****
  • Posts: 472
    • View Profile
    • Email
Re: Other button on a browse not execute embed code if open popup
« Reply #2 on: December 03, 2014, 08:38:57 PM »
>>Because the browser is making "a request". The request to open the popup. If it also wanted to run some code on the server side, that would be a separate request. That's do'able (on my side) but is a bad idea because you can't guarantee which of the 2 requests will run first. So "setting" a value in one, and then "using" it in the other would work some of the time, but not at other times.

make sense. thank you. Maybe you can make the button disabled (to avoid confusion) in this case so we know that the button is not available in popup mode :-)
Didn't test the parameter in popup mode...but they works perfect. so I pass parameters now and it's ok.

Thank you,
Robert