cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Duncan McLean" <>
Subject "Losing data" when hiding/showing group in form
Date Wed, 01 Feb 2006 10:21:04 GMT

Hope someone can help.

I have a relatively simple form, which amongst other things will
hide/show a group of fields depending on the state of a radio button.

There are two groups "Life1" and "Life2".

- Life1 is always shown
- Life2 is only shown when the radio button is set to "Joint" (and has an
initial state of "invisible".

The hiding/showing mechanism works fine, however, when I submit the form
after selecting Joint and entering data, and later revisit that form, the
data in the Life2 group is not preserved. Life1 group is unaffected.

Anybody know why this is occurring?

Relevant parts of form:

Radio button def:

    <fd:field id="kwdSingleJoint">
		<fd:label>Is this policy a Single Life or Joint Life policy?</fd:label>
		<fd:datatype base="string"/>
			<fd:item value="Single"/>
			<fd:item value="Joint"/>
			  var value = event.source.value;
			  var life2widget = event.source.lookupWidget("../life2");
			  if (value == "Joint")

and part of Life2 def:

	<fd:group id="life2" state="invisible">
		<fd:field id="title2">
		  <fd:datatype base="string" />
			   <fd:item value="Mr"/>
			   <fd:item value="Mrs"/>
			   <fd:item value="Miss"/>
			   <fd:item value="Ms"/>
			   <fd:item value="Dr"/>
			   <fd:item value="Fr"/>
			   <fd:item value="Br"/>
			   <fd:item value="Sr"/>
			   <fd:item value="Rev"/>

		<fd:field id="firstName2">
			<fd:label>First Name</fd:label>
			<fd:datatype base="string" />



Thanks in advance


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message