[ 
https://issues.apache.org/jira/browse/WICKET-2565?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Igor Vaynberg resolved WICKET-2565.
-----------------------------------

    Resolution: Invalid
      Assignee: Igor Vaynberg

the problem has nothing to do with the CPM, you are not using proper type. 
objects in ddc must be of the same type but in your code the model object is 
string while the choices object is iddescrbean.

you are using generics, so declare a type on the ddc and see what happens

eg dropdownchoice<string> or dropdownchoice<iddescrbean>



> Combination CompoundPropertyModel and ChoiceRenderer on DropDownChoice gives 
> problems
> -------------------------------------------------------------------------------------
>
>                 Key: WICKET-2565
>                 URL: https://issues.apache.org/jira/browse/WICKET-2565
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.4.3
>            Reporter: Ann Baert
>            Assignee: Igor Vaynberg
>         Attachments: DdcPage.html, DdcPage.java
>
>
> I have a Form with a CompoundPropertyModel (FormBean). On the Form I have a 
> DropDownChoice
> with a List of IdDescrBean and a ChoiceRenderer to use the attribute "descr" 
> as displayValue
> and "id" as idValue. But I get the following error:
> StackTrace:
> ERROR - No get method defined for class: class java.lang.String expression: id
> org.apache.wicket.WicketRuntimeException: No get method defined for class: 
> class java.lang.String expression: id
>         at 
> org.apache.wicket.util.lang.PropertyResolver.getGetAndSetter(PropertyResolver.java:445)
>         at 
> org.apache.wicket.util.lang.PropertyResolver.getObjectAndGetSetter(PropertyResolver.java:287)
>         at 
> org.apache.wicket.util.lang.PropertyResolver.getValue(PropertyResolver.java:90)
>         at 
> org.apache.wicket.markup.html.form.ChoiceRenderer.getIdValue(ChoiceRenderer.java:145)
>         at 
> org.apache.wicket.markup.html.form.AbstractSingleSelectChoice.getModelValue(AbstractSingleSelectChoice.java:166)
>         at 
> org.apache.wicket.markup.html.form.FormComponent.getValue(FormComponent.java:904)
>         at 
> org.apache.wicket.markup.html.form.AbstractChoice.onComponentTagBody(AbstractChoice.java:352)
>         at org.apache.wicket.Component.renderComponent(Component.java:2617)
>         at 
> org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1512)
>         at org.apache.wicket.Component.render(Component.java:2448)
>         at 
> org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1414)
>         at 
> org.apache.wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:1577)
>         at 
> org.apache.wicket.MarkupContainer.onComponentTagBody(MarkupContainer.java:1501)
>         at 
> org.apache.wicket.markup.html.form.Form.onComponentTagBody(Form.java:1926)
>         at org.apache.wicket.Component.renderComponent(Component.java:2617)
>         at 
> org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1512)
>         at org.apache.wicket.markup.html.form.Form.onRender(Form.java:1997)
>         at org.apache.wicket.Component.render(Component.java:2448)
>         at 
> org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1414)
>         at 
> org.apache.wicket.MarkupContainer.renderAll(MarkupContainer.java:1528)
>         at org.apache.wicket.Page.onRender(Page.java:1545)
>         at org.apache.wicket.Component.render(Component.java:2448)
>         at org.apache.wicket.Page.renderPage(Page.java:914)
>         at 
> org.apache.wicket.protocol.http.WebRequestCycle.redirectTo(WebRequestCycle.java:166)
>         at 
> org.apache.wicket.request.target.component.PageRequestTarget.respond(PageRequestTarget.java:58)
>         at 
> org.apache.wicket.request.AbstractRequestCycleProcessor.respond(AbstractRequestCycleProcessor.java:105)
>         at 
> org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1258)
>         at org.apache.wicket.RequestCycle.step(RequestCycle.java:1329)
>         at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1428)
>         at org.apache.wicket.RequestCycle.request(RequestCycle.java:545)
>         at 
> org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:468)
>         at 
> org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:301)
>         at 
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
>         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:128)
>         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:293)
>         at 
> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
>         at 
> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
>         at 
> org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
>         at java.lang.Thread.run(Thread.java:619)
> I also added an example.
> The getIdValue() from the ChoiceRenderer gets a String the first time, 
> instead of the bean IdDescrBean, that 's why he gives that error, but I don't 
> know why he get that String and how to solve it.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to