AjaxObserveField with radioButtons
AjaxObserveField with radioButtons
- Subject: AjaxObserveField with radioButtons
- From: GILQUIN Pierre <email@hidden>
- Date: Thu, 15 Jun 2017 10:41:07 +0200
Hi
I have 2 RadioButton Yes/NO. When Yes is selected a textfield is visible
and a value can be set.
When NO is selected, the texfield is hided using a conditionnal.
Selectionning YES back, the textfield become visible but the value is
lost (null is sent)
I want a way to keep the value even if the textfield was hidden.
It's work with a popup as there only one id and I can use fullSubmit =
false. But with radiobuttons, there are many id and fullSubmit = true
must be used.
With fullSubmit = true, the hidden textfield send a null value ...
Thanks for any idea/workaround ?
Pierre
The html is the following :
<wo:form>
<wo:AjaxUpdateContainer id = "globalContainerId">
<wo:AjaxObserveField observeFieldID = "popUpButton"
updateContainerID = "globalContainerId" fullSubmit = "false" />
<wo:repetition list = "$list" item = "$item">
<wo:radioButton name = "RB" id ="$item" value = "$item"
selection = "$selectedItem" />
<wo:AjaxObserveField observeFieldID = "$item"
updateContainerID = "globalContainerId" fullSubmit = "true" />
<wo:string value = "$item" />
</wo:repetition>
<wo:conditional condition = "$popupIsYes">
<wo:textField id = "hiddenField" value = "$hiddenField" />
<wo:AjaxObserveField observeFieldID = "hiddenField"
updateContainerID = "globalContainerId" fullSubmit = "false" />
</wo:conditional>
</wo:AjaxUpdateContainer>
in java :
list = new NSArray<String> (new String[]{"Yes","No"});
public boolean popupIsYes() {
if (selectedItem().equalsIgnoreCase("Yes"))
{
return true;
}
return false;
}
+ get/set for item and selectedItem
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden