You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by rtow <rt...@yahoo.com> on 2007/11/10 00:35:14 UTC

How to migrate onAfterRender/onBeforeRender from wicket 1.2.6 to 1.3

In wicket 1.2.6, I have the following and  render fine.

	private static class RequiredLabel extends Label
	{
		private static final long serialVersionUID = 1L;
		
		private boolean required;
		
		public RequiredLabel(String id, FormComponent fc)
		{
			super(id, fc);
			this.required = fc.isRequired();
		}

		@Override 
		protected void onBeforeRender()
		{
			super.onBeforeRender();
			if (this.required) 
				getResponse().write("*");
		}
	}

After migrated to wicket 1.3 beta, I overrided the method as following:

		@Override 
		protected void onBeforeRender()
		{
			if (this.required) 
				getResponse().write("*");
			super.onBeforeRender();
		}

The red * still render, but at the very top of the page.  A similar problem
for onAfterRender() is that also render, but at the very bottom of the page.

Thanks for your help!

rtow
-- 
View this message in context: http://www.nabble.com/How-to-migrate-onAfterRender-onBeforeRender-from-wicket-1.2.6-to-1.3-tf4780695.html#a13677169
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: How to migrate onAfterRender/onBeforeRender from wicket 1.2.6 to 1.3

Posted by rtow <rt...@yahoo.com>.
Thanks!


cblehman wrote:
> 
> You can also use onRender()
> 
> @Override
> protected void onRender()
> {
>     getResponse().write("StuffBeforeComponent");
>     super.onRender();
>     getResponse().write("StuffAfterComponent");
> }
> 
> But IComponentBorder will do all that for you...
> 
> -Clay
> 
> -----Original Message-----
> From: Johan Compagner [mailto:jcompagner@gmail.com] 
> Sent: Saturday, November 10, 2007 5:42 AM
> To: users@wicket.apache.org
> Subject: Re: How to migrate onAfterRender/onBeforeRender from wicket
> 1.2.6 to 1.3
> 
> seee IComponentBorder
> 
> On Nov 10, 2007 1:55 AM, rtow <rt...@yahoo.com> wrote:
> 
>>
>> Big thanks!  The onComponentTag(tag) is the perfect replacement for
>> onBeforeRender().  Do you have suggestion for onAfterRender()?  I
>> explained
>> that I also have a problem to render onAfterRender() in previous mail.
>>
>> rtow
>>
>>
>>
>> Johan Compagner wrote:
>> >
>> > hmm thats the first case that i see that used the onBeforeRender
> like
>> > that.
>> > But what you want is a border around the component see
> IComponentBorder
>> > or override the onComponentTag(tag);
>> > that is also called right before the tag is rendered.
>> >
>> > johan
>> >
>> >
>> >
>> > On Nov 10, 2007 12:35 AM, rtow <rt...@yahoo.com> wrote:
>> >
>> >>
>> >> In wicket 1.2.6, I have the following and  render fine.
>> >>
>> >>        private static class RequiredLabel extends Label
>> >>        {
>> >>                private static final long serialVersionUID = 1L;
>> >>
>> >>                private boolean required;
>> >>
>> >>                public RequiredLabel(String id, FormComponent fc)
>> >>                {
>> >>                        super(id, fc);
>> >>                        this.required = fc.isRequired();
>> >>                }
>> >>
>> >>                @Override
>> >>                protected void onBeforeRender()
>> >>                {
>> >>                        super.onBeforeRender();
>> >>                        if (this.required)
>> >>                                getResponse().write("*");
>> >>                }
>> >>        }
>> >>
>> >> After migrated to wicket 1.3 beta, I overrided the method as
> following:
>> >>
>> >>                @Override
>> >>                protected void onBeforeRender()
>> >>                {
>> >>                        if (this.required)
>> >>                                getResponse().write("*");
>> >>                        super.onBeforeRender();
>> >>                }
>> >>
>> >> The red * still render, but at the very top of the page.  A similar
>> >> problem
>> >> for onAfterRender() is that also render, but at the very bottom of
> the
>> >> page.
>> >>
>> >> Thanks for your help!
>> >>
>> >> rtow
>> >> --
>> >> View this message in context:
>> >>
>>
> http://www.nabble.com/How-to-migrate-onAfterRender-onBeforeRender-from-w
> icket-1.2.6-to-1.3-tf4780695.html#a13677169
>> >> Sent from the Wicket - User mailing list archive at
>> >> Nabble.com <http://nabble.com/><http://nabble.com/>
>> >> .
>> >>
>> >>
>> >>
> ---------------------------------------------------------------------
>> >> 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/How-to-migrate-onAfterRender-onBeforeRender-from-w
> icket-1.2.6-to-1.3-tf4780695.html#a13678135
>>  Sent from the Wicket - User mailing list archive at
> Nabble.com<http://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/How-to-migrate-onAfterRender-onBeforeRender-from-wicket-1.2.6-to-1.3-tf4780695.html#a13710599
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: How to migrate onAfterRender/onBeforeRender from wicket 1.2.6 to 1.3

