0

Combobox model and customized comboitem value/label

asked 2011-02-03 08:19:41 +0800

Steva77 gravatar image Steva77 flag of Italy
1014 3
http://www.research.softe...

Hy everybody,
I got a simple question:

DataBinding works fine with combobox, I have a tld returning a ListModelList like this:

<combobox id="role" width="225px" constraint="no empty" model="${glims:getList('role')}"/>

and the combobox is generated correctly.

What if I need to customize the value and label of the comboitem which are generated this way?
Something like:

<combobox id="role" width="225px" constraint="no empty" model="${glims:getList('role')}"/>
    <comboitem label="LABEL CUSTOMIZED ${each}" value="CUSTOMIZED ${each}"/>
</combobox>		

I found an old talk but comboitem does not have self anymore...

Thanks,
Stefano

delete flag offensive retag edit

4 Replies

Sort by ยป oldest newest

answered 2011-02-08 03:15:13 +0800

Steva77 gravatar image Steva77 flag of Italy
1014 3
http://www.research.softe...

updated 2011-02-08 04:14:09 +0800

Found a stupid error so far, wrong notation, it should be at least:

<combobox id="role" width="225px" constraint="no empty" model="${glims:getList('role')}"/>
    <comboitem self="@{each}" label="LABEL CUSTOMIZED @{each}" value="VALUE CUSTOMIZED @{each}"/>
</combobox>

but nevertheless it does not work properly... ${glims:getList('role')} returns simply a list of Strings BTW
I think I am making a confusion between iterations and databinding... :(

link publish delete flag offensive edit

answered 2011-02-08 06:37:26 +0800

Steva77 gravatar image Steva77 flag of Italy
1014 3
http://www.research.softe...

updated 2011-02-08 06:37:43 +0800

I did not solve the issue but changed approach... just for those who will find this unanswered post ;)

<combobox id="reference" width="225px" constraint="no empty">
	<zk forEach="${glims:getList('reference')}">    
		<comboitem label="${each}LABEL" value="${each}VALUE" />       
	</zk>   					
</combobox>

I definitively confused iterations and data binding (approach & notations)!

link publish delete flag offensive edit

answered 2011-02-08 09:01:16 +0800

Matze2 gravatar image Matze2
773 7

Hi,

just to confirm, that "self" works with data-binding:

<combobox id="combobox1" model="@{win$composer.objectList, access='load'}" constraint="no empty,strict">
	<comboitem self="@{each=entry}" value="@{entry}" label="@{entry.label}" />
</combobox>

link publish delete flag offensive edit

answered 2011-02-09 06:31:47 +0800

Steva77 gravatar image Steva77 flag of Italy
1014 3
http://www.research.softe...

Yes, I definitively mixed up iteration & data binding... thanks for the feedback!

link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2011-02-03 08:19:41 +0800

Seen: 872 times

Last updated: Feb 09 '11

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More