NetTalk Central

Author Topic: Hiding a tab based on drop-down condition  (Read 4411 times)

rupertvz

  • Sr. Member
  • ****
  • Posts: 323
    • View Profile
    • Email
Hiding a tab based on drop-down condition
« on: October 24, 2011, 06:37:53 AM »
Hi Guys,

On a wizard-form;

Is it possible to hide a tab based on a drop-down value selected on a previous tab?
I notice in some earlier posts that the dynamic option was not yet supported, not sure if it is supported already?
I am trying p_web.c002:field = 1 as a condition, but doesn't work.
Not sure where I am going wrong ...

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11244
    • View Profile
Re: Hiding a tab based on drop-down condition
« Reply #1 on: October 24, 2011, 07:20:50 AM »
try

p_web.GSV('c002:field') = 1

cheers
Bruce

rupertvz

  • Sr. Member
  • ****
  • Posts: 323
    • View Profile
    • Email
Re: Hiding a tab based on drop-down condition
« Reply #2 on: October 24, 2011, 07:44:25 AM »
Thanks Bruce,

Should I use the "Tab Condition" or the "Tab Hide IF" rather?

I tried both options, but can't get it to work.

Should I do something on the drop-down box to make the tab "refresh"?

Rene Simons

  • Hero Member
  • *****
  • Posts: 650
    • View Profile
Re: Hiding a tab based on drop-down condition
« Reply #3 on: October 24, 2011, 01:29:13 PM »
Hi Rupert,

  • Give the tab you put the condition on an equate name;
  • On the drop down, go to the Client side tab and check the send new value to server box;
  • Click the Server code button;
  • In the 'Add serverside code here' type p_web.ssv('c002:field',c002:field);
    This assigns the value of c002:field to (new) sessionvar c002:field Bruce refers to.
  • In the reset list add the equate name you gave to the tab you put the condition on.

Keep in mind that sending values to the server and resetting fields (equates) can be a bit delayed.

Kind regards,
Rene
Rene Simons
NT14.14

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11244
    • View Profile
Re: Hiding a tab based on drop-down condition
« Reply #4 on: October 24, 2011, 11:16:28 PM »
what Rene said plus;

>> Should I use the "Tab Condition" or the "Tab Hide IF" rather?

Tab hide IF.

cheers
Bruce

rupertvz

  • Sr. Member
  • ****
  • Posts: 323
    • View Profile
    • Email
Re: Hiding a tab based on drop-down condition
« Reply #5 on: October 25, 2011, 12:49:24 AM »
Thanks Rene, Bruce,

I am on version 5.37
I still can't get it to work, what is the command to manually reset / refresh the "tab"?

What I've done;
1.  Gave the tab an equate label;  Tab1a
2.  Clicked the box "send new value to server"
3.  Entered the Server Code to set the new session variable value
4.  Upon changing tabs, I tested and the new session value is correctly set
5.  I added the "Tab1a" equate to my reset list (unchecked the prompt, value and comment boxes)

I've tried various conventions, but can't get the tab to hide / unhide according to the session value set on the previous tab.

I suspect the problem is with "refreshing" the tab ...



Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11244
    • View Profile
Re: Hiding a tab based on drop-down condition
« Reply #6 on: October 25, 2011, 12:57:11 AM »
I recommend going to 5.38 since it contains (amongst other things) the following fix;

>> Fix: Problem hiding and unhiding tabs, if tabs are not currently in the order they were created in.

Cheers
Bruce

rupertvz

  • Sr. Member
  • ****
  • Posts: 323
    • View Profile
    • Email
Re: Hiding a tab based on drop-down condition
« Reply #7 on: October 26, 2011, 07:13:31 AM »
Thanks for the help Rene, Bruce,

I downloaded  5.38 and now seems to be sorted.
Still had some difficulty making it work with the drop-down box, but changed to radio buttons with success :-)