You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Fernando Wermus <fe...@gmail.com> on 2009/07/20 00:27:46 UTC

border vs Link.setBeforeDisabledLink

Hi all,

     My use case consists in show a text as a title or as a link.

I tried to solve this with a border

boolean isTitle=true;


H2Border border=new H2Border("border");
Link link=new Link("link");
H2border.add(link);
link.setEnable(!isTitle);
H2border.setVisible(isTitle);
add(H2border);

Because I thougth that,

a invisible border doesn't make invisible its children. This is reasonable
because a border is a decorator.

Like I couldn't find out a way to set invisible the border but the link, I
finally use method setBeforeDisabledLink which works because I am using a
Link.

Anyway, I would like to use a Border instead of this methods with the skill
to make unvisible the border but not its children.

How can I achieve this?


Thanks in advance

ps: I looked at border.setTransparentResolver(true) without any result.

-- 
Fernando Wermus.

www.linkedin.com/in/fernandowermus

Re: border vs Link.setBeforeDisabledLink

Posted by Anton Veretennikov <an...@gmail.com>.
isVisible, not setVisible

H2Border border=new H2Border("border") {
      @Override
      public boolean isVisible() {
         return ...
      }
};

Be aware it may be called several times during page rendering (look JavaDoc).

-- Tony

On Mon, Jul 20, 2009 at 10:48 AM, Fernando
Wermus<fe...@gmail.com> wrote:
> I cannot override it, it is final
>
> On Sun, Jul 19, 2009 at 7:37 PM, Anton Veretennikov <
> anton.veretennikov@gmail.com> wrote:
>
>> The code of a constructor is executed only once, so after
>> setVisible(true) it will not be called again for other isTitle value
>> (this is not a model). Simply override isVisible of your border. It
>> will be called each time page is going to be rendered.
>>
>> -- Tony
>>
>> On Mon, Jul 20, 2009 at 6:27 AM, Fernando
>> Wermus<fe...@gmail.com> wrote:
>> > Hi all,
>> >
>> >     My use case consists in show a text as a title or as a link.
>> >
>> > I tried to solve this with a border
>> >
>> > boolean isTitle=true;
>> >
>> >
>> > H2Border border=new H2Border("border");
>> > Link link=new Link("link");
>> > H2border.add(link);
>> > link.setEnable(!isTitle);
>> > H2border.setVisible(isTitle);
>> > add(H2border);
>> >
>> > Because I thougth that,
>> >
>> > a invisible border doesn't make invisible its children. This is
>> reasonable
>> > because a border is a decorator.
>> >
>> > Like I couldn't find out a way to set invisible the border but the link,
>> I
>> > finally use method setBeforeDisabledLink which works because I am using a
>> > Link.
>> >
>> > Anyway, I would like to use a Border instead of this methods with the
>> skill
>> > to make unvisible the border but not its children.
>> >
>> > How can I achieve this?
>> >
>> >
>> > Thanks in advance
>> >
>> > ps: I looked at border.setTransparentResolver(true) without any result.
>> >
>> > --
>> > Fernando Wermus.
>> >
>> > www.linkedin.com/in/fernandowermus
>> >
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>
>
> --
> Fernando Wermus.
>
> www.linkedin.com/in/fernandowermus
>

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


Re: border vs Link.setBeforeDisabledLink

Posted by Fernando Wermus <fe...@gmail.com>.
I cannot override it, it is final

On Sun, Jul 19, 2009 at 7:37 PM, Anton Veretennikov <
anton.veretennikov@gmail.com> wrote:

> The code of a constructor is executed only once, so after
> setVisible(true) it will not be called again for other isTitle value
> (this is not a model). Simply override isVisible of your border. It
> will be called each time page is going to be rendered.
>
> -- Tony
>
> On Mon, Jul 20, 2009 at 6:27 AM, Fernando
> Wermus<fe...@gmail.com> wrote:
> > Hi all,
> >
> >     My use case consists in show a text as a title or as a link.
> >
> > I tried to solve this with a border
> >
> > boolean isTitle=true;
> >
> >
> > H2Border border=new H2Border("border");
> > Link link=new Link("link");
> > H2border.add(link);
> > link.setEnable(!isTitle);
> > H2border.setVisible(isTitle);
> > add(H2border);
> >
> > Because I thougth that,
> >
> > a invisible border doesn't make invisible its children. This is
> reasonable
> > because a border is a decorator.
> >
> > Like I couldn't find out a way to set invisible the border but the link,
> I
> > finally use method setBeforeDisabledLink which works because I am using a
> > Link.
> >
> > Anyway, I would like to use a Border instead of this methods with the
> skill
> > to make unvisible the border but not its children.
> >
> > How can I achieve this?
> >
> >
> > Thanks in advance
> >
> > ps: I looked at border.setTransparentResolver(true) without any result.
> >
> > --
> > Fernando Wermus.
> >
> > www.linkedin.com/in/fernandowermus
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>


-- 
Fernando Wermus.

www.linkedin.com/in/fernandowermus

Re: border vs Link.setBeforeDisabledLink

Posted by Anton Veretennikov <an...@gmail.com>.
The code of a constructor is executed only once, so after
setVisible(true) it will not be called again for other isTitle value
(this is not a model). Simply override isVisible of your border. It
will be called each time page is going to be rendered.

-- Tony

On Mon, Jul 20, 2009 at 6:27 AM, Fernando
Wermus<fe...@gmail.com> wrote:
> Hi all,
>
>     My use case consists in show a text as a title or as a link.
>
> I tried to solve this with a border
>
> boolean isTitle=true;
>
>
> H2Border border=new H2Border("border");
> Link link=new Link("link");
> H2border.add(link);
> link.setEnable(!isTitle);
> H2border.setVisible(isTitle);
> add(H2border);
>
> Because I thougth that,
>
> a invisible border doesn't make invisible its children. This is reasonable
> because a border is a decorator.
>
> Like I couldn't find out a way to set invisible the border but the link, I
> finally use method setBeforeDisabledLink which works because I am using a
> Link.
>
> Anyway, I would like to use a Border instead of this methods with the skill
> to make unvisible the border but not its children.
>
> How can I achieve this?
>
>
> Thanks in advance
>
> ps: I looked at border.setTransparentResolver(true) without any result.
>
> --
> Fernando Wermus.
>
> www.linkedin.com/in/fernandowermus
>

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