thanks Josema,
after playing a while I found it as well, but still find it a bit
confusing, because there is now direct reference. What I did was
the following:
<!-- ========== code ========== -->
public UserBean () {
initCustomers();
}
public String[] getName() {
return names;
}
public void setName( String[] newNames ) {
names = newNames;
}
public Set getCustomerNames() {
return customerNames.entrySet();
}
public void initCustomers() {
names = new String[] {};
customerNames = new HashMap();
...
fill with database entries
...
}
<!-- ========== /code ========== -->
after this was done in the java bean, I could acces the elements
by using /name as ref value in the xml file.
<!-- ========== code ========== -->
<xf:selectMany ref="/name" selectUIType="checkbox">
<xf:caption>Customer</xf:caption>
<xf:itemset nodeset="customerNames">
<xf:caption ref="value"/>
<xf:value ref="key"/>
</xf:itemset>
</xf:selectMany>
<!-- ========== /code ========== -->
So, but how is the xmlform framework determining the name?
best regards
Lars Kirchhoff
> -----Urspr�ngliche Nachricht-----
> Von: Josema Alonso [mailto:[EMAIL PROTECTED]]
> Gesendet: Freitag, 22. November 2002 16:39
> An: [EMAIL PROTECTED]
> Betreff: RE: XMLForm: dynamic content listbox
>
>
> Hi,
>
> For what I know, the access to the properties by JXPath
> relies on the getter
> and setter methods. So if you read the code in UserBean.java
> you'll see:
> public String[] getHobby()
> {
> return hobbies;
> }
>
> public void setHobby( String[] newHobbies )
> {
> hobbies = newHobbies;
> }
>
> And that's why is accesssed via /hobby.
>
> Please, Ivelin or anyone else, correct me if I'm wrong.
>
> Hope it helps.
>
>
> -----Mensaje original-----
> De: Kirchhoff, Lars [mailto:[EMAIL PROTECTED]]
> Enviado el: viernes, 22 de noviembre de 2002 7:20
> Para: '[EMAIL PROTECTED]'
> Asunto: AW: XMLForm: dynamic content listbox
>
>
> Hello,
>
> I'm trying the same and did manage to create a dynamic list
> of checkboxes from a database. But I still don't get it completely.
> Where is the ref="/hobby" defined? I looked in the UserBean and the
> userIdentity.xml, but found nothing. Can somebody give me a hint.
> I would like to change this to one of my own variable names.
>
> regards Lars
>
>
>
> ---------------------------------------------------------------------
> 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: <[EMAIL PROTECTED]>
> For additional commands, e-mail: <[EMAIL PROTECTED]>
>
---------------------------------------------------------------------
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: <[EMAIL PROTECTED]>
For additional commands, e-mail: <[EMAIL PROTECTED]>