You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by JLe <my...@trashymail.com> on 2008/08/21 15:32:44 UTC

One Of Many selection list with radio buttons

Hi,
I'm trying to realize a list of option where one can be selected (one of
many).
i tried this:

=============================== formDefinition
====================================

<?xml version="1.0" encoding="ISO-8859-1"?>
<fd:form xmlns:fd="http://apache.org/cocoon/forms/1.0#definition">
	<fd:widgets>
		<fd:aggregatefield xmlns:fn="http://www.w3.org/2005/02/xpath-functions"
id="editingchoice">
			<fd:widgets>
				<fd:booleanfield id="product">
					<fd:label>product</fd:label>
				</fd:booleanfield>
				<fd:booleanfield id="component">
					<fd:label>component</fd:label>
				</fd:booleanfield>
				<fd:booleanfield id="track">
					<fd:label>track</fd:label>
				</fd:booleanfield>
			</fd:widgets>
		</fd:aggregatefield>
	</fd:widgets>
</fd:form>

=============================== formTemplate
====================================
<page xmlns:fn="http://www.w3.org/2005/02/xpath-functions" 
	xmlns:jx="http://apache.org/cocoon/templates/jx/1.0" 
	xmlns:fi="http://apache.org/cocoon/forms/1.0#instance" 
	xmlns:ft="http://apache.org/cocoon/forms/1.0#template">
 
	<jx:import
uri="servlet:forms:/resource/internal/generation/jx-macros.xml"/>
	<content onselectstart="return false">
		<ft:form-template method="POST"
action="#{$cocoon/continuation/id}.continue" ajax-action="continue-form">
			<ft:widget id="product">
				<fi:styling list-type="radio"/>
			</ft:widget>
			<ft:widget-label id="product"/>
			<br/>
			<ft:widget id="component">
				<fi:styling list-type="radio"/>
			</ft:widget>
			<ft:widget-label id="component"/>
			<br/>
			<ft:widget id="track">
				<fi:styling list-type="radio"/>
			</ft:widget>
			<ft:widget-label id="track"/>
			<br/>
		</ft:form-template>
	</content>
</page>

=================================================================

But there is first no one of many, every entry can be selected, and there
are no radio buttons to, there are checkboxes??
What's wrong?

regards
-- 
View this message in context: http://www.nabble.com/One-Of-Many-selection-list-with-radio-buttons-tp19088871p19088871.html
Sent from the Cocoon - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


RE: One Of Many selection list with radio buttons

Posted by Jasha Joachimsthal <j....@onehippo.com>.
Hello,

If you want radiobuttons use a field widget with a selection-list
instead of booleanfield. See [1] for the documentation.

[1] http://cocoon.apache.org/2.2/blocks/forms/1.0/753_1_1.html 

Jasha Joachimsthal 

www.onehippo.com
Amsterdam - Hippo B.V. Oosteinde 11 1017 WT Amsterdam +31(0)20-5224466 
San Francisco - Hippo USA Inc. 101 H Street, suite Q Petaluma CA
94952-3329 +1 (707) 773-4646



> -----Original Message-----
> From: JLe [mailto:my-own-email@trashymail.com] 
> Sent: donderdag 21 augustus 2008 15:33
> To: users@cocoon.apache.org
> Subject: One Of Many selection list with radio buttons
> 
> 
> Hi,
> I'm trying to realize a list of option where one can be 
> selected (one of many).
> i tried this:
> 
> =============================== formDefinition 
> ====================================
> 
> <?xml version="1.0" encoding="ISO-8859-1"?> <fd:form 
> xmlns:fd="http://apache.org/cocoon/forms/1.0#definition">
> 	<fd:widgets>
> 		<fd:aggregatefield 
> xmlns:fn="http://www.w3.org/2005/02/xpath-functions"
> id="editingchoice">
> 			<fd:widgets>
> 				<fd:booleanfield id="product">
> 					<fd:label>product</fd:label>
> 				</fd:booleanfield>
> 				<fd:booleanfield id="component">
> 					<fd:label>component</fd:label>
> 				</fd:booleanfield>
> 				<fd:booleanfield id="track">
> 					<fd:label>track</fd:label>
> 				</fd:booleanfield>
> 			</fd:widgets>
> 		</fd:aggregatefield>
> 	</fd:widgets>
> </fd:form>
> 
> =============================== formTemplate 
> ====================================
> <page xmlns:fn="http://www.w3.org/2005/02/xpath-functions" 
> 	xmlns:jx="http://apache.org/cocoon/templates/jx/1.0" 
> 	xmlns:fi="http://apache.org/cocoon/forms/1.0#instance" 
> 	xmlns:ft="http://apache.org/cocoon/forms/1.0#template">
>  
> 	<jx:import
> uri="servlet:forms:/resource/internal/generation/jx-macros.xml"/>
> 	<content onselectstart="return false">
> 		<ft:form-template method="POST"
> action="#{$cocoon/continuation/id}.continue" 
> ajax-action="continue-form">
> 			<ft:widget id="product">
> 				<fi:styling list-type="radio"/>
> 			</ft:widget>
> 			<ft:widget-label id="product"/>
> 			<br/>
> 			<ft:widget id="component">
> 				<fi:styling list-type="radio"/>
> 			</ft:widget>
> 			<ft:widget-label id="component"/>
> 			<br/>
> 			<ft:widget id="track">
> 				<fi:styling list-type="radio"/>
> 			</ft:widget>
> 			<ft:widget-label id="track"/>
> 			<br/>
> 		</ft:form-template>
> 	</content>
> </page>
> 
> =================================================================
> 
> But there is first no one of many, every entry can be 
> selected, and there are no radio buttons to, there are checkboxes??
> What's wrong?
> 
> regards
> --
> View this message in context: 
> http://www.nabble.com/One-Of-Many-selection-list-with-radio-bu
> ttons-tp19088871p19088871.html
> Sent from the Cocoon - Users mailing list archive at Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org