Posted by Clay Lehman <cl...@medfusion.net>.
You can also use onRender()

@Override
protected void onRender()
{
    getResponse().write("StuffBeforeComponent");
    super.onRender();
    getResponse().write("StuffAfterComponent");
}

But IComponentBorder will do all that for you...

-Clay

-----Original Message-----
From: Johan Compagner [mailto:jcompagner@gmail.com] 
Sent: Saturday, November 10, 2007 5:42 AM
To: users@wicket.apache.org
Subject: Re: How to migrate onAfterRender/onBeforeRender from wicket
1.2.6 to 1.3

seee IComponentBorder

On Nov 10, 2007 1:55 AM, rtow <rt...@yahoo.com> wrote:

>
> Big thanks!  The onComponentTag(tag) is the perfect replacement for
> onBeforeRender().  Do you have suggestion for onAfterRender()?  I
> explained
> that I also have a problem to render onAfterRender() in previous mail.
>
> rtow
>
>
>
> Johan Compagner wrote:
> >
> > hmm thats the first case that i see that used the onBeforeRender
like
> > that.
> > But what you want is a border around the component see
IComponentBorder
> > or override the onComponentTag(tag);
> > that is also called right before the tag is rendered.
> >
> > johan
> >
> >
> >
> > On Nov 10, 2007 12:35 AM, rtow <rt...@yahoo.com> wrote:
> >
> >>
> >> In wicket 1.2.6, I have the following and  render fine.
> >>
> >>        private static class RequiredLabel extends Label
> >>        {
> >>                private static final long serialVersionUID = 1L;
> >>
> >>                private boolean required;
> >>
> >>                public RequiredLabel(String id, FormComponent fc)
> >>                {
> >>                        super(id, fc);
> >>                        this.required = fc.isRequired();
> >>                }
> >>
> >>                @Override
> >>                protected void onBeforeRender()
> >>                {
> >>                        super.onBeforeRender();
> >>                        if (this.required)
> >>                                getResponse().write("*");
> >>                }
> >>        }
> >>
> >> After migrated to wicket 1.3 beta, I overrided the method as
following:
> >>
> >>                @Override
> >>                protected void onBeforeRender()
> >>                {
> >>                        if (this.required)
> >>                                getResponse().write("*");
> >>                        super.onBeforeRender();
> >>                }
> >>
> >> The red * still render, but at the very top of the page.  A similar
> >> problem
> >> for onAfterRender() is that also render, but at the very bottom of
the
> >> page.
> >>
> >> Thanks for your help!
> >>
> >> rtow
> >> --
> >> View this message in context:
> >>
>
http://www.nabble.com/How-to-migrate-onAfterRender-onBeforeRender-from-w
icket-1.2.6-to-1.3-tf4780695.html#a13677169
> >> Sent from the Wicket - User mailing list archive at
> >> Nabble.com <http://nabble.com/><http://nabble.com/>
> >> .
> >>
> >>
> >>
---------------------------------------------------------------------
> >> 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/How-to-migrate-onAfterRender-onBeforeRender-from-w
icket-1.2.6-to-1.3-tf4780695.html#a13678135
>  Sent from the Wicket - User mailing list archive at
Nabble.com<http://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: How to migrate onAfterRender/onBeforeRender from wicket 1.2.6 to 1.3

Posted by Johan Compagner <jc...@gmail.com>.
seee IComponentBorder

On Nov 10, 2007 1:55 AM, rtow <rt...@yahoo.com> wrote:

>
> Big thanks!  The onComponentTag(tag) is the perfect replacement for
> onBeforeRender().  Do you have suggestion for onAfterRender()?  I
> explained
> that I also have a problem to render onAfterRender() in previous mail.
>
> rtow
>
>
>
> Johan Compagner wrote:
> >
> > hmm thats the first case that i see that used the onBeforeRender like
> > that.
> > But what you want is a border around the component see IComponentBorder
> > or override the onComponentTag(tag);
> > that is also called right before the tag is rendered.
> >
> > johan
> >
> >
> >
> > On Nov 10, 2007 12:35 AM, rtow <rt...@yahoo.com> wrote:
> >
> >>
> >> In wicket 1.2.6, I have the following and  render fine.
> >>
> >>        private static class RequiredLabel extends Label
> >>        {
> >>                private static final long serialVersionUID = 1L;
> >>
> >>                private boolean required;
> >>
> >>                public RequiredLabel(String id, FormComponent fc)
> >>                {
> >>                        super(id, fc);
> >>                        this.required = fc.isRequired();
> >>                }
> >>
> >>                @Override
> >>                protected void onBeforeRender()
> >>                {
> >>                        super.onBeforeRender();
> >>                        if (this.required)
> >>                                getResponse().write("*");
> >>                }
> >>        }
> >>
> >> After migrated to wicket 1.3 beta, I overrided the method as following:
> >>
> >>                @Override
> >>                protected void onBeforeRender()
> >>                {
> >>                        if (this.required)
> >>                                getResponse().write("*");
> >>                        super.onBeforeRender();
> >>                }
> >>
> >> The red * still render, but at the very top of the page.  A similar
> >> problem
> >> for onAfterRender() is that also render, but at the very bottom of the
> >> page.
> >>
> >> Thanks for your help!
> >>
> >> rtow
> >> --
> >> View this message in context:
> >>
> http://www.nabble.com/How-to-migrate-onAfterRender-onBeforeRender-from-wicket-1.2.6-to-1.3-tf4780695.html#a13677169
> >> Sent from the Wicket - User mailing list archive at
> >> Nabble.com <http://nabble.com/><http://nabble.com/>
> >> .
> >>
> >>
> >> ---------------------------------------------------------------------
> >> 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/How-to-migrate-onAfterRender-onBeforeRender-from-wicket-1.2.6-to-1.3-tf4780695.html#a13678135
>  Sent from the Wicket - User mailing list archive at Nabble.com<http://nabble.com/>
> .
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: How to migrate onAfterRender/onBeforeRender from wicket 1.2.6 to 1.3

