You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by David Beer <da...@gmail.com> on 2013/10/13 13:25:50 UTC

wicket-bootstrap3 FormControl Position the Label

Hi Guys

I am using the wicket-bootstrap3 FormGroup and provide a Model for the in
built Label that gets added. My Problem is how to apply the relevant
formatting and spacing on the item. So according to the bootstrap3 examples
my HTML should look like the following resulting markup.

<div class="form-group">
    <label for="inputEmail1" class="col-lg-2 control-label">Email</label>
    <div class="col-lg-10">
      <input type="email" class="form-control" id="inputEmail1"
placeholder="Email">
    </div>
  </div>

Where label should have the class col-lg-2 or similar col definition hw
could I add this.

Thanks

David

Re: wicket-bootstrap3 FormControl Position the Label

Posted by David Beer <da...@gmail.com>.
Hi Martin

Thanks for this I new there was a way of doing this. For some reason
couldn't see it works great thanks.

David


On 13 October 2013 12:36, Martin Grigorov <mg...@apache.org> wrote:

> Hi,
>
> Override
> de.agilecoders.wicket.core.markup.html.bootstrap.form.FormGroup#newLabel
> :
> Label label = new Label(id, model);
> label.add(AttributeModifier.append("col-lg-2"));
> return label;
>
>
> or:
> formGroup.get("label")..add(AttributeModifier.append("col-lg-2"));
>
>
> On Sun, Oct 13, 2013 at 2:25 PM, David Beer <da...@gmail.com>
> wrote:
>
> > Hi Guys
> >
> > I am using the wicket-bootstrap3 FormGroup and provide a Model for the in
> > built Label that gets added. My Problem is how to apply the relevant
> > formatting and spacing on the item. So according to the bootstrap3
> examples
> > my HTML should look like the following resulting markup.
> >
> > <div class="form-group">
> >     <label for="inputEmail1" class="col-lg-2 control-label">Email</label>
> >     <div class="col-lg-10">
> >       <input type="email" class="form-control" id="inputEmail1"
> > placeholder="Email">
> >     </div>
> >   </div>
> >
> > Where label should have the class col-lg-2 or similar col definition hw
> > could I add this.
> >
> > Thanks
> >
> > David
> >
>

Re: wicket-bootstrap3 FormControl Position the Label

Posted by Martin Grigorov <mg...@apache.org>.
Hi,

Override de.agilecoders.wicket.core.markup.html.bootstrap.form.FormGroup#newLabel
:
Label label = new Label(id, model);
label.add(AttributeModifier.append("col-lg-2"));
return label;


or:
formGroup.get("label")..add(AttributeModifier.append("col-lg-2"));


On Sun, Oct 13, 2013 at 2:25 PM, David Beer <da...@gmail.com> wrote:

> Hi Guys
>
> I am using the wicket-bootstrap3 FormGroup and provide a Model for the in
> built Label that gets added. My Problem is how to apply the relevant
> formatting and spacing on the item. So according to the bootstrap3 examples
> my HTML should look like the following resulting markup.
>
> <div class="form-group">
>     <label for="inputEmail1" class="col-lg-2 control-label">Email</label>
>     <div class="col-lg-10">
>       <input type="email" class="form-control" id="inputEmail1"
> placeholder="Email">
>     </div>
>   </div>
>
> Where label should have the class col-lg-2 or similar col definition hw
> could I add this.
>
> Thanks
>
> David
>