0

Wrong icon on the group button in a listbox with listgroups

asked 2009-06-24 12:42:24 +0800

Froehlich gravatar image Froehlich
42

I have a listbox with groups where the model is created programmatically with this method:

private SimpleGroupsModel getModel(List<Thervariante> elements, String rollentyp, String rolle) {
		Thervariante[][] data = new Thervariante[elements.size()][1];
		String[] heads = new String[elements.size()];
		
		//Some code ...
		
		SimpleGroupsModel result = new SimpleGroupsModel(data, heads);
		return result;
	}

There is also a renderer used for this listbox:

public void render(Listitem item, Object data) throws Exception {
		
		Listcell lcMedikamente = new Listcell();
		Listcell lcZuweisungen = new Listcell();
		Listcell lcLeistungen = new Listcell();
		Listcell lcDokumente = new Listcell();
		Listcell lcEdit = new Listcell();

		//Some code ...
		
		item.getChildren().add(lcZuweisungen);
		item.getChildren().add(lcLeistungen);
		item.getChildren().add(lcDokumente);
		item.getChildren().add(lcMedikamente);
		item.getChildren().add(lcEdit);
		if (item.getPreviousSibling() instanceof Listhead) {
			item.getListgroup().setOpen(true);
		} else {
			item.getListgroup().setOpen(false);
		}
	}

When the group is opened, the icon on the button for opening is closed and reversed. So the icon is showing the wrong state of the group. The first group is set to be opened and all the others are closed. Is it a bug or am I doing something wrong?

delete flag offensive retag edit

3 Replies

Sort by » oldest newest

answered 2009-06-30 03:03:31 +0800

kindalu gravatar image kindalu
255

I wrote a short code for testing the issue

<zk>
	<window id="win" title="listbox" border="normal"/>
	<zscript>
		Listbox listbox = new Listbox();
		Listgroup lg1 = new Listgroup();
		Listitem lm1 = new Listitem();
		Listgroup lg2 = new Listgroup();
		Listitem lm2 = new Listitem();
		
		public addListCell(Listitem lm){
			for(int i=4; i!=0;i--){
				lm.appendChild(new Listcell(""+i));
			}
		}
		addListCell(lg1);
		listbox.appendChild(lg1);
		addListCell(lm1);
		listbox.appendChild(lm1);
		addListCell(lg2);
		listbox.appendChild(lg2);
		addListCell(lm2);
		listbox.appendChild(lm2);
		win.appendChild(listbox);
		
		lg1.setOpen(true);
		lg2.setOpen(false);
	</zscript>
</zk>

I cannot make the problem reproducible ... could you provide further information
like runnable example and your version of zk & browser

I used zk 3.6.2 & firefox + ie7 for testing/

link publish delete flag offensive edit

answered 2009-07-31 07:53:20 +0800

Froehlich gravatar image Froehlich
42

This problem occurs only when using an own model and an own renderer, so the whole logic is build up in the Controller (Java Code). In the zul-file you can find only the declaration of the listbox:

<listbox id="thervarianteListbox" width="994px" height="329px" multiple="false" oddRowSclass="myodd">
			<listhead sizable="true" width="994px">
				<listheader sclass="listeAlignment" label="Zuweisung" image="images/therapie_zuweisungenIcon.png" sort="false" width="22%" />
				<listheader sclass="listeAlignment" label="Eigenleistung" image="images/therapie_leistungenIcon.png" sort="false" width="22%" />
				<listheader sclass="listeAlignment" label="Dokumentation" image="images/therapie_dokumenteIcon.png" sort="false" width="22%" />
				<listheader sclass="listeAlignment" label="Medikamente" image="images/therapie_medikamenteIcon.png" sort="false" width="22%" />
				<listheader sclass="listeAlignment" label="Häufigkeit" sort="false" width="12%" />
			</listhead>
		</listbox>

Therefore it is hard to provide an runnable example.

link publish delete flag offensive edit

answered 2009-08-05 01:11:39 +0800

henrichen gravatar image henrichen
3869 2
ZK Team

Please post to ZK Bugs and provide the example as attached files. Let's check from there. Thanks.

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: 2009-06-24 12:42:24 +0800

Seen: 240 times

Last updated: Aug 05 '09

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