Posted by rtow <rt...@yahoo.com>.
Big thanks!  The onComponentTag(tag) is the perfect replacement for
onBeforeRender().  Do you have suggestion for onAfterRender()?  I explained
that I also have a problem to render onAfterRender() in previous mail.

rtow 



Johan Compagner wrote:
> 
> hmm thats the first case that i see that used the onBeforeRender like
> that.
> But what you want is a border around the component see IComponentBorder
> or override the onComponentTag(tag);
> that is also called right before the tag is rendered.
> 
> johan
> 
> 
> 
> On Nov 10, 2007 12:35 AM, rtow <rt...@yahoo.com> wrote:
> 
>>
>> In wicket 1.2.6, I have the following and  render fine.
>>
>>        private static class RequiredLabel extends Label
>>        {
>>                private static final long serialVersionUID = 1L;
>>
>>                private boolean required;
>>
>>                public RequiredLabel(String id, FormComponent fc)
>>                {
>>                        super(id, fc);
>>                        this.required = fc.isRequired();
>>                }
>>
>>                @Override
>>                protected void onBeforeRender()
>>                {
>>                        super.onBeforeRender();
>>                        if (this.required)
>>                                getResponse().write("*");
>>                }
>>        }
>>
>> After migrated to wicket 1.3 beta, I overrided the method as following:
>>
>>                @Override
>>                protected void onBeforeRender()
>>                {
>>                        if (this.required)
>>                                getResponse().write("*");
>>                        super.onBeforeRender();
>>                }
>>
>> The red * still render, but at the very top of the page.  A similar
>> problem
>> for onAfterRender() is that also render, but at the very bottom of the
>> page.
>>
>> Thanks for your help!
>>
>> rtow
>> --
>> View this message in context:
>> http://www.nabble.com/How-to-migrate-onAfterRender-onBeforeRender-from-wicket-1.2.6-to-1.3-tf4780695.html#a13677169
>> Sent from the Wicket - User mailing list archive at
>> Nabble.com<http://nabble.com/>
>> .
>>
>>
>> ---------------------------------------------------------------------
>> 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/How-to-migrate-onAfterRender-onBeforeRender-from-wicket-1.2.6-to-1.3-tf4780695.html#a13678135
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: How to migrate onAfterRender/onBeforeRender from wicket 1.2.6 to 1.3

Posted by Johan Compagner <jc...@gmail.com>.
hmm thats the first case that i see that used the onBeforeRender like that.
But what you want is a border around the component see IComponentBorder
or override the onComponentTag(tag);
that is also called right before the tag is rendered.

johan



On Nov 10, 2007 12:35 AM, rtow <rt...@yahoo.com> wrote:

>
> In wicket 1.2.6, I have the following and  render fine.
>
>        private static class RequiredLabel extends Label
>        {
>                private static final long serialVersionUID = 1L;
>
>                private boolean required;
>
>                public RequiredLabel(String id, FormComponent fc)
>                {
>                        super(id, fc);
>                        this.required = fc.isRequired();
>                }
>
>                @Override
>                protected void onBeforeRender()
>                {
>                        super.onBeforeRender();
>                        if (this.required)
>                                getResponse().write("*");
>                }
>        }
>
> After migrated to wicket 1.3 beta, I overrided the method as following:
>
>                @Override
>                protected void onBeforeRender()
>                {
>                        if (this.required)
>                                getResponse().write("*");
>                        super.onBeforeRender();
>                }
>
> The red * still render, but at the very top of the page.  A similar
> problem
> for onAfterRender() is that also render, but at the very bottom of the
> page.
>
> Thanks for your help!
>
> rtow
> --
> View this message in context:
> http://www.nabble.com/How-to-migrate-onAfterRender-onBeforeRender-from-wicket-1.2.6-to-1.3-tf4780695.html#a13677169
> Sent from the Wicket - User mailing list archive at Nabble.com<http://nabble.com/>
> .
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>