-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hi,
I've just updated my ZK with the new freshly build (6.0.3) because a bug that I was interested to was fixed.
But....with this update some of my windows stopped working.
I'm using ZK Bind 6 in a lot of windows. As a viewModel of this forms I use a java class that uses SelectorComposer syntaxis to wire variables.
So an example of this code will be this:
@Wire private Toolbarbutton TBTEditarActividadTareaSeleccionada; @Init public void init(@ContextParam(ContextType.VIEW) Component view){ //enlaza los componentes Selectors.wireComponents(view, this, false); //enlaza eventos Selectors.wireEventListeners(view, this); Selectors.wireVariables(view, this, null); }
As you can see I needed to use the init function to wire the components.
But since I updated to the new freshly build Components are not linked to java variables, so all of my components are null and the program crashes.
What have had change?
Today I discovered the release-note in the freshly builds and found the Upgrade Notes I needed. As it says changing @Init annotation to @AfterCompose solved that problem.
But I found another one. I was using this code to add onSort event listener to some listheaders:
lh.addEventListener(Events.ON_SORT, new EventListener<Event>() { public void onEvent(Event arg0) throws Exception { Listheader lh; lh = (Listheader)arg0.getTarget(); //Obtenemos el número de columna por el que se ordenará (está guardado //como value de cada listheader) numColumnaOrdenacion = lh.getValue().toString(); tipoOrdenacion = "DL"; if(((SortEvent)arg0).isAscending()){ //Something happens }
But....since I update to the new freshly build I get this Exception:
GRAVE: >>java.lang.ClassCastException: org.zkoss.zk.ui.event.Event cannot be cast to org.zkoss.zk.ui.event.SortEvent >> at org.sts.generales.PlantillasZul.NuevoSeguimientoSelector$3.onEvent(NuevoSeguimientoSelector.java:505) >> at org.zkoss.zk.ui.AbstractComponent.onEvent(AbstractComponent.java:2734) >> at org.zkoss.zk.ui.AbstractComponent.service(AbstractComponent.java:2705) >> at org.zkoss.zk.ui.AbstractComponent.service(AbstractComponent.java:2646) >> at org.zkoss.zk.ui.impl.EventProcessor.process(EventProcessor.java:136) >> at org.zkoss.zk.ui.impl.EventProcessingThreadImpl.process0(EventProcessingThreadImpl.java:534) >> at org.zkoss.zk.ui.impl.EventProcessingThreadImpl.run(EventProcessingThreadImpl.java:461)
How can I solve it????
I tried this too:
@Listen ("onSort = #LBSeguimiento > listhead > listheader") public void ordenar(Event se){ System.out.println("Ordena!!"); Listheader lh; lh = (Listheader)se.getTarget(); //Obtenemos el número de columna por el que se ordenará (está guardado //como value de cada listheader) numColumnaOrdenacion = lh.getValue().toString(); tipoOrdenacion = "DL"; if(((SortEvent)se).isAscending()){ //Something happens }
Unsuccessful....
@Neus
I have the same problem, do you try with GenericForwardComposer?
In my project works but I can't use this composer i need selector.
I'll keep your post.
Regards,
Mark.
Asked: 2012-10-24 09:30:23 +0800
Seen: 133 times
Last updated: Nov 12 '12