[How To] Show fields based on options
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
[How To] Show fields based on options
Hi everyone,
On my application, I have a stack that will work as a options dialog.
On this stack I have several fields, but some of the fields should be different based on the value of a option button (one of the fixed fields).
EX:
--------------------
Field AA
Field BB
Option Button = 1
>> Field CC
>> Field DD
--------------------
Field AA
Field BB
Option Button = 2
>> Field EE
>> Field FF
--------------------
Anyone has any suggestion on what would be the best way to do this?
Many thanks in advance,
- Miguel
On my application, I have a stack that will work as a options dialog.
On this stack I have several fields, but some of the fields should be different based on the value of a option button (one of the fixed fields).
EX:
--------------------
Field AA
Field BB
Option Button = 1
>> Field CC
>> Field DD
--------------------
Field AA
Field BB
Option Button = 2
>> Field EE
>> Field FF
--------------------
Anyone has any suggestion on what would be the best way to do this?
Many thanks in advance,
- Miguel
Re: [How To] Show fields based on options
Hi.
On a new card drag over a new option menu. Put this into its script:
Comment out one or the other. This gives you several ways (there are others) to think about how to make the users selection do what you want. Do you need help translating the results of the menu selection to your own task?
Craig Newman
On a new card drag over a new option menu. Put this into its script:
Code: Select all
on menuPick pItemName
answer the menuHistory of me
end menuPick
on menuPick pItemName
answer "Number" && menuHistory of me
end menuPick
on menuPick pItemName
switch pItemName
case "choice 1"
answer "Number 1"
break
case "choice 2"
answer "Number 2"
break
end switch
end menuPick
on menuPick pItemName
switch pItemName
case "choice 1"
case "choice 2"
answer pItemName
end switch
end menuPick
Craig Newman
Re: [How To] Show fields based on options
OK maybe I did not explain correctly.
I know how to check for changes on the option button and based on that, execute something.
My question was regarding the fields that should be visible / hidden.
The idea is that the fields will be displayed on the same place (so no empty areas when ones disappear and the others become visible)
Should I implement this with different cards? with groups and changing the group content?
You know what I mean?
thanks
I know how to check for changes on the option button and based on that, execute something.
My question was regarding the fields that should be visible / hidden.
The idea is that the fields will be displayed on the same place (so no empty areas when ones disappear and the others become visible)
Should I implement this with different cards? with groups and changing the group content?
You know what I mean?
thanks
Re: [How To] Show fields based on options
Hi again.
So if you have two fields with the same rect and at the same loc, what is wrong with simply showing one and hiding the other on the same card? I wonder if there would be a noticeable glitch if you do that. But you can always lock and unlock the screen. Are there visual effects involved?
If the fields to be shown and hidden are always the same, you can group them to simplify the process. Otherwise you can "group" then by some property, to identify them as you cycle through whatever process you use to show/hide.
I still suspect that I am not understanding, since I bet you knew all of what I just said already as well.
Craig
So if you have two fields with the same rect and at the same loc, what is wrong with simply showing one and hiding the other on the same card? I wonder if there would be a noticeable glitch if you do that. But you can always lock and unlock the screen. Are there visual effects involved?
If the fields to be shown and hidden are always the same, you can group them to simplify the process. Otherwise you can "group" then by some property, to identify them as you cycle through whatever process you use to show/hide.
I still suspect that I am not understanding, since I bet you knew all of what I just said already as well.
Craig
Re: [How To] Show fields based on options
Lets see if an image helps 
Imagine a stake like this, where the field OPTION (in red) define which fields are visible below it:

Is it clearer now ?

Imagine a stake like this, where the field OPTION (in red) define which fields are visible below it:

Is it clearer now ?
Re: [How To] Show fields based on options
Hi Miguel,
Yeah, that looks like hide/show group. Simon
Yeah, that looks like hide/show group. Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
Re: [How To] Show fields based on options
Okidoky
thanks
thanks
