You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Bertrand Guay-Paquet <be...@step.polymtl.ca> on 2013/12/17 18:02:18 UTC

Radios and checkboxes with Bootstrap

Hello,

I'm using Bootstrap for form styling which expects radio choices and 
checkboxes in one of these forms:

<label class="radio-inline"><input type="radio">An inline radio<label>

<div class="checkbox">
<label><input type="checkbox">A stacked checkbox</label>
</div>


Using Wicket's built-in components, the rendered html is in this form:
<input type="radio" id="a"><label for="a">Radio label</label>

which doesn't work with Bootstrap's stylesheets. I could override the 
appendOptionHtml() methods of RadioChoice and CheckBoxMultipleChoice but 
I was wondering if any better solutions exist to achieve the desired 
markup structure. I'm sure I'm not the only one using Bootstrap so which 
solutions have you used?

Regards,
Bertrand

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Radios and checkboxes with Bootstrap

Posted by Bertrand Guay-Paquet <be...@step.polymtl.ca>.
Hi,

Ok I'll have a look at RadioGroup + Radio. Radio has a note in its 
javadoc about its stateful nature so I'll need to take care.

@Gabriel: I'm not actually using wicket-boostrap. Just Wicket and 
Bootstrap integrated with other libs in a home-made solution. I think it 
would be best if someone actually using this project opens the ticket 
because I won't be able to test it with my current app. Thanks for your 
message anyway!

Thanks,
Bertrand


On 17/12/2013 3:12 PM, Martin Grigorov wrote:
> Hi,
>
> You can use RadioGroup + Radio components instead and have better control
> on the markup.
>
> Martin Grigorov
> Wicket Training & Consulting
>
>
> On Tue, Dec 17, 2013 at 7:02 PM, Bertrand Guay-Paquet <
> bernie@step.polymtl.ca> wrote:
>
>> Hello,
>>
>> I'm using Bootstrap for form styling which expects radio choices and
>> checkboxes in one of these forms:
>>
>> <label class="radio-inline"><input type="radio">An inline radio<label>
>>
>> <div class="checkbox">
>> <label><input type="checkbox">A stacked checkbox</label>
>> </div>
>>
>>
>> Using Wicket's built-in components, the rendered html is in this form:
>> <input type="radio" id="a"><label for="a">Radio label</label>
>>
>> which doesn't work with Bootstrap's stylesheets. I could override the
>> appendOptionHtml() methods of RadioChoice and CheckBoxMultipleChoice but I
>> was wondering if any better solutions exist to achieve the desired markup
>> structure. I'm sure I'm not the only one using Bootstrap so which solutions
>> have you used?
>>
>> Regards,
>> Bertrand
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Radios and checkboxes with Bootstrap

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

You can use RadioGroup + Radio components instead and have better control
on the markup.

Martin Grigorov
Wicket Training & Consulting


On Tue, Dec 17, 2013 at 7:02 PM, Bertrand Guay-Paquet <
bernie@step.polymtl.ca> wrote:

> Hello,
>
> I'm using Bootstrap for form styling which expects radio choices and
> checkboxes in one of these forms:
>
> <label class="radio-inline"><input type="radio">An inline radio<label>
>
> <div class="checkbox">
> <label><input type="checkbox">A stacked checkbox</label>
> </div>
>
>
> Using Wicket's built-in components, the rendered html is in this form:
> <input type="radio" id="a"><label for="a">Radio label</label>
>
> which doesn't work with Bootstrap's stylesheets. I could override the
> appendOptionHtml() methods of RadioChoice and CheckBoxMultipleChoice but I
> was wondering if any better solutions exist to achieve the desired markup
> structure. I'm sure I'm not the only one using Bootstrap so which solutions
> have you used?
>
> Regards,
> Bertrand
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: Radios and checkboxes with Bootstrap

Posted by Gabriel Landon <gl...@piti.pf>.
Bertrand,

I'm sure that we can add a new BootstrapRadioChoice in the wicket-bootstrap
project.
Can you please open a ticket here :
https://github.com/l0rdn1kk0n/wicket-bootstrap/issues?state=open

And if you can do a PR that would be great.

Regards,

Gabriel.



--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Radios-and-checkboxes-with-Bootstrap-tp4663075p4663076.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org