How to set value to Local variable using javascript code?

How to set value to Local variable using javascript code?

  

How to set value to Local variable using javascript code?

Hi Suhas Jamdade,

On Web or Mobile, Please Update your problem and case briefly.


Manikandan K

ManiKandan Kaliamoorthy wrote:

Hi Suhas Jamdade,

On Web or Mobile, Please Update your problem and case briefly.


Manikandan K

Its for web.


I have to find the width of window and using that window width apply some calculation and set the result to local variable. So that I can set it to If condition and for start Index for table records.

Hi Suhas,

You can use a hidden input.

With javascript you set the value on the hidden input, and then fire the onChange event.

On the input itself, set the onChange to be binded to a server action that will do your logic.

Hope it helps

Henrique Batista wrote:

Hi Suhas,

You can use a hidden input.

With javascript you set the value on the hidden input, and then fire the onChange event.

On the input itself, set the onChange to be binded to a server action that will do your logic.

Hope it helps

Hello Henrique, 
It's not working. On run time I have to set the value.


Hi Suhas,

What do you mean by not working? What have you tried? Are there errors? 

Otherwise it will just a guess.

Cheers,

Henrique Batista wrote:

Hi Suhas,

What do you mean by not working? What have you tried? Are there errors? 

Otherwise it will just a guess.

Cheers,

 Hey Hi Henrique,
Javascript value bind with input box and Set the session variable. For Local variable it was not working so I use the Session to set the value and It works.

Thanks for your reply.


I'm using a hidden input associated to a local variable with ajax refresh when necessary to use value in screen.
It's work fine for me.