0

Populating a Listbox's Listhead via Spring

asked 2014-03-13 01:58:16 +0800

Plank gravatar image Plank
1

Hi,

ZK n00b here. I've been thrown in the deep end and tasked with making some changes to an application written with version 6.5.2.

I've created a Panel as a .zul file which displays on the screen. Display of data and functionality is controlled by a Java class which extends SelectorComposer<panel>.

The controller is defined as a Spring bean and referenced in the .zul file like this:

<panel id="myPanel" apply="${nameOfBean}">

Is there any way I can access fields of the bean in the .zul file? I've created a Listhead object in the controller (I have a large number of headings which I don't want to manually type into the .zul file) but can't find an appropriate method to assign it to the Listbox in the controller. What I'd like to do is something like this:

myListbox.setListhead(myListhead);

Thanks,

delete flag offensive retag edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2014-08-09 16:56:45 +0800

Darksu gravatar image Darksu
1991 1 4

Hello Plank,

In order to avoid manually typing into the zul file the headings you have to implement it in your controller.

In the controller, in your initiallization method, you will create a list of headers (you can retrieve the list from a string, database, jason, etc).

Then iterate the list, and for each item create an listHeader instance and set it's label.

Also add each listHeader to the listHead object;

Finally add the listHead to the listbox as you have pointed out above.

Best Regards,

Darksu

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
4 followers

RSS

Stats

Asked: 2014-03-13 01:58:16 +0800

Seen: 15 times

Last updated: Aug 09 '14

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