NetTalk Central
NetTalk Web Server => Web Server - Ask For Help => Topic started by: ianburgess on July 24, 2012, 12:07:36 AM
-
I have a form which has a number of tabs. Is there a way of opening the form and it automatically going to a particular tab?
Thanks
Ian
-
yes, but it's slightly different for different tab types. Are you using the "tabs" tab type? (not "wizard" etc?)
-
Yes I am using "Tab". I saw that when you hover over a tab it shows a hash anchor, eg. "'#tab_updateuser_self3_div'" where "3" is the 3rd tab, but I wasn't sure where to go from there to actually open the tabbed form on the 3rd tab?
Thanks
Ian
-
I should have said that I am opening the form direct from another form using
'change_btn=change&_bidv_=' & p_web.AddBrowseValue('pageheadertag','Users',USE:ById,p_web.GetSessionValue('LoginUserID'))
-
the tab to open is stored in the session value;
p_web.GSV('showtab_procedurename')
As I recall it is zero based (ie first tab = 0)
you can set this in your code, or perhaps set it based on a parameter (if the parameter exists.)
cheers
Bruce
-
Ok thanks. Where in the form procedure would you embed, for example,
p_web.SSV('showtab_procedurename',3), in order to open the form at tab 3? Obviously, the setting of the session variable would be conditional in some way.
-
Ok I have found that I can embed in the "GenerateForm" embed point and get it to open a specific tab. My problem is now how to pass the tab number from the calling procedure.
I have tried setting a session variable "StartTab" when the button is pressed that launches the form, but I cannot find an embed point that is triggered when a button on a form is pressed? It seems that if you set the "On Click" to run a procedure, then the Server Side code is never run.
I could perhaps embed the "On click" called procedure in the Server Side code, but not sure what to embed - I am calling procedure UpdateUser_Self with a parameter of 'change_btn=change&_bidv_=' & p_web.AddBrowseValue('pageheadertag','Users',USE:ById,p_web.GetSessionValue('LoginUserID'))
... so that the form is opened from another form at the correct record.
-
so you could add a parameter to the URL. for example;
tab=2&change_btn etc.
Then in the code;
if p_web.IfExistsValue('tab')
p_web.SSV('showtab_procedurename',p_web.GetValue('tab'))
End
-
Thanks Bruce. I was so intent on setting a session variable on the button press and reading it in the form that I overlooked the obvious!
I have done what you suggest and it works fine.