# Binding problem with two grid in the same modal windows

VincenzoRuocco
1

I have this problem, in the same window i Have two grid form binded on two different object of the same VM class. When i try to update some value i have this error:

GRAVE: >>org.zkoss.zk.ui.UiException: Property 'seat' not found on type vis.eghos.model.bean.apt.FlightOperatorViewBean at [file:/E:/eghosZKWorkspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/eGHos2.0/flt/flightSchedule/ttFlightModalWin.zul, line:556]
>>  at org.zkoss.zel.BeanELResolver$BeanProperties.get(BeanELResolver.java:298) >> at org.zkoss.zel.BeanELResolver$BeanProperties.access$400(BeanELResolver.java:249) >> at org.zkoss.zel.BeanELResolver.property(BeanELResolver.java:423) >> at org.zkoss.zel.BeanELResolver.setValue(BeanELResolver.java:135) >>........  The problem is that the attribute Seat is not binded on type FlightOperatorViewBean that is another object in the form. I believe that is a bug of framework, the BeanResolver (maybe) not match the correct object. I'm using the 6.5.4 but changing the version to the last update i have the same problem. Someone has some idea? delete retag edit ## Comments Can you post the zul, the viewmodel and the pojo (partially but with getter and setter from seat) where seat is in? ( 2014-09-10 12:33:52 +0800 )edit ## 7 Answers Sort by » oldest newest most voted answered 2014-09-11 09:14:11 +0800 pasqualeleone 81 2 Ok. This shared folder contains all the files: link text I remember you that this is a modal windows opened in another VM and then all the objects that you can see in the zul and in the modal VM works perfectly in other side of the application. Thanks answered 2014-09-11 16:39:04 +0800 chillworld 5322 4 9 https://github.com/chillw... Oke here is your problem : <intbox constraint="no negative" id="azxc32" sclass="@load(empty vmsgs 'seatEmpty'] ? '' : 'invalid')" value="@bind(ttFlightvm.ttCommonFlightBean.seat)" readonly="@load(ttFlightvm.viewOperation)" />  You ask from viewmodel getTtCommonFlightBean.getSeat(); If I check getTtCommonFlightBean() I see this method : public FlightScheduleBean getTtCommonFlightBean() { return ttCommonFlightBean; }  If you check the FlightScheduleBean.java it has no getSeat() method in the class. Where do you have the getSeat(); method? => In TtFlightBean. So I think you entered a wrong value(getter). Possible getters are one of these 2 : public TtFlightBean getTtArrivalFlightBean() { return ttArrivalFlightBean; } public TtFlightBean getTtDepartureFlightBean() { return ttDepartureFlightBean; }  Greetz chill. answered 2014-09-12 08:28:40 +0800 pasqualeleone 81 2 No. The object FlightScheduleBean (added at the previous link) contains getSeat, but the problem is not so simple. If you look the error trace you can see : org.zkoss.zel.PropertyNotFoundException: Property 'seat' not found on type vis.eghos.model.bean.apt.FlightOperatorViewBean The type where the framework search the object is completely wrong. TtCommonFlightBean is a class FlightScheduleBean while it search the attribute on a type FlightOperatorViewBean. If i repeat the operation i have that the error trace report another one type (wrong) different by the last one.... This is an error of zk framework. Someone knows a workaround? ## Comments can you provide a google link (dropbox is blocked at work so I have time to see that in the evening) ( 2014-09-12 09:44:49 +0800 )edit I'm looked at it and your correct, What we can do is try to reproduce this in zk fiddle. (or try to remove the label with value seat, it strange he points at that label cause line 556 comes 1 line under that. line 556 is ending of vbox with me)) ( 2014-09-12 21:14:53 +0800 )edit answered 2014-09-15 10:59:37 +0800 VincenzoRuocco 1 I think this is a bug, something in the beanResolver doesn't work as should do. I founded the same problem in other point of the project when in the same windows there are many form. ## Comments it would be helpful to post a runnable example or at least reduce the zul file to what is needed to reproduce the issue. 1000 lines are not very helpful. I usually start commenting out parts of my zul file to see if they are related to the issue. In the end you'll have a more handy file. ( 2014-09-16 07:17:59 +0800 )edit also enabling the MVVM debugging might give you a clue which binding causes the issue (http://books.zkoss.org/wiki/ZKDeveloper'sReference/MVVM/Configuration#PrintZKBindDebuggingInformation) and what ZK is trying to resolve there. ( 2014-09-16 07:20:09 +0800 )edit I can't reduce the lines of the zul file because this problem happens when the zul file is very large, in a little form all work correctly. Additionally it's no possible post a runnable example because the project is very big and complex and there are many library and object to take in. ( 2014-09-16 08:17:48 +0800 )edit I would like to know if someone has faced this problem in this class >> org.zkoss.zel.BeanELResolver$BeanProperties.get(BeanELResolver.java:298) when all binding are correct. In the meanwhile i try to use the debugging for understand what object really match my bind. Thank you

( 2014-09-16 08:21:23 +0800 )edit

when all bindings we look at are correct, then maybe we are looking at the wrong place... that's why I said, reduce the example maybe it even occurs when you remove the suspected line.

( 2014-09-16 08:34:22 +0800 )edit

VincenzoRuocco
1

here the debug trace:

======================================= [2888]ONEVENT
[2888] *[event] [onChange] <intbox uuid="tZJQmc0" id="azxc32"/> [2888] + SAVE
BINDING
[2888] *[save:prop-save][event = onChange]value > ttFlightvm.ttCommonFlightBean.seat 233233 <intbox uuid="tZJQmc0" id="azxc32"/> set 16, 2014 9:17:11 AM org.zkoss.bind.impl.BinderImpl\$CommandEventListener onEvent:1329

The object at this level look like correct, in the java class it's wrong.

( 2014-09-16 10:21:11 +0800 )edit

normally there is someone of zk looking at your problem, cause in mine first sight your zul is correct.

( 2014-09-16 11:37:26 +0800 )edit

VincenzoRuocco
1

I founded a solution , a workaround. If i declare in the associated VM class an integer seat and overlap it in the setter method to the complex object ttFlightBeanCommon.seat with the same bind notation the form works correctly. I know that's not a clean solution but i can't resolve a problem of binding at zk framework level. Thanks a lot for all the answers.

good that you have a workaround, I hope that ZK figure this one out.

( 2014-09-16 14:37:43 +0800 )edit

khazi
1
http://www.finansowe-fakt...

[hide preview]