Re: Wrapping a FormComponent with a Border
Thanks Martin, this is exactly what I had in mind. I already implemented 1), replacing the TextField with said Border but now am stuck with the "HTML manipulation" part ... Tom > Gesendet: Montag, 02. September 2019 um 13:47 Uhr > Von: "Martin Grigorov" > An: "users@wicket.apache.org" > Betreff: Re: Wrapping a FormComponent with a Border > > Hi Tom, > > I imagine two ways: > 1) use org.apache.wicket.application.IComponentInitializationListener that > manipulates the component tree whenever the passed component is an instance > of TextField and has no (direct?!) parent of type FormGroup > 2) use AOP > > In both cases you will need to also the markup because FormGroup expects to > be attached on a , while you will have an . For this you will > probably need to extend Wicket Bootstrap's FormGroup and in your custom one > override onComponentTag() (and onComponentTagBody() - most probably not). > > On Mon, Sep 2, 2019 at 2:05 PM "Tom Götz" wrote: > > > Let me try to explain what I want to achieve more precisely: > > > > - user adds a TextField to a page > > - I want to replace that TextField with a Border (Wicket Border component, > > e.g. FormGroup from wicket-bootstrap) and put the TextField inside that > > border > > > > The problem ist not: "how do I wrap a component with some HTML markup?" > > (either generated by Java code or clientside), but: how can I manipulate > > the component tree (server side) in such a way, that I can remove the > > TextField from it's parent and replace it with a Border that contains that > > TextField!? > > > > Tom > > > > > > > > > > > > > > > Gesendet: Montag, 02. September 2019 um 12:49 Uhr > > > Von: "Tobias Soloschenko" > > > An: users@wicket.apache.org > > > Betreff: Re: Wrapping a FormComponent with a Border > > > > > > Hi, > > > > > > why not add a css class and style it? > > > > > > kind regards > > > > > > Tobias > > > > > > > Am 02.09.2019 um 12:20 schrieb Ernesto Reinaldo Barreiro < > > reier...@gmail.com>: > > > > > > > > Another possibility is to do this client side... > > > > > > > >> On Mon, Sep 2, 2019, 11:43 AM "Tom Götz" wrote: > > > >> > > > >> That would be great, thanks in advance! > > > >> > > > >> Tom > > > >> > > > >> > > > >>> Gesendet: Montag, 02. September 2019 um 10:39 Uhr > > > >>> Von: "Ernesto Reinaldo Barreiro" > > > >>> An: users@wicket.apache.org > > > >>> Betreff: Re: Wrapping a FormComponent with a Border > > > >>> > > > >>> Hi, > > > >>> > > > On Mon, Sep 2, 2019 at 11:13 AM Tom Götz > > wrote: > > > > > > Thanks Ernesto! This example is from 2007 though and uses > > > compent.setComponentBorder > > > Is there something more close to current Wicket versions available > > > >> maybe? > > > :) > > > > > > >>> > > > >>> I think I have somewhere on a private project something similar > > > >> implemented > > > >>> for Wicket 7.x... I can try to dig it up and send classes to you. > > > >>> > > > >>> -- > > > >>> Regards - Ernesto Reinaldo Barreiro > > > > > > - > > 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: Wrapping a FormComponent with a Border
Hi Tom, I imagine two ways: 1) use org.apache.wicket.application.IComponentInitializationListener that manipulates the component tree whenever the passed component is an instance of TextField and has no (direct?!) parent of type FormGroup 2) use AOP In both cases you will need to also the markup because FormGroup expects to be attached on a , while you will have an . For this you will probably need to extend Wicket Bootstrap's FormGroup and in your custom one override onComponentTag() (and onComponentTagBody() - most probably not). On Mon, Sep 2, 2019 at 2:05 PM "Tom Götz" wrote: > Let me try to explain what I want to achieve more precisely: > > - user adds a TextField to a page > - I want to replace that TextField with a Border (Wicket Border component, > e.g. FormGroup from wicket-bootstrap) and put the TextField inside that > border > > The problem ist not: "how do I wrap a component with some HTML markup?" > (either generated by Java code or clientside), but: how can I manipulate > the component tree (server side) in such a way, that I can remove the > TextField from it's parent and replace it with a Border that contains that > TextField!? > > Tom > > > > > > > > Gesendet: Montag, 02. September 2019 um 12:49 Uhr > > Von: "Tobias Soloschenko" > > An: users@wicket.apache.org > > Betreff: Re: Wrapping a FormComponent with a Border > > > > Hi, > > > > why not add a css class and style it? > > > > kind regards > > > > Tobias > > > > > Am 02.09.2019 um 12:20 schrieb Ernesto Reinaldo Barreiro < > reier...@gmail.com>: > > > > > > Another possibility is to do this client side... > > > > > >> On Mon, Sep 2, 2019, 11:43 AM "Tom Götz" wrote: > > >> > > >> That would be great, thanks in advance! > > >> > > >> Tom > > >> > > >> > > >>> Gesendet: Montag, 02. September 2019 um 10:39 Uhr > > >>> Von: "Ernesto Reinaldo Barreiro" > > >>> An: users@wicket.apache.org > > >>> Betreff: Re: Wrapping a FormComponent with a Border > > >>> > > >>> Hi, > > >>> > > On Mon, Sep 2, 2019 at 11:13 AM Tom Götz > wrote: > > > > Thanks Ernesto! This example is from 2007 though and uses > > compent.setComponentBorder > > Is there something more close to current Wicket versions available > > >> maybe? > > :) > > > > >>> > > >>> I think I have somewhere on a private project something similar > > >> implemented > > >>> for Wicket 7.x... I can try to dig it up and send classes to you. > > >>> > > >>> -- > > >>> Regards - Ernesto Reinaldo Barreiro > > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > >
Re: Wrapping a FormComponent with a Border
Let me try to explain what I want to achieve more precisely: - user adds a TextField to a page - I want to replace that TextField with a Border (Wicket Border component, e.g. FormGroup from wicket-bootstrap) and put the TextField inside that border The problem ist not: "how do I wrap a component with some HTML markup?" (either generated by Java code or clientside), but: how can I manipulate the component tree (server side) in such a way, that I can remove the TextField from it's parent and replace it with a Border that contains that TextField!? Tom > Gesendet: Montag, 02. September 2019 um 12:49 Uhr > Von: "Tobias Soloschenko" > An: users@wicket.apache.org > Betreff: Re: Wrapping a FormComponent with a Border > > Hi, > > why not add a css class and style it? > > kind regards > > Tobias > > > Am 02.09.2019 um 12:20 schrieb Ernesto Reinaldo Barreiro > > : > > > > Another possibility is to do this client side... > > > >> On Mon, Sep 2, 2019, 11:43 AM "Tom Götz" wrote: > >> > >> That would be great, thanks in advance! > >> > >> Tom > >> > >> > >>> Gesendet: Montag, 02. September 2019 um 10:39 Uhr > >>> Von: "Ernesto Reinaldo Barreiro" > >>> An: users@wicket.apache.org > >>> Betreff: Re: Wrapping a FormComponent with a Border > >>> > >>> Hi, > >>> > On Mon, Sep 2, 2019 at 11:13 AM Tom Götz wrote: > > Thanks Ernesto! This example is from 2007 though and uses > compent.setComponentBorder > Is there something more close to current Wicket versions available > >> maybe? > :) > > >>> > >>> I think I have somewhere on a private project something similar > >> implemented > >>> for Wicket 7.x... I can try to dig it up and send classes to you. > >>> > >>> -- > >>> Regards - Ernesto Reinaldo Barreiro - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Wrapping a FormComponent with a Border
Hi, why not add a css class and style it? kind regards Tobias > Am 02.09.2019 um 12:20 schrieb Ernesto Reinaldo Barreiro : > > Another possibility is to do this client side... > >> On Mon, Sep 2, 2019, 11:43 AM "Tom Götz" wrote: >> >> That would be great, thanks in advance! >> >> Tom >> >> >>> Gesendet: Montag, 02. September 2019 um 10:39 Uhr >>> Von: "Ernesto Reinaldo Barreiro" >>> An: users@wicket.apache.org >>> Betreff: Re: Wrapping a FormComponent with a Border >>> >>> Hi, >>> On Mon, Sep 2, 2019 at 11:13 AM Tom Götz wrote: Thanks Ernesto! This example is from 2007 though and uses compent.setComponentBorder Is there something more close to current Wicket versions available >> maybe? :) >>> >>> I think I have somewhere on a private project something similar >> implemented >>> for Wicket 7.x... I can try to dig it up and send classes to you. >>> >>> -- >>> Regards - Ernesto Reinaldo Barreiro >>> >> >> - >> 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: Wrapping a FormComponent with a Border
Another possibility is to do this client side... On Mon, Sep 2, 2019, 11:43 AM "Tom Götz" wrote: > That would be great, thanks in advance! > > Tom > > > > Gesendet: Montag, 02. September 2019 um 10:39 Uhr > > Von: "Ernesto Reinaldo Barreiro" > > An: users@wicket.apache.org > > Betreff: Re: Wrapping a FormComponent with a Border > > > > Hi, > > > > On Mon, Sep 2, 2019 at 11:13 AM Tom Götz wrote: > > > > > Thanks Ernesto! This example is from 2007 though and uses > > > compent.setComponentBorder > > > Is there something more close to current Wicket versions available > maybe? > > > :) > > > > > > > I think I have somewhere on a private project something similar > implemented > > for Wicket 7.x... I can try to dig it up and send classes to you. > > > > -- > > Regards - Ernesto Reinaldo Barreiro > > > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > >
Re: Wrapping a FormComponent with a Border
That would be great, thanks in advance! Tom > Gesendet: Montag, 02. September 2019 um 10:39 Uhr > Von: "Ernesto Reinaldo Barreiro" > An: users@wicket.apache.org > Betreff: Re: Wrapping a FormComponent with a Border > > Hi, > > On Mon, Sep 2, 2019 at 11:13 AM Tom Götz wrote: > > > Thanks Ernesto! This example is from 2007 though and uses > > compent.setComponentBorder > > Is there something more close to current Wicket versions available maybe? > > :) > > > > I think I have somewhere on a private project something similar implemented > for Wicket 7.x... I can try to dig it up and send classes to you. > > -- > Regards - Ernesto Reinaldo Barreiro > - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Wrapping a FormComponent with a Border
Hi, On Mon, Sep 2, 2019 at 11:13 AM Tom Götz wrote: > Thanks Ernesto! This example is from 2007 though and uses > compent.setComponentBorder > Is there something more close to current Wicket versions available maybe? > :) > I think I have somewhere on a private project something similar implemented for Wicket 7.x... I can try to dig it up and send classes to you. -- Regards - Ernesto Reinaldo Barreiro
Aw: Wrapping a FormComponent with a Border
The Border I'd like to use for wrapping my FormComponents is the FormGroup from the wicket-bootstrap project: https://bit.ly/2lmU9cq. So, the user should only care about adding the FormComponent and then I would like to wrap it with this Border ... any ideas? Tom > Gesendet: Montag, 02. September 2019 um 09:22 Uhr > Von: "Tom Götz" > An: users@wicket.apache.org > Betreff: Wrapping a FormComponent with a Border > > Hi there, > > I would like to automatically wrap a FormComponent with a Border whenever it > is added on a certain page. Let's say, a TextField is added, then I'd like to > replace it with Border and add that TextField to the Border. The Border > itself contains other Wicket Components such as a Label and a FeedbackPanel. > I am aware of BorderBehavior, but it seems that this can only be used to wrap > raw HTML around a Component. > Is this possible somehow? > > Cheers > Tom > > - > 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: Wrapping a FormComponent with a Border
Thanks Ernesto! This example is from 2007 though and uses compent.setComponentBorder Is there something more close to current Wicket versions available maybe? :) Tom > Am 02.09.2019 um 09:41 schrieb Ernesto Reinaldo Barreiro : > > Hi, > > Would approach described in [1] match your use case? > > References > > 1- https://www.scribd.com/document/43719247/LondonWicket-FormsWithFlair > >> On Mon, Sep 2, 2019 at 10:22 AM Tom Götz wrote: >> >> Hi there, >> >> I would like to automatically wrap a FormComponent with a Border whenever >> it is added on a certain page. Let's say, a TextField is added, then I'd >> like to replace it with Border and add that TextField to the Border. The >> Border itself contains other Wicket Components such as a Label and a >> FeedbackPanel. I am aware of BorderBehavior, but it seems that this can >> only be used to wrap raw HTML around a Component. >> Is this possible somehow? >> >> Cheers >> Tom >> >> - >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >> For additional commands, e-mail: users-h...@wicket.apache.org >> >> > > -- > Regards - Ernesto Reinaldo Barreiro - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Wrapping a FormComponent with a Border
Hi, Would approach described in [1] match your use case? References 1- https://www.scribd.com/document/43719247/LondonWicket-FormsWithFlair On Mon, Sep 2, 2019 at 10:22 AM Tom Götz wrote: > Hi there, > > I would like to automatically wrap a FormComponent with a Border whenever > it is added on a certain page. Let's say, a TextField is added, then I'd > like to replace it with Border and add that TextField to the Border. The > Border itself contains other Wicket Components such as a Label and a > FeedbackPanel. I am aware of BorderBehavior, but it seems that this can > only be used to wrap raw HTML around a Component. > Is this possible somehow? > > Cheers > Tom > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > > -- Regards - Ernesto Reinaldo Barreiro
Wrapping a FormComponent with a Border
Hi there, I would like to automatically wrap a FormComponent with a Border whenever it is added on a certain page. Let's say, a TextField is added, then I'd like to replace it with Border and add that TextField to the Border. The Border itself contains other Wicket Components such as a Label and a FeedbackPanel. I am aware of BorderBehavior, but it seems that this can only be used to wrap raw HTML around a Component. Is this possible somehow? Cheers Tom - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org