Hi Shahzad,
Concerning your first question, there are many ways to set session data without involving Java. In the example you gave, you want to set session data based on the choice made by the caller in a 3 option menu. I believe you don't actually need to do this, you can always look at the element's "value" element data to get the choice made by the caller. So if you access the element data for the 3 option menu, the result would be 1, 2 or 3, depending on what the caller entered. Remember, while element data can only be
set by an element, you can
access element data from anywhere including an action element.
However if you want to set session data and use that instead of element data, you can easily do this by following the procedure:
- Open up the Data tab of the 3 option menu element.
- Select the "Session" radio button and enter a name for the session data, for example "MyMenuChoice".
- For the value, clock on the {} to bring up the substitution dialog.
- Choose the ElementData tab, select the 3 option menu element from the dropdown menu and next to element data enter "value", which is the element data variable that contains the choice made by the caller.
- Click on the "Add Tag" button to add the substitution and click on Ok to exit the dialog.
- Make sure that next to "Create:" you select "After" - this is very important.
What this will do is create a session data variable named "MyMenuChoice" after the 3 option menu has completed with its value coming from the element data variable created by the element that contains the choice made by the caller.
You can then code the action element to look at this session data and do what you want to do with it.
Hope this helps!