0

auto set listbox selecteditem when use models

asked 2017-09-07 13:21:50 +0800

cedarview gravatar image cedarview
31
<listbox id="lbSnList" rows="10" fixedLayout="false" width="100%"  model="@{uploadSnVo}" >
  <listitem self="@{each=SN}"  style="@{SN.BACKGROUND}">
    <listcell>
      <listbox id = "lbProduct"  hflex="1" mold="select" model="@{SN.PRODUCTLIST}" selectedItem="@{SN.PRODUCT}" >
        <listitem  self="@{each=NV}" label="@{NV.name}"  value="@{NV.value}"/>
      </listbox> 
    </listcell>
  </listitem>
</listbox>

I want to set the dropdown list auto when it has product. how can i do it?

delete flag offensive retag edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2017-09-08 09:20:37 +0800

MDuchemin gravatar image MDuchemin
1286 1 3
ZK Team

Hi cedarview!

Looks like you are using the old version of databinding here :) If you are just starting out a new project, you may want to have a look to the current version in here ;) http://books.zkoss.org/zk-mvvm-book/8.0/data_binding/index.html

Based on your code, I'm not sure what you mean by "set the dropdown list auto when it has a product". Do you want the dropdown to open when the model is filled? Or do you need to update the displayed label on the dropdown? Can you describe the use case?

PS: I made a fiddle to test out the case more easily :) feel free to modify it to share your use case. http://zkfiddle.org/sample/v91cau/3-Another-new-ZK-fiddle

PPS: raise your rep. to let you post links and screenshots if needed

link publish delete flag offensive edit
Your answer
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
2 followers

RSS

Stats

Asked: 2017-09-07 13:21:50 +0800

Seen: 8 times

Last updated: Sep 08