-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hi i have a macro Component for DualListBox which also contains the Checkbox..Something Like this...
<zk> <hlayout style="padding-left: 40px;padding-top:20px;padding-bottom:20px;" hflex="1" vflex="1"> <separator /> <listbox id="candidateLb" vflex="true" width="250px" multiple="true" model="${arg.candidateModel}"> <listhead> <listheader label="Default Column List"></listheader> </listhead> <template name="model" var="each"> <listitem> <listcell label="${each}" /> </listitem> </template> </listbox> <vbox spacing="10px"> <image style="cursor:pointer" id="chooseAllBtn" src="/images/rightrightarrow_g.png" /> <image style="cursor:pointer" id="chooseBtn" src="/images/rightarrow_g.png" /> <image style="cursor:pointer" id="removeBtn" src="/images/leftarrow_g.png" /> <image style="cursor:pointer" id="removeAllBtn" src="/images/leftleftarrow_g.png" /> </vbox> <listbox id="chosenLb" vflex="true" width="250px" model="${arg.chosenDataModel}" > <listhead> <listheader label="Selected Column List"></listheader> </listhead> <template name="model" var="each"> <listitem> <listcell label="${each.value}" > <separator orient="vertical" /> <b > <checkbox checked="${each.checked}" /></b> </listcell> </listitem> </template> </listbox> <vbox spacing="10px"> <image style="cursor:pointer" id="topBtn" src="/images/upuparrow_g.png" /> <image style="cursor:pointer" id="upBtn" src="/images/uparrow_g.png" /> <image style="cursor:pointer" id="downBtn" src="/images/downarrow_g.png" /> <image style="cursor:pointer" id="bottomBtn" src="/images/downdownarrow_g.png" /> </vbox> </hlayout> </zk>
My Problem is that when some one checked the CheckBox i want to call a method which will update some value...How can i do this.
thanks
Yes jimmyshiau,
Thanks but i did it.
thanks
Hi sjoshi,
CheckBox has no inplace attribute, you need to switch by yourself.
Hi JJ,
I am asking , something Like This. inplace="true" is available for CheckBox also.
thanks
YOur solution should work. Without understanding your business logic, I think You could attach the data as a value to a listitem, and then you can just set it directly
e.g.
listitem.setValue(data);
<listitem value="${each.data}" />
then in your method, you can just find the listitem for the checkbox, and get the data, then set it.
Not sure about your meaning of inline editing checkbox?
Hi Do you have any other Solution.
thanks
Hi
I found his Solution of above Posted Problem Please let me know if You have some other Solution.
public void onMyChecked(ForwardEvent evt) { Checkbox cb = (Checkbox)evt.getOrigin().getTarget(); Listcell lstCell = (Listcell)cb.getParent(); List<Data> list = getChosenDataList(); ListModelList<Data> chosenDataModel= new ListModelList<Data>(); for(Data data : list){ if(data.getValue().equals(lstCell.getLabel())){ data.setChecked(cb.isChecked()); chosenDataModel.add(data); }else{ chosenDataModel.add(data); } } setChosenDataModel(chosenDataModel); }
But i want to know if ZK Provide Inline Editing for Checkbox also as they are providing for textbox.
thanks
Hi Stephan and JJ ,
By using forward we can know that checkbox is checked or not but how can we know data for which it is being checked ?
Is there any solution like Inline row editing?
Ok let me see how can i will do it ..will let you know if i will achieve this .
thanks
Thanks JJ Stephen,
It work for me but one question let us suppose in Right hand side i have no item..
1-Now i added two checkbox and check one Chekbox and did not check second one in java how i wil know i have another checkbox which is not cheked by user. Because..
forward="onCheck=onMyChecked"
Will work when someone check the Chekbox,,,I want to know which is uncheked also ..In my case Unchcked means users want Descending order for that column and Cheked means user wants Ascending Order...
THanks
Asked: 2012-09-11 09:42:40 +0800
Seen: 919 times
Last updated: Oct 01 '12