You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by taha siddiqi <ta...@gmail.com> on 2009/02/20 06:12:24 UTC

Where to disable a child component

Hi,

I have a FormComponentPanel with child components and i need to
disable the children when FormComponentPanel is disabled( isEnabled()
== false ).
I can do that in onBeforeRender() but the problem is that I have to
take the decision on whether to disable the FormComponentPanel in my
IComponentOnBeforeRenderListener.beforeRender() and as this function
is called after FormComponentPanel.onBeforeRender() I am not able
to disable the child components.

Please help

thanks in advance
tawus

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


Re: Where to disable a child component

Posted by taha siddiqi <ta...@gmail.com>.
Thanks for the response,

That is also a way of doing it but I have too many child components
and it is easy to
just write something like

@Override
protected void onRender( MarkupStream stream ){
   childComponent1.setEnabled( isEnabled() );
   ....
}

tawus

On Fri, Feb 20, 2009 at 9:44 PM, Jeremy Thomerson
<je...@wickettraining.com> wrote:
> Why not let you child components override isEnabled() and have part of the
> logic in it check if their parent is enabled?
>
> On Thu, Feb 19, 2009 at 11:25 PM, taha siddiqi <ta...@gmail.com>wrote:
>
>> Hi,
>>
>> I think I resolved it.  I used FormComponentPanel.onRender( MarkupStream )
>>
>> regards
>> tawus
>>
>> On Fri, Feb 20, 2009 at 10:42 AM, taha siddiqi <ta...@gmail.com>
>> wrote:
>> > Hi,
>> >
>> > I have a FormComponentPanel with child components and i need to
>> > disable the children when FormComponentPanel is disabled( isEnabled()
>> > == false ).
>> > I can do that in onBeforeRender() but the problem is that I have to
>> > take the decision on whether to disable the FormComponentPanel in my
>> > IComponentOnBeforeRenderListener.beforeRender() and as this function
>> > is called after FormComponentPanel.onBeforeRender() I am not able
>> > to disable the child components.
>> >
>> > Please help
>> >
>> > thanks in advance
>> > tawus
>> >
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>
>
> --
> Jeremy Thomerson
> http://www.wickettraining.com
>

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


Re: Where to disable a child component

Posted by Jeremy Thomerson <je...@wickettraining.com>.
Why not let you child components override isEnabled() and have part of the
logic in it check if their parent is enabled?

On Thu, Feb 19, 2009 at 11:25 PM, taha siddiqi <ta...@gmail.com>wrote:

> Hi,
>
> I think I resolved it.  I used FormComponentPanel.onRender( MarkupStream )
>
> regards
> tawus
>
> On Fri, Feb 20, 2009 at 10:42 AM, taha siddiqi <ta...@gmail.com>
> wrote:
> > Hi,
> >
> > I have a FormComponentPanel with child components and i need to
> > disable the children when FormComponentPanel is disabled( isEnabled()
> > == false ).
> > I can do that in onBeforeRender() but the problem is that I have to
> > take the decision on whether to disable the FormComponentPanel in my
> > IComponentOnBeforeRenderListener.beforeRender() and as this function
> > is called after FormComponentPanel.onBeforeRender() I am not able
> > to disable the child components.
> >
> > Please help
> >
> > thanks in advance
> > tawus
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>


-- 
Jeremy Thomerson
http://www.wickettraining.com

Re: Where to disable a child component

Posted by taha siddiqi <ta...@gmail.com>.
Hi,

I think I resolved it.  I used FormComponentPanel.onRender( MarkupStream )

regards
tawus

On Fri, Feb 20, 2009 at 10:42 AM, taha siddiqi <ta...@gmail.com> wrote:
> Hi,
>
> I have a FormComponentPanel with child components and i need to
> disable the children when FormComponentPanel is disabled( isEnabled()
> == false ).
> I can do that in onBeforeRender() but the problem is that I have to
> take the decision on whether to disable the FormComponentPanel in my
> IComponentOnBeforeRenderListener.beforeRender() and as this function
> is called after FormComponentPanel.onBeforeRender() I am not able
> to disable the child components.
>
> Please help
>
> thanks in advance
> tawus
>

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