Re: How to hide html sections
Or with attribute: add(new Button("red_or_green")add(new AttributeModifier("class", new AbstractReadOnlyModel() { getObject() { return condition ? "red" : "green"; }}); ** Martin 2009/9/10 Pedro Santos : > With OO you can teach you objects to behave, rater the set then every time: > String property; > add(new Button("red"){ > @Override > public boolean isVisible() { > return property == red condition > } > }); > add(new Button("green"){ > @Override > public boolean isVisible() { > return property == green contition > } > }); > > On Thu, Sep 10, 2009 at 7:38 AM, Martin Makundi < > martin.maku...@koodaripalvelut.com> wrote: > >> > How is it possible to do this in Wicket ? Is there a wicket tag that we >> can >> > use for that ? >> >> If you want to hide a component just say component.setVisible(false); >> >> If you wnat to hide component and surrounding html markup, do the >> following: >> >> >> >> td>Here you can have any arbitrary html >> Let's assume >> this is your component then >> >> >> >> >> >> In the above example you could hide the component with its surrounding >> markup using >> add(new >> Label("this_component_will_determine_visibility").setVisible(false)); >> >> Is this what you were looking for? >> >> > E.g. Depending of the value returned by a property, I would like to >> display >> > in a table a red button instead of a green >> >> Well.. CSS should be used for that and AttributeModifier. >> >> ** >> Martin >> >> > >> > Regards, >> > >> > Charles Moulliard >> > Senior Enterprise Architect >> > Apache Camel Committer >> > >> > * >> > blog : http://cmoulliard.blogspot.com >> > >> >> - >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >> For additional commands, e-mail: users-h...@wicket.apache.org >> >> > - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: How to hide html sections
With OO you can teach you objects to behave, rater the set then every time: String property; add(new Button("red"){ @Override public boolean isVisible() { return property == red condition } }); add(new Button("green"){ @Override public boolean isVisible() { return property == green contition } }); On Thu, Sep 10, 2009 at 7:38 AM, Martin Makundi < martin.maku...@koodaripalvelut.com> wrote: > > How is it possible to do this in Wicket ? Is there a wicket tag that we > can > > use for that ? > > If you want to hide a component just say component.setVisible(false); > > If you wnat to hide component and surrounding html markup, do the > following: > > > > td>Here you can have any arbitrary html > Let's assume > this is your component then > > > > > > In the above example you could hide the component with its surrounding > markup using > add(new > Label("this_component_will_determine_visibility").setVisible(false)); > > Is this what you were looking for? > > > E.g. Depending of the value returned by a property, I would like to > display > > in a table a red button instead of a green > > Well.. CSS should be used for that and AttributeModifier. > > ** > Martin > > > > > Regards, > > > > Charles Moulliard > > Senior Enterprise Architect > > Apache Camel Committer > > > > * > > blog : http://cmoulliard.blogspot.com > > > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > >
Re: How to hide html sections
> How is it possible to do this in Wicket ? Is there a wicket tag that we can > use for that ? If you want to hide a component just say component.setVisible(false); If you wnat to hide component and surrounding html markup, do the following: td>Here you can have any arbitrary html Let's assume this is your component then In the above example you could hide the component with its surrounding markup using add(new Label("this_component_will_determine_visibility").setVisible(false)); Is this what you were looking for? > E.g. Depending of the value returned by a property, I would like to display > in a table a red button instead of a green Well.. CSS should be used for that and AttributeModifier. ** Martin > > Regards, > > Charles Moulliard > Senior Enterprise Architect > Apache Camel Committer > > * > blog : http://cmoulliard.blogspot.com > - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
How to hide html sections
Hi, In JSP pages, it is quite simple to change HTML rendering as it is possible to test java properties and depending on the value we can display or hide html code. How is it possible to do this in Wicket ? Is there a wicket tag that we can use for that ? E.g. Depending of the value returned by a property, I would like to display in a table a red button instead of a green Regards, Charles Moulliard Senior Enterprise Architect Apache Camel Committer * blog : http://cmoulliard.blogspot.com