Martijn Dashorst a écrit :
No, because when you set output markuptag on the link *AND* on the
label, what should it do? Those are in conflict. And don't work as
advertised. This is completely going against what we designed
visibility to do: not render markup.
If you put setVisible(false) & setOutputMarkupTag(true) on both component, only the parent one will be render :

foo = new Link("foo");
foo.setVisible(false);
foo.setOutputMarkupTag(true)
bar =  new label("bar");
bar.setVisible(false);
bar.setOutputMarkupTag(true)
add(foo);
foo.add(bar);

you will have :
<a id="foo0"></a>

have a look in patch : markupStream.skipComponent(); will skip child components

--
Vincent



When I do this:

new Link("foo")
           .add(new Label("bar", "foobar"))
           .setOutputWhatever(true)
           .setVisible(false);

I expect this:

<a href="#" wicket:id="foo" id="foo" style="display:none"></a>

And NOT:

<a href="#" wicket:id="foo" id="foo" style="display:none">
   <span wicket:id="bar" style="display:none"></span>
</a>

Martijn

On 3/20/07, Vincent Demay <[EMAIL PROTECTED]> wrote:
Martijn Dashorst a écrit :
> One of my major pain points here is not discussed yet. And that is
> nested invisible components.
>
> <a href="#" wicket:id="foo"><span wicket:id="bar"></span></a>
>
> new Link("foo").add(new Label("bar")).setVisible(false)
>
>
> ...
> onAjaxThing(target) {
>    bar.setVisible(true);
>    target.add(bar);
> }
>
> In both cases this is impossible, however, from what I get from this
> discussion is that we want to make it magical that this is possible.
It is no so much magical because you need to call the
setoutputmarkuptag(true) to do that and you can also revert it when you
want calling
setoutputmarkuptag(false)
>
> Either way, this is the next thing that comes up, right after ListView
> and Repeaters...
No problem because the default behavior is the same as today
(setoutputmarkuptag(false) by default)
>
> And what do we do about components that are not visible because the
> user is not authorized? Do we generate the tags or not?
With the last implementation coming out from our discuss is
If you explicitly called setoutputmarkuptag(true) on your bar component
yes else no. So you can choose what you want to do?
>
> The more I think about it, the more magic is needed, the less I like
> the idea.
>
> Martijn
>
--
Vincent




Reply via email to