You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Ricardo Mayerhofer <ri...@gmail.com> on 2008/12/29 22:31:32 UTC

ComponentResolver and CompoundPropertyModels

Hi all,
I'm trying to autoAdd form components using componentResolver, but as far as
I know it doesn't work nor is the recommended aproach:
http://cwiki.apache.org/WICKET/lifecycle-of-a-wicket-application.html#LifecycleofaWicketApplication-Rendering

My intent is something like this:
if ( componentTag.getName().equals( "input" ) )
{
	markupContainer.autoAdd( new TextField( componentTag.getId() ),
markupStream );
}

Is it posssible to acomplish this using wicket? Any input is appreciated.
Thanks.
-- 
View this message in context: http://www.nabble.com/ComponentResolver-and-CompoundPropertyModels-tp21209434p21209434.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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


Re: ComponentResolver and CompoundPropertyModels

Posted by Ricardo Mayerhofer <ri...@gmail.com>.
Thanks Igor! I was mistankenly replacing the model on component resolver. Now
it works fine!

"what you have to do is add a component instead of autoadd"
Unfortunately add doesn't work during render phase, where component
resolvers are called. I found this mail about the subject:
http://osdir.com/ml/java.wicket.devel/2005-03/msg00552.html

So the only way to make this work is commenting out the removal?


igor.vaynberg wrote:
> 
> autocomponents are components that only exist during the render phase,
> thus they are removed after. what you have to do is add a component
> instead of autoadd. if your model is not being updated set a
> breakpoint in updatemodel() and see what it is doing, also make sure
> there are no validation errors.
> 
> -igor
> 
> On Mon, Jan 5, 2009 at 12:43 PM, Ricardo Mayerhofer
> <ri...@gmail.com> wrote:
>>
>> Thanks Jan, I will look into it!
>>
>> Igor, you were right. Auto components are deleted. I commented that part
>> of
>> the code, so now I can access the component (and its model) on form's
>> submit. Therefore, the property is not being setted on the form model
>> yet...
>> Do you have any idea why? BTW, why auto components are deleted after
>> rendering?
>>
>>
>> Jan Kriesten-2 wrote:
>>>
>>>
>>> Hi,
>>>
>>>> auto components are removed after rendering is complete if i recall
>>>> correctly, so there is nothing processing the submitted input.
>>>
>>> there are a couple of problems with that approach, same for embedding
>>> components
>>> in markup with the <wicket:component>
>>>
>>> I approached a similar problem auto-adding components with templates. My
>>> solution can be found here:
>>> http://www.footprint.de/fcc/2008/11/some-wicket-scala/
>>>
>>> Instead of handling wxComponent you might filter for other tags - so
>>> that
>>> might
>>> be the solution for you, too.
>>>
>>> Hope this helps.
>>>
>>> Best regards, --- Jan.
>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>
>>>
>>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/ComponentResolver-and-CompoundPropertyModels-tp21209434p21298927.html
>> Sent from the Wicket - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/ComponentResolver-and-CompoundPropertyModels-tp21209434p21336666.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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


Re: ComponentResolver and CompoundPropertyModels

Posted by Igor Vaynberg <ig...@gmail.com>.
autocomponents are components that only exist during the render phase,
thus they are removed after. what you have to do is add a component
instead of autoadd. if your model is not being updated set a
breakpoint in updatemodel() and see what it is doing, also make sure
there are no validation errors.

-igor

On Mon, Jan 5, 2009 at 12:43 PM, Ricardo Mayerhofer
<ri...@gmail.com> wrote:
>
> Thanks Jan, I will look into it!
>
> Igor, you were right. Auto components are deleted. I commented that part of
> the code, so now I can access the component (and its model) on form's
> submit. Therefore, the property is not being setted on the form model yet...
> Do you have any idea why? BTW, why auto components are deleted after
> rendering?
>
>
> Jan Kriesten-2 wrote:
>>
>>
>> Hi,
>>
>>> auto components are removed after rendering is complete if i recall
>>> correctly, so there is nothing processing the submitted input.
>>
>> there are a couple of problems with that approach, same for embedding
>> components
>> in markup with the <wicket:component>
>>
>> I approached a similar problem auto-adding components with templates. My
>> solution can be found here:
>> http://www.footprint.de/fcc/2008/11/some-wicket-scala/
>>
>> Instead of handling wxComponent you might filter for other tags - so that
>> might
>> be the solution for you, too.
>>
>> Hope this helps.
>>
>> Best regards, --- Jan.
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>>
>
> --
> View this message in context: http://www.nabble.com/ComponentResolver-and-CompoundPropertyModels-tp21209434p21298927.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

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


Re: ComponentResolver and CompoundPropertyModels

Posted by Ricardo Mayerhofer <ri...@gmail.com>.
Thanks Jan, I will look into it!

Igor, you were right. Auto components are deleted. I commented that part of
the code, so now I can access the component (and its model) on form's
submit. Therefore, the property is not being setted on the form model yet...
Do you have any idea why? BTW, why auto components are deleted after
rendering?


Jan Kriesten-2 wrote:
> 
> 
> Hi,
> 
>> auto components are removed after rendering is complete if i recall
>> correctly, so there is nothing processing the submitted input.
> 
> there are a couple of problems with that approach, same for embedding
> components
> in markup with the <wicket:component>
> 
> I approached a similar problem auto-adding components with templates. My
> solution can be found here:
> http://www.footprint.de/fcc/2008/11/some-wicket-scala/
> 
> Instead of handling wxComponent you might filter for other tags - so that
> might
> be the solution for you, too.
> 
> Hope this helps.
> 
> Best regards, --- Jan.
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/ComponentResolver-and-CompoundPropertyModels-tp21209434p21298927.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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


