Not Getting Session Variable value in javascript

Hi All,

In my web application I have a GetSession server action which is returning me the session details like userid,personalityid etc. Now I am using wijmogrid component in my UI where I need to pass one of the values returned from the session details (the GetSession server action) .

Currently I have got the session value in preparation of the web block and store it in a local variable

personalityid= 

GetSession().UserPersonality.PersonalityId

Then I have used a hidden input box associating with the local variable. 

Then in javascript using the following code to store the value :

var personalityid= document.getElementById('"+Personality.Id+"').value ---- [Personality is the hidden input name]

But still I am not able to pass the value.

Can anyone guide me how can I get this personality id from the server action and pass it through the javascript code.

Hi,

The way you have explained it, it should have worked. Most probably you are making the input field display property to false instead you should add a extended property style with value of "display:none". Can you share the OML to understand better?

Regards.

Prasad Rao wrote:

Hi,

The way you have explained it, it should have worked. Most probably you are making the input field display property to false instead you should add a extended property style with value of "display:none". Can you share the OML to understand better?

Regards.

Hi Prasad,

Sorry can't share the oml file but I have kept the input field inside a container and set the container's display property to False. I will your way but the the problem no way the personality id is getting stored in the database. 


Basically on the javascript over the WijmoGrid, I am using the following code snippet to get the value for the below variables so that I can pass them through the REST API URL to save the data in the database. 


 var userId = outsystems.api.requestInfo.getUserKey();
    var screenId = outsystems.api.requestInfo.getWebScreenKey();
    var espaceId = outsystems.api.requestInfo.getEspaceKey();
    var grid = GridOS.ComponentUtils.getGridObjectById(gridId);
    var personalityid= document.getElementById('"+Personality.Id+"').value
    gridId = grid.gridId;
    var url = "/EVO_CommonWidgets_LIB/rest/Configurations/SaveGridConfigurations?GridId=" + gridId + "&UserId=" + userId + "&ScreenId=" + screenId + "&EspaceId=" + espaceId + "&PersonalityId=" +personalityid ;