Re: border vs Link.setBeforeDisabledLink

2009-07-19 Thread Anton Veretennikov
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 wrote:
> I cannot override it, it is final
>
> On Sun, Jul 19, 2009 at 7:37 PM, Anton Veretennikov <
> anton.veretenni...@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 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-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>>
>
>
> --
> Fernando Wermus.
>
> www.linkedin.com/in/fernandowermus
>

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



Re: border vs Link.setBeforeDisabledLink

2009-07-19 Thread Fernando Wermus
I cannot override it, it is final

On Sun, Jul 19, 2009 at 7:37 PM, Anton Veretennikov <
anton.veretenni...@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 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-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


-- 
Fernando Wermus.

www.linkedin.com/in/fernandowermus


Re: border vs Link.setBeforeDisabledLink

2009-07-19 Thread Anton Veretennikov
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 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-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



border vs Link.setBeforeDisabledLink

2009-07-19 Thread Fernando Wermus
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