Hi Rick,
Let's say I have a modal with:
- a text control
- a pre-populated dropdown control
- a button to toggle which of those 2 controls is visible
- a button to do a postback
I want to know whether the textbox or the selection control is visible at the time the postback takes place.
In a VFP form I'd just check the visible property of the object. In the browser inspector I can add this expression document.getElementById("myTextBox").style.display
and see if it evaluates to "none". What would be the WWC way to determine which control is visible at the time the postback button gets clicked?
TIA

You can check wwRequest::IsFormVar() if the variable was posted back.
This will handle things like enabled
and readonly
which don't post back. More info how you can hide values from posting back in this blog post.
You obviously can't determine the CSS status of a control if a control is set to not visible so you have to rely on enabled
and readonly
to do what you want.
Buttons are controls and they post back their value
property, but make sure the button is set to type="submit"
. Default is type="button"
which is a client side button and does not post back.
Another tricky issue is Checkboxes and Radio buttons which don't post back their values if they are not set. This is why the Html helpers create separate fields for the actual value and are posted as invisible variables.
+++ Rick ---