• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: AjaxObserveField with radioButtons
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: AjaxObserveField with radioButtons


  • Subject: Re: AjaxObserveField with radioButtons
  • From: Ralf Schuchardt <email@hidden>
  • Date: Thu, 15 Jun 2017 12:30:37 +0200

Do you worry about the ID requirement? It may be derived from the component ID
like in radiobutton lists. We have also implemented this mechanism with a
positional relation of the depended field (the next sibling div of the div
surrounding the radiobuttons).

Ralf

-- 
Ralf Schuchardt
Sent with Airmail

Am 15. Juni 2017 um 11:39:21, GILQUIN Pierre (email@hidden) schrieb:

Thanks Ralf,

You are right that is the solution.

But I have a  component used in many places. I still need to fix that in the
ajax wonder way ....

Pierre




Le 15.06.2017 à 11:30, Ralf Schuchardt a écrit :
Hi Pierre,

we do this directly in JavaScript (jQuery) and CSS without Ajax. Some
radiobuttons have a special CSS class and a data-attribute with the id of the
field (or surrounding DIV) to hide. A click handler reads the radiobuttons
value attribute and decides to either hide or display the connected field. As
this is only a display change on the client side, any value in the textfield is
still send on the next normal submit.

-- 
Ralf Schuchardt
Sent with Airmail

Am 15. Juni 2017 um 10:41:18, GILQUIN Pierre (email@hidden) schrieb:

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

Attachment: signature.asc
Description: Message signed with OpenPGP using AMPGpg

 _______________________________________________
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

  • Follow-Ups:
    • Re: AjaxObserveField with radioButtons
      • From: GILQUIN Pierre <email@hidden>
References: 
 >AjaxObserveField with radioButtons (From: GILQUIN Pierre <email@hidden>)
 >Re: AjaxObserveField with radioButtons (From: Ralf Schuchardt <email@hidden>)
 >Re: AjaxObserveField with radioButtons (From: GILQUIN Pierre <email@hidden>)

  • Prev by Date: Re: AjaxObserveField with radioButtons
  • Next by Date: Re: AjaxObserveField with radioButtons
  • Previous by thread: Re: AjaxObserveField with radioButtons
  • Next by thread: Re: AjaxObserveField with radioButtons
  • Index(es):
    • Date
    • Thread