cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Arthur Bogaart" <a.boga...@hippo.nl>
Subject RE: populating combo box value from a xml file
Date Tue, 06 Jun 2006 16:35:55 GMT
Hi Deepak,
 
Declare the combo box in your Cforms model:

<fd:field id="myComboBox" required="false" nullable="false">
    <fd:label>myComboBox</fd:label>
    <fd:datatype base="string"/>
    <fd:selection-list src="cocoon://my-selection-list.xml"/>
</fd:field>

Ofcourse you can also read your xml-file directly from filesystem by using file:// instead
of cocoon:// but in this example I'm using the i18n transformer to translate my labels.
The xml-file should have the following markup

<fd:selection-list 
  xmlns:fd="  <http://apache.org/cocoon/forms/1.0#definition> http://apache.org/cocoon/forms/1.0#definition"
  xmlns:i18n="  <http://apache.org/cocoon/i18n/2.1> http://apache.org/cocoon/i18n/2.1">
 
    <fd:item value="1">
        <fd:label>
            <i18n:text>my-selection-list.label.1</i18n:text>
        </fd:label>
    </fd:item>
    <fd:item value="2">
        <fd:label>
            <i18n:text>my-selection-list.label.2</i18n:text>
        </fd:label>
    </fd:item>

</fd:selection-list>
 
Hope this helps,
regards,
 
Arthur Bogaart

-----Original Message-----
From: deepakkumar.sahoo@tcs.com [mailto:deepakkumar.sahoo@tcs.com]
Posted At: dinsdag 6 juni 2006 14:06
Posted To: Cocoon User List
Conversation: populating combo box value from a xml file
Subject: populating combo box value from a xml file



HI All, 
I am working on Cforms.I have a combo box .I want the value of the combo box to be populated
from a xml file. 
Can anyone give some suggestion or solution how to do it(i am a beginner). 
Thanks in advance 
Regards,
Deepak Kumar Sahoo
Tata Consultancy Services Limited
Mailto: deepakkumar.sahoo@tcs.com
Website: http://www.tcs.com
=====-----=====-----=====

Notice: The information contained in this e-mail

message and/or attachments to it may contain 

confidential or privileged information. If you are 

not the intended recipient, any dissemination, use, 

review, distribution, printing or copying of the 

information contained in this e-mail message 

and/or attachments to it are strictly prohibited. If 

you have received this communication in error, 

please notify us by reply e-mail or telephone and 

immediately and permanently delete the message 

and any attachments. Thank you






Mime
View raw message