Hi good folks,
I've encountered a problem with a databound dynamic form that has me, quite frankly, stumped.
For the sake of simplicity; let's say I have basic Order and User object. The Order object has a createdBy property which of type User, like so:
User has a userId of type String; like so:
In my Order datasource mapping file, I render the userId through an xPath expression;i.e.:
This works fine when I for instance display an order in a ListGrid. The user id of the user that created the order is rendered properly; so I know the datasource mapping is working.
However, when I try to now SAVE an instance of Order back to the server-side DAO object; I get the following order:
Any ideas? I can't figure out for the life of me why this is failing.
I've encountered a problem with a databound dynamic form that has me, quite frankly, stumped.
For the sake of simplicity; let's say I have basic Order and User object. The Order object has a createdBy property which of type User, like so:
Code:
public class Order { private User createdBy; public void setCreatedBy(User user) { this.createdBy = user; } public User getCreatedBy() { return this.createdBy; } }
Code:
public class User { private String userId public void setUserId(String id) { this userId=id; } public String getUserId() { return userId; } }
Code:
<field name="createdById" type="text" title="Created By" valueXPath="createdBy/userId" required="true"/>
This works fine when I for instance display an order in a ListGrid. The user id of the user that created the order is rendered properly; so I know the datasource mapping is working.
However, when I try to now SAVE an instance of Order back to the server-side DAO object; I get the following order:
Code:
21:27:13,082 WARN Reflection:364 - Failed to convert Map arg to bean of type: com.acmecorp.shared.mode l.Order - because bean population via DataTools.setProperties() threw the following Exception: org.apache.commons.jxp ath.JXPathNotFoundException: No pointer for xpath: createdBy/userId 21:27:13,083 WARN Reflection:364 - Exception occurred attempting to map arguments: org.apache.commons.jxpath.JXPathNotF oundException: No pointer for xpath: createdBy/userId in org.apache.commons.jxpath.ri.JXPathContextReferenceImpl.getPoin ter(JXPathContextReferenceImpl.java:468) 21:27:13,083 WARN RequestContext:369 - dsRequest.execute() failed: java.lang.Exception: Unable to assign a required or optional argument to slot #2 taking type: com.acmecorp.shared.model.Order of method: public final com.isomorphic.datasource.DSResponse $Proxy12.add(com.isomorphic.datasource.DSRequest,com.acmecorp.shared.model.Order) throws java.lang.Exception No remaining optional arguments match this type and all required arguments passed by the client have already been assign ed. at com.isomorphic.base.Reflection.adaptArgsAndInvoke(Reflection.java:869) at com.isomorphic.datasource.DataSourceDMI.execute(DataSourceDMI.java:483) at com.isomorphic.datasource.DataSourceDMI.execute(DataSourceDMI.java:63) at com.isomorphic.datasource.DSRequest.execute(DSRequest.java:1247) at com.isomorphic.servlet.IDACall.handleDSRequest(IDACall.java:155) at com.isomorphic.servlet.IDACall.processRequest(IDACall.java:106) at com.isomorphic.servlet.IDACall.doPost(IDACall.java:54) at javax.servlet.http.HttpServlet.service(HttpServlet.java:637) at com.isomorphic.servlet.BaseServlet.service(BaseServlet.java:152) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489) at java.lang.Thread.run(Thread.java:619)
Comment