0

Errors when updating to the new freshly build

asked 2012-10-24 09:30:23 +0800

Neus gravatar image Neus
1415 14

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?

delete flag offensive retag edit

6 Replies

Sort by » oldest newest

answered 2012-10-24 09:43:17 +0800

Neus gravatar image Neus
1415 14

updated 2012-10-24 11:22:04 +0800

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????

link publish delete flag offensive edit

answered 2012-10-24 11:44:36 +0800

Neus gravatar image Neus
1415 14

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....

link publish delete flag offensive edit

answered 2012-10-25 06:50:38 +0800

Neus gravatar image Neus
1415 14

Any idea?
It is important. I need to solve it.

link publish delete flag offensive edit

answered 2012-11-06 08:41:50 +0800

Neus gravatar image Neus
1415 14

I can't listen to the onSort event yet...
Any idea?

link publish delete flag offensive edit

answered 2012-11-12 08:00:29 +0800

Marky gravatar image Marky flag of Spain
284 7
http://www.no/havent-doma...

@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.

link publish delete flag offensive edit

answered 2012-11-12 10:30:19 +0800

Neus gravatar image Neus
1415 14

No, I'm using SelectorComposer and I dind't find any solution yet.
Anyone can help us?

Thank you

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: 2012-10-24 09:30:23 +0800

Seen: 133 times

Last updated: Nov 12 '12

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