Martijn Dashorst a écrit :
I know that, but that is not what a user expects... This patch wants
to make ajax visibilitiy changes easier and more transparent. But this
case doesn't work.

Think from a framework perspective instead of just pushing the patch.
What can break, what doesn't work, what else have we forgotten? Play
advocate of the devil.

Now if we don't render child component tags, then the check
document.getElementById('foo').style.display == 'none' fails. So we
now introduce ternairy logic. An element can be hidden or not present
at all. But before this patch it was just not available.
Yes but i think ternairy logic is explicitally introduced by user (calling setOutputMarkupTag(true)). In other case, the logic is the same as before
so user know that and can adapt his js.

How does this functionality work with security? Does
setOutputMarkupTag work regardless of authorization? If I'm not
authorized, does the tag render? Or not?
Even if the tag is rendered, it will be empty. Will it cause a security problem? : it is a tag without any data in it

Martijn

On 3/20/07, Vincent Demay <[EMAIL PROTECTED]> wrote:
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