pageparameters represent url parameters, so they can only contain strings

-igor


On Thu, Apr 24, 2008 at 7:54 PM, jianfei <[EMAIL PROTECTED]> wrote:
>
>  Hi, I'm new to the wicket framework, and I have a problem while using the
>  PageParameters.
>
>  I want to add a class instance as the value of one of the page parameters,
>  so I did this:
>
>  MyClass instance = new MyClass();
>  PageParameters param = new PageParameters();
>  param.put("classInstance", instance);
>
>  Then I want to get back the parameter as the class instance, so I use:
>
>  MyClass theInstance = (MyClass) param.get("classInstance");
>
>  This works fine if I put it right after the param.put(...) statement.
>  However, when I tried to pass the param to another page as a parameter for
>  the constructor, it throws a class casting exception. I also tried to do
>  "new PageParameters(new HashMap<String, MyClass>())", but that didn't work
>  as well.
>
>  So can anyone help me solve this problem? Thanks a lot!
>  --
>  View this message in context: 
> http://www.nabble.com/Class-casting-exception-while-using-PageParameters-tp16884113p16884113.html
>  Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
>  ---------------------------------------------------------------------
>  To unsubscribe, e-mail: [EMAIL PROTECTED]
>  For additional commands, e-mail: [EMAIL PROTECTED]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to