0

Listbox getValue with DataBind

asked 2007-07-10 15:00:32 +0800

admin gravatar image admin
18691 1 10 130
ZK Team


Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=4405972

By: rmaugusto

Im using zk 2.4.1 and my zul is:

<a:bind model="classificacoesCliente"
selectedItem="clienteBean.TClassificacaoCliente" /> <listbox id="cmb_classificacao" mold="select" rows="1" >
<a:bind _var="objClassificacao"/>
<listitem label="@{objClassificacao.nome}" value="@{objClassificacao}"
/>
</listbox>

The itens are shown correctly, but in java when I try to read them:

for (int i=0;i<lst.getChildren().size();i++) {
Listitem lstItem = (Listitem)lst.getChildren().get(i);
System.out.println( lstItem.getLabel() + " - " + lstItem.getValue() ); }

The Label is empty and the value is null.

I tried:
<a:bind _var="objClassificacao" label="objClassificacao.nome"
value="objClassificacao" />
<listitem />



delete flag offensive retag edit

6 Replies

Sort by ยป oldest newest

answered 2007-07-11 02:19:55 +0800

admin gravatar image admin
18691 1 10 130
ZK Team


Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=4406970

By: jebberwocky

Dear Rick

In which method u use the for-loop?

Thank you

/jeff

link publish delete flag offensive edit

answered 2007-07-11 12:58:57 +0800

admin gravatar image admin
18691 1 10 130
ZK Team


Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=4407642

By: rmaugusto

Right after windowBinder.loadAll() in the onCreate()

link publish delete flag offensive edit

answered 2007-07-13 14:02:53 +0800

admin gravatar image admin
18691 1 10 130
ZK Team


Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=4411513

By: rmaugusto

Did you got this error ?

link publish delete flag offensive edit

answered 2007-07-16 05:09:27 +0800

admin gravatar image admin
18691 1 10 130
ZK Team


Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=4414280

By: henrichen

The DataBinder helps you setup the "model" property of the cmb_classificacao Listbox and that is all.

The "label" and "value" is not loaded until the original "live data" mechanism start to work. That is, the data is not loaded into Listitem yet so you get null value and empty label.

It can be verified easily. Prepare a <button> and put your "for loop code" in onClick event listener and you will see the differences.

/henri

link publish delete flag offensive edit

answered 2011-06-13 03:41:23 +0800

fati gravatar image fati
108 1

hi henrichen,

i have the same probleme so what can we do in that case??

link publish delete flag offensive edit

answered 2011-06-13 05:44:04 +0800

terrytornado gravatar image terrytornado flag of Germany
9393 3 7 16
http://www.oxitec.de/

@fati, this is an 4 years old thread. please open a new one.

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: 2007-07-10 15:00:32 +0800

Seen: 383 times

Last updated: Jun 13 '11

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