You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Scott Yeadon <sc...@anu.edu.au> on 2004/07/12 04:14:27 UTC

Standard field binding not implemented for selection lists?

Hi,

Based on the CForms documentation, it looks as though the same 
facilities to bind other fields (namely the XPath notation) is not able 
to be used for selection lists. For example, if I have an XML file 
containing a list of elements that I want to display in a list, I either 
have to put in into the Cocoon-specific markup (i.e use the fd:selector 
markup) or need to use Javascript (JXPath) (yuck!) to populate the list. 
Doing the former means I have to essentially hardcode Cocoon-specific 
markup around data that may be useful in several different contexts, not 
just Cocoon, just for the sake of being able to bind into a selection list.

I'm likely to use Java and fudge via an enum type just so I'm not tying 
the data into Cocoon, but I wanted to check that there is no way the 
"standard" binding notation wors for selection lists (i.e. using 
fb:value and path attribute) before I did this.

Thanks.

Scott.

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


Re: Standard field binding not implemented for selection lists?

Posted by Joerg Heinicke <jo...@gmx.de>.
On 12.07.2004 04:14, Scott Yeadon wrote:
> Hi,
> 
> Based on the CForms documentation, it looks as though the same 
> facilities to bind other fields (namely the XPath notation) is not able 
> to be used for selection lists. For example, if I have an XML file 
> containing a list of elements that I want to display in a list, I either 
> have to put in into the Cocoon-specific markup (i.e use the fd:selector 
> markup) or need to use Javascript (JXPath) (yuck!) to populate the list. 
> Doing the former means I have to essentially hardcode Cocoon-specific 
> markup around data that may be useful in several different contexts, not 
> just Cocoon, just for the sake of being able to bind into a selection list.
> 
> I'm likely to use Java and fudge via an enum type just so I'm not tying 
> the data into Cocoon, but I wanted to check that there is no way the 
> "standard" binding notation wors for selection lists (i.e. using 
> fb:value and path attribute) before I did this.

No, there is not. The problem is simply that the selection list (i.e. 
the options) is not the value of the field, but only the selected value. 
The docu of the binding framework has at least a sample on the 
javascript binding code for binding selection lists:
http://cocoon.apache.org/2.1/userdocs/forms/binding.html#fb%3Ajavascript
Enhancing the binding framework with a special fb:selection-list that 
does the same as the javascript code above might helpful though.

Joerg

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