ZK - Open Source Ajax Java FrameworkZK - Open Source Ajax Java Framework

Make registerLoadEvents exception more meaningful

dagarwal82
25 Sep 2011 04:34:04 GMT
25 Sep 2011 04:34:04 GMT

Binding.java

LoadAfterEventListener listener = (LoadAfterEventListener)
						target.getAttribute("zk.LoadAfterEventListener."+evtname);

Here, if target is null then we get following :
java.lang.NullPointerException
	org.zkoss.zkplus.databind.Binding.registerLoadEvents(Binding.java:548)
	org.zkoss.zkplus.databind.DataBinder.registerLoadEvents(DataBinder.java:881)
	org.zkoss.zkplus.databind.DataBinder.init(DataBinder.java:685)
	org.zkoss.zkplus.databind.DataBinder.loadAll(DataBinder.java:572)
	org.zkoss.zkplus.databind.AnnotateDataBinderInit.doAfterCompose(AnnotateDataBinderInit.java:189)
	org.zkoss.zk.ui.impl.RealInits.doAfterCompose(Initiators.java:82)
	org.zkoss.zk.ui.impl.UiEngineImpl.execNewPage0(UiEngineImpl.java:390)
	org.zkoss.zk.ui.impl.UiEngineImpl.execNewPage(UiEngineImpl.java:305)
	org.zkoss.zk.ui.http.DHtmlLayoutServlet.process(DHtmlLayoutServlet.java:225)
	org.zkoss.zk.ui.http.DHtmlLayoutServlet.doGet(DHtmlLayoutServlet.java:146)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:722)

This output doesn't say which binding has problem. It would be better if you pass the 'comp' and 'expr' to the exception output.

vincentjian
3 Oct 2011 05:19:04 GMT
3 Oct 2011 05:19:04 GMT

Hi,

Would you post a feature request here.

vincentjian
6 Feb 2012 07:42:00 GMT
6 Feb 2012 07:42:00 GMT

Hi,

Would you post the sample code that will generate the exception in the following link: http://tracker.zkoss.org/browse/ZK-466?

Matze2
7 Feb 2012 13:41:18 GMT
7 Feb 2012 13:41:18 GMT

As far as I remember, you can achieve that by specifiying an unknown component id in "load-after".

jimmyshiau
8 Feb 2012 01:46:49 GMT
8 Feb 2012 01:46:49 GMT

Hi Matze2,
What is unknown component id?
Can you provide a sample code?

dagarwal82
8 Feb 2012 05:11:02 GMT
8 Feb 2012 05:11:02 GMT

try load-after=okbutton.onClick in any of the model where okbutton does not exist in the zul

Matze2
8 Feb 2012 07:16:38 GMT
8 Feb 2012 07:16:38 GMT

Exactly. This is a typical exception when you have typos in your ZUL file.
I'm currenty migrating to ZK6/MVVM concept. There I do not need component ids at all.