You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Sy...@swisscom.com on 2002/11/20 15:56:14 UTC

XMLForm: dynamic content listbox

Hello,

I'm using listbox in XMLForm (with tag <xf:selectOne selectUIType="listbox">). The content of the listbox (the items listed) is hard-coded in the xml document (view) like that:

<xf:selectOne selectUIType="listbox">
 <xf:item id="unix">
  <xf:caption>Unix</xf:caption>
  <xf:value>Unix></xf:value>
 </xf:item>
 <xf:item id="windows">
  <xf:caption>Windows</xf:caption>
  <xf:value>Windows</xf:value>
 </xf:item>
</xf:selectOne>

Is there a possibility to retrieve dynamically these items from a database instead of using the hard-coded items in xml document??

Thank you
Sylvain

---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>


Re: XMLForm: dynamic content listbox

Posted by Josema Alonso <al...@aafunky.com>.
Hello.

I had a very similar problem a few days ago. The way to go is the itemset
tag as used in the wizard demo. Take a look at the 'userIdentity.xml' file
where the Hobbies get listed:
<xf:selectMany ref="/hobby" selectUIType="checkbox">
<xf:caption>Hobbies</xf:caption>
    <xf:itemset nodeset="allHobbies">
        <xf:caption ref="value"/>
        <xf:value ref="key"/>
    </xf:itemset>
</xf:selectMany>

All you have to do is to change the UIType to the one desired and fill the
items with values taken from the DB, for example from the action.

Hope it helps,
Josema.


----- Original Message -----
From: <Sy...@swisscom.com>
To: <co...@xml.apache.org>
Sent: Wednesday, November 20, 2002 3:56 PM
Subject: XMLForm: dynamic content listbox


> Hello,
>
> I'm using listbox in XMLForm (with tag <xf:selectOne
selectUIType="listbox">). The content of the listbox (the items listed) is
hard-coded in the xml document (view) like that:
>
> <xf:selectOne selectUIType="listbox">
>  <xf:item id="unix">
>   <xf:caption>Unix</xf:caption>
>   <xf:value>Unix></xf:value>
>  </xf:item>
>  <xf:item id="windows">
>   <xf:caption>Windows</xf:caption>
>   <xf:value>Windows</xf:value>
>  </xf:item>
> </xf:selectOne>
>
> Is there a possibility to retrieve dynamically these items from a database
instead of using the hard-coded items in xml document??
>
> Thank you
> Sylvain
>
> ---------------------------------------------------------------------
> Please check that your question  has not already been answered in the
> FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>
>
> To unsubscribe, e-mail:     <co...@xml.apache.org>
> For additional commands, e-mail:   <co...@xml.apache.org>
>



---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>