new Link("foo").add(new Label("bar")).setVisible(false);

(so the link/outer componetn is not visible)

then this:

onAjaxThing(target) {
   bar.setVisible(true);
   target.add(bar);
}


(setting suddenly the inner component to visible, which was already visible
by itself so this is a NOP)

And adding that to the target shouldn't do one thing.. If that is currently
the case its an error
because a component should only  render itself if itself and all its parent
are visible.
So the target.add(bar) should result in no output at all because the parent
is not visible.

if you did this:


onAjaxThing(target) {
   foo.setVisible(true);
   target.add(bar);
}

then that is a programming error,

this should generate all the markup:

onAjaxThing(target) {
   foo.setVisible(true);
   target.add(foo);
}

and this

onAjaxThing(target) {
   foo.setVisible(true);
   bar.setVisible(false);
   target.add(foo);
}

should generate the link, but with an empty span inside it, so that
afterwards this works:


onAjaxThing(target) {
   bar.setVisible(true);
   target.add(bar);
}

i like this approach it is much more self explaining then what we have now

Currently in my project is have a special setComponentVisible(boolean) on
all my components
that sets a special visible flag so that i can generate display:none or not.
So that i can do the thing i want here. Because i really don't want
components to not be there..
(and in our setup i really can't wrap every component in a container..)

johan


On 3/20/07, Martijn Dashorst <[EMAIL PROTECTED]> wrote:

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.

Either way, this is the next thing that comes up, right after ListView
and Repeaters...

And what do we do about components that are not visible because the
user is not authorized? Do we generate the tags or not?

The more I think about it, the more magic is needed, the less I like the
idea.

Martijn

--
Learn Wicket at ApacheCon Europe: http://apachecon.com
Join the wicket community at irc.freenode.net: ##wicket
Wicket 1.2.5 will keep your server alive. Download Wicket now!
http://wicketframework.org

Reply via email to