0

Can't return ListBox current row all columns ?

asked 2012-12-27 05:56:55 +0800

leoyc gravatar image leoyc
163 3

updated 2012-12-27 05:58:07 +0800

Deall All,

When I Select ListBox, Can only return "InfoNo", I want return "Info" or "FathInfoNo" or "Order by"

<?xml version="1.0" encoding="UTF-8"?>

<zk>
<div align="center">
<div  height="20px"></div>
<window  >
<zscript>  
 import com.mysoft.estore.system.BaseInformation; 
 
 ArrayList list= new ArrayList();
 list =BaseInformation.list(arg.get("infotypeno"));

</zscript>
<textbox id="typeno"  visible="false"></textbox>
<listbox id="datalst"  width="600px" height="215px" fixedLayout="true" onSelect="select()">
<listhead >
<listheader label="Information Number"  width="140px" align="left"></listheader>
<listheader label="Information"   align="left"></listheader>
<listheader label="Father Number"  width="140px"  align="left"></listheader>
<listheader label="Order By"  width="100px"  align="left"></listheader>


</listhead>
 <listitem forEach="${list}" value="${each}">  
  <listcell label="${each.InfoNo}" style="border-left:1px solid gray;border-bottom: 1px solid gray"></listcell>
  <listcell label="${each.Info}" style="border-left:1px solid gray;border-bottom: 1px solid gray"></listcell>
  <listcell label="${each.FathInfoNo}" style="border-left:1px solid gray;border-bottom: 1px solid gray"></listcell>
  <listcell label="${each.OrderBy}" style="border-left:1px solid gray;border-bottom: 1px solid gray"></listcell>
 </listitem>
</listbox>


<zscript>


 void select()
 {
   //Can return InfoNo,But I want return Info or FathInfoNo or Order by

    alert(datalst.getSelectedItem().getLabel());
    
 }

</zscript>
</window>
</div>
</zk>

delete flag offensive retag edit

3 Replies

Sort by » oldest newest

answered 2012-12-28 02:49:45 +0800

leoyc gravatar image leoyc
163 3

I Can get Listbox current row all columns:


void select()
{

List children=datalst.selectedItem.children;

String InfoNo=((Listcell)children.get(0)).label;
String Info=((Listcell)children.get(1)).label;
String FathInfoNo=((Listcell)children.get(2)).label;
String OrderBy=((Listcell)children.get(3)).label;

}

link publish delete flag offensive edit

answered 2013-01-04 05:33:44 +0800

sjoshi gravatar image sjoshi flag of India
3493 1 8
http://zkframeworkhint.bl...

You can do like this

link publish delete flag offensive edit

answered 2013-03-22 01:54:14 +0800

leoyc gravatar image leoyc
163 3

updated 2013-03-22 02:30:44 +0800

void select() {

List children=datalst.selectedItem.children;

String InfoNo=((Listcell)children.get(0)).label; String Info=((Listcell)children.get(1)).label; String FathInfoNo=((Listcell)children.get(2)).label; String OrderBy=((Listcell)children.get(3)).label;

}

this code can only write in zkscript.when I write in java. "datalst.selectedItem.children" is wrong. waht's wrong?

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: 2012-12-27 05:56:55 +0800

Seen: 87 times

Last updated: Mar 22 '13

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