Hi Dan!
Thanks a lot for all your comments! Took some time to digest them all. ;-)
I didn't know that choices had to be persistent. I ended up deleting the
unwanted entities as you also suggested.
That the choicesXXX methods are called so many times could be a problem.
In my case I use it to find alternatives of shortest paths from one location to
another.
In a 'real world' application this search will not be idempotent. Service
providers are coming
and going, the list of offers is dependent on date and time etc. etc. So this
search must
only be initiated be a user request.
Originally I wanted to display a table with alle the TransportPath alternatives
with a check box in each row.
But I couldn't find out where I had to put the @Bulk annotation to make it
happen. :-(
So I ended up with a choicesXXX drop down box.
Thanks again
Christian
________________________________________
From: Dan Haywood [[email protected]]
Sent: Wednesday, February 13, 2013 10:59 AM
To: [email protected]
Subject: Re: choices0XXX
Hi Christian,
I guess this follows on from your other thread. As you've found out, the
Wicket viewer assumes that the entities returned by the choices method are
persistent.
If you can't work around this, then please raise a JIRA ticket, ideally
providing an example and stack trace.
Thx
Dan
On 12 February 2013 12:26, Christian Steinebach <
[email protected]> wrote:
> Hi everybody,
>
> having a class TransportDemand with an action
>
> public TransportDemand selectPath(
> @Named("Path") TransportPath p){
> container.persist(path)
> setPath(path);
> return this;
> }
>
> public List<TransportPath>choices0SelectPath(){
> return a list of some non persisted TransportPaths;
> }
>
> slelectPath() is never called and the exception below is thrown.
>
> Last cause: Could not parse OID
> '[com.marintek.tpm.dom.demand.TransportPath/!com.marintek.tpm.dom.demand.TransportPath:b0d4e77e-2816-4256-adb8-0f23cf67b163{inUse=F,
> routes=(com.marintek.tpm.dom.transport.ServedRoute/com.marintek.tpm.dom.transport.ServedRoute:L_2,com.marintek.tpm.dom.transport.ServedRoute/com.marintek.tpm.dom.transport.ServedRoute:L_9,com.marintek.tpm.dom.transport.ServedRoute/com.marintek.tpm.dom.transport.ServedRoute:L_11,com.marintek.tpm.dom.transport.ServedRoute/com.marintek.tpm.dom.transport.ServedRoute:L_12,com.marintek.tpm.dom.transport.ServedRoute/com.marintek.tpm.dom.transport.ServedRoute:L_13)}]';
> should match pattern:
> ^((([!])?([^:~$\^@#]+):([^:~$\^@#]+))((~[^:~$\^@#]+:[^:~$\^@#]+)*))([$][^:~$\^@#]+)?([\^](\d+):([^:~$\^@#]+)?:(\d+)?)?$
> WicketMessage: Method onFormSubmitted of interface
> org.apache.wicket.markup.html.form.IFormSubmitListener targeted at
> [ActionParameterForm [Component id = inputForm]] on component
> [ActionParameterForm [Component id = inputForm]] threw an exception
>
> The exception is not thrown in selectTransportPath() but somewhere inside
> isis.
>
> If, however, choices0SelectPath() returns a list of PERSISTED
> TransportPaths then it works fine.
>
> I don't understand, why
>
> Christian
>