Can't add a Form component to an Item in RefreshingView!?

View: New views
3 Messages — Rating Filter:   Alert me  

Can't add a Form component to an Item in RefreshingView!?

by mint :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I'm new to Wicket. I'm a little impatient with this one... so here goes.

I have a RefreshingView, with each item getting a Fragment component
added to it in the populateItem() method. Each of these Fragment
components only contain Labels. All is well here.

However, whenever I add a single Fragment component that contains a
Form I get an exception: "java.lang.ClassCastException:
org.apache.wicket.markup.RawMarkup cannot be cast to
org.apache.wicket.markup.ComponentTag"

What I'm trying to do here is when an item is selected on a list, it
renders the selected item as a Form to be edited rather than being
displayed in labels. Only ONE line is selected at a time, so only need
the one form showing. Everything else is fine... Java/markup hierarchy
match, model usage is all good. I can get the Fragment component
containing the form to work outside a RefreshingView. So obviously it
has trouble rendering Forms inside a RefreshingView repeater. Can't
work it out.

Any help will be much appreciated.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Parent Message unknown RE: Can't add a Form component to an Item in RefreshingView!?

by jthomerson :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hard to help you without seeing code / markup.

Jeremy Thomerson
http://www.wickettraining.com
-- sent from a wireless device


-----Original Message-----
From: Philip Watson <philip.john.watson@...>
Sent: Friday, July 03, 2009 3:23 AM
To: users@...
Subject: Can't add a Form component to an Item in RefreshingView!?

I'm new to Wicket. I'm a little impatient with this one... so here goes.

I have a RefreshingView, with each item getting a Fragment component
added to it in the populateItem() method. Each of these Fragment
components only contain Labels. All is well here.

However, whenever I add a single Fragment component that contains a
Form I get an exception: "java.lang.ClassCastException:
org.apache.wicket.markup.RawMarkup cannot be cast to
org.apache.wicket.markup.ComponentTag"

What I'm trying to do here is when an item is selected on a list, it
renders the selected item as a Form to be edited rather than being
displayed in labels. Only ONE line is selected at a time, so only need
the one form showing. Everything else is fine... Java/markup hierarchy
match, model usage is all good. I can get the Fragment component
containing the form to work outside a RefreshingView. So obviously it
has trouble rendering Forms inside a RefreshingView repeater. Can't
work it out.

Any help will be much appreciated.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Re: Can't add a Form component to an Item in RefreshingView!?

by Fernando Wermus-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Philip,
    Remember that some repeaters when are refreshed change their items. You
have to instruct no to create new items instances. Take a look at ListView.
I looked for Refreshing view but I couldn't see any class like that.

bye!

On Fri, Jul 3, 2009 at 1:23 AM, Philip Watson
<philip.john.watson@...>wrote:

> I'm new to Wicket. I'm a little impatient with this one... so here goes.
>
> I have a RefreshingView, with each item getting a Fragment component
> added to it in the populateItem() method. Each of these Fragment
> components only contain Labels. All is well here.
>
> However, whenever I add a single Fragment component that contains a
> Form I get an exception: "java.lang.ClassCastException:
> org.apache.wicket.markup.RawMarkup cannot be cast to
> org.apache.wicket.markup.ComponentTag"
>
> What I'm trying to do here is when an item is selected on a list, it
> renders the selected item as a Form to be edited rather than being
> displayed in labels. Only ONE line is selected at a time, so only need
> the one form showing. Everything else is fine... Java/markup hierarchy
> match, model usage is all good. I can get the Fragment component
> containing the form to work outside a RefreshingView. So obviously it
> has trouble rendering Forms inside a RefreshingView repeater. Can't
> work it out.
>
> Any help will be much appreciated.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@...
> For additional commands, e-mail: users-help@...
>
>


--
Fernando Wermus.

www.linkedin.com/in/fernandowermus