bandbox click

asked 2013-03-10 22:26:27 +0800

javiut gravatar image javiut flag of Venezuela, Bolivarian Republic of
90 1 5

Hi guys i am very new to ZK framework i have 3 question i hope somebody can help me.

1). i have a Bandbox component create in Java Code my question is how can i react to a click in the Bandbox image without collapse the bandBox all i wanna do is call to another component on click event is this possible?

2). i have a Listbox create also in java code all i wanna to do is

BindingListModelList model = new BindingListModelList(myCollection,false);

the listBox have only have one listItem all i wanna to do is to show a property (only one) of the collection but the previous code is showing the toString() method of the class itself in ZUL is easy you do. listitem self="@{each=venice}" listcell label='@{venice.c16}' i have try this so far.

listItem = new Listitem(clazz.getProperty());           

but in this case the element of the listBox model is just a string but i need the class graph on selection how can i accomplish both have whole class in the model but show the property in the listItem thanks a lot a god bless. 3). i have a ZUL and declare a Student class in the following way inside ZScript

Window parentWin = (Window)self.getParent().getParent().getFellow("win");
Student student = (Student)parentWin.getAttribute("bestStudent");

my question is i have in the javaCode the Window who is the parent how can i get the student class in the java code i have try window.getAttribute window.getFellow nothing works thank a lot.

delete flag offensive retag edit


Thanks a lot by the reply sjoshi yes in fact is a MVC project because is a legacy system can you please supply some source code in java not in ZUL how can i use ItemRender class with ListCell i'm very new to ZK framework thanks a lot i'm using ZK 5.2.3 and i cant use org.zkoss.zul.ItemRenderer

javiut ( 2013-03-11 11:37:00 +0800 )edit

See My Edited Answer

sjoshi ( 2013-03-11 16:39:13 +0800 )edit

sjoshi thanks a lot i have solved this problem can you please take a look to my last post.http://forum.zkoss.org/question/85694/bandox-click-image-custom-action-add-listitem-into-listbox/

javiut ( 2013-03-11 17:32:52 +0800 )edit

If you resolved the issue please accept any answer and close the question

sjoshi ( 2013-03-12 04:44:04 +0800 )edit

azli can you answer can be accomplish extending bandbox or Bandpopup??

javiut ( 2013-03-12 15:37:31 +0800 )edit

2 Answers

Sort by ยป oldest newest most voted

answered 2013-03-11 09:26:23 +0800

sjoshi gravatar image sjoshi flag of India
3493 1 8

updated 2013-03-11 16:38:57 +0800

I am not confirm here what Architecture you are using here MVVM OR MVC from my Guess you are using MVC.For your question number second as you did not share the code so from my understanding you can use below code to show data in zul

<listbox multiple="true" checkmark="true" model="@load(vm.model)"  itemRenderer="@load(vm.myitemRenderer) selectedItems="@bind(vm.selectedList)" span='true'>
 //Your Header part here only


As you can see i am using itemerendered here to create listcell i m supposing you did same thing in Java code.

For you third question i will suggest you to do this with MVVM Model it willl very easy rather than enabling ZScript in Project. A Demo code For getitemrendered() added here ..Zk Itemrendered Example

link publish delete flag offensive edit

answered 2013-03-11 15:14:11 +0800

azli gravatar image azli
24 3

question 1) u can do like this. in your zul page, put id to the bandbox and components inside it. like below :

                                            <grid fixedLayout="true"
                                                style="border:0px" width="100%">
                                                        width="150px" />
                                                        width="250px" />
                                                        width="100px" />
                                                            value="cust no" />
                                                            id="tb_Orders_SearchCustNo" width="99%" />
                                                            label="search" />

then in java file :

    public void onClick$button_bbox_CustomerSearch_Search(Event event) {
    // do whatever

doing this wont collapse your bandbox.

hopefully this answers question. sorry im bad with understanding question :D

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

1 follower



Asked: 2013-03-10 22:26:27 +0800

Seen: 130 times

Last updated: Mar 11 '13

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