Page 2 of 2

Re: Label for toggleSwitch

Posted: 11 Oct 2018, 11:25
by markusg80
Here a sample xhtml:

Code: Select all

<div class="ui-g ui-fluid form-group">
	<div class="ui-g-12 ui-lg-6">
		<h:panelGroup class="toggleswitch-box toggleswitch-box-border" rendered="#{not cc.attrs.editmode}">
			<p:outputLabel for="createexbox" value="#{intl.createexlabel}" />
			<p:toggleSwitch id="createexbox" value="#{cc.attrs.createexercise}" 
							/>
		</h:panelGroup>

	</div>
	<div class="ui-g-12 ui-lg-6">
		<span class="toggleswitch-box toggleswitch-box-border">
			<p:outputLabel for="" value="#{intl.holiday}" />
			<p:toggleSwitch id="holidaybox" value="#{cc.attrs.holidayvalue}" 
							/>
		</span>

	</div>
</div>
@aragorn: Maybe the solution from RueKow can be implemented to Primefaces toggleSwitch with onLabel and offLabel attribute!

Re: Label for toggleSwitch

Posted: 22 Oct 2018, 13:46
by mert.sincan
Thanks a lot for the update, @markusg80 ;) Unfortunately, we don't think of adding it to the core. Please see; viewtopic.php?p=169780#p169780

Best Regards,