Re: ComponentResolver and CompoundPropertyModels

Posted by jWeekend <jw...@cabouge.com>.
Jan,

That looks interesting.

I'm hoping to confirm/announce our Feb 4  http://jweekend.com/dev/LWUGReg/
London Wicket Event  shortly. It looks like we're going to have a couple of
speakers on Wicket with Scala  (one from UK & one from Holland).

http://jweekend.com/dev/ContactUsBody/ Drop me a line  if you can come along
and/or would like to get involved with the presentations next time or at
another time on this and/or other Wicket related topics you have an interest
in. 

Regards - Cemal
http://www.jWeekend.co.uk jWeekend 

a couple of talks at our 
  

Jan Kriesten-2 wrote:
> 
> 
> Hi,
> 
>> auto components are removed after rendering is complete if i recall
>> correctly, so there is nothing processing the submitted input.
> 
> there are a couple of problems with that approach, same for embedding
> components
> in markup with the <wicket:component>
> 
> I approached a similar problem auto-adding components with templates. My
> solution can be found here:
> http://www.footprint.de/fcc/2008/11/some-wicket-scala/
> 
> Instead of handling wxComponent you might filter for other tags - so that
> might
> be the solution for you, too.
> 
> Hope this helps.
> 
> Best regards, --- Jan.
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/ComponentResolver-and-CompoundPropertyModels-tp21209434p21298075.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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


Re: ComponentResolver and CompoundPropertyModels

Posted by Jan Kriesten <kr...@mail.footprint.de>.
Hi,

> auto components are removed after rendering is complete if i recall
> correctly, so there is nothing processing the submitted input.

there are a couple of problems with that approach, same for embedding components
in markup with the <wicket:component>

I approached a similar problem auto-adding components with templates. My
solution can be found here: http://www.footprint.de/fcc/2008/11/some-wicket-scala/

Instead of handling wxComponent you might filter for other tags - so that might
be the solution for you, too.

Hope this helps.

Best regards, --- Jan.



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


Re: ComponentResolver and CompoundPropertyModels

Posted by Igor Vaynberg <ig...@gmail.com>.
auto components are removed after rendering is complete if i recall
correctly, so there is nothing processing the submitted input.

-igor

On Mon, Jan 5, 2009 at 5:42 AM, Ricardo Mayerhofer
<ri...@gmail.com> wrote:
>
> Anyone? Wicket gurus?
>
> Any tip on how to make it work with component models is appreciated.
>
> Thanks.
>
>
> Ricardo Mayerhofer wrote:
>>
>> Hi all,
>> I'm trying to autoAdd form components using componentResolver, but as far
>> as I know it doesn't work nor is the recommended aproach:
>> http://cwiki.apache.org/WICKET/lifecycle-of-a-wicket-application.html#LifecycleofaWicketApplication-Rendering
>>
>> My intent is something like this:
>> if ( componentTag.getName().equals( "input" ) )
>> {
>>       markupContainer.autoAdd( new TextField( componentTag.getId() ),
>> markupStream );
>> }
>>
>> Is it posssible to acomplish this using wicket? Any input is appreciated.
>> Thanks.
>>
>
> --
> View this message in context: http://www.nabble.com/ComponentResolver-and-CompoundPropertyModels-tp21209434p21291204.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

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


Re: ComponentResolver and CompoundPropertyModels

Posted by Ricardo Mayerhofer <ri...@gmail.com>.
Anyone? Wicket gurus?

Any tip on how to make it work with component models is appreciated.

Thanks.


Ricardo Mayerhofer wrote:
> 
> Hi all,
> I'm trying to autoAdd form components using componentResolver, but as far
> as I know it doesn't work nor is the recommended aproach:
> http://cwiki.apache.org/WICKET/lifecycle-of-a-wicket-application.html#LifecycleofaWicketApplication-Rendering
> 
> My intent is something like this:
> if ( componentTag.getName().equals( "input" ) )
> {
> 	markupContainer.autoAdd( new TextField( componentTag.getId() ),
> markupStream );
> }
> 
> Is it posssible to acomplish this using wicket? Any input is appreciated.
> Thanks.
> 

-- 
View this message in context: http://www.nabble.com/ComponentResolver-and-CompoundPropertyModels-tp21209434p21291204.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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


Re: ComponentResolver and CompoundPropertyModels

Posted by Ricardo Mayerhofer <ri...@gmail.com>.
Just completing my last message... The code bellow actually works in the
sense of adding the component to the form, but it doesn't work with
compoundpropertymodels. I mean the value of the text field is never setted
in the model.


Ricardo Mayerhofer wrote:
> 
> Hi all,
> I'm trying to autoAdd form components using componentResolver, but as far
> as I know it doesn't work nor is the recommended aproach:
> http://cwiki.apache.org/WICKET/lifecycle-of-a-wicket-application.html#LifecycleofaWicketApplication-Rendering
> 
> My intent is something like this:
> if ( componentTag.getName().equals( "input" ) )
> {
> 	markupContainer.autoAdd( new TextField( componentTag.getId() ),
> markupStream );
> }
> 
> Is it posssible to acomplish this using wicket? Any input is appreciated.
> Thanks.
> 

-- 
View this message in context: http://www.nabble.com/ComponentResolver-and-CompoundPropertyModels-tp21209434p21216923.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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