0

How do I place the itemLabel for the primefaces TriStateCheckbox on the left side of the checkbox instead of the default right position.

enter image description here

<p:triStateCheckbox value="#{handler.readyFlag}" 
        itemLabel="#{labels.aktiv}"
        converter="triStateConverter">
                <p:ajax event="change" update="workflowEventTbl"
                        listener="#{handler.createDataModel}"
                        partialSubmit="true"/>
</p:triStateCheckbox>

Workaround: I can put a label in front of it, but then it is not "clickable" like the label on the TriStateCehckbox

<h:outputText value="#{labels.aktiv}"/>
<p:triStateCheckbox value="#{handler.readyFlag}"
    converter="triStateConverter">
        <p:ajax event="change" update="workflowEventTbl"
                listener="#{handler.createDataModel}"
                partialSubmit="true"/>
</p:triStateCheckbox> 
LStrike
  • 1,598
  • 4
  • 26
  • 58

1 Answers1

3

You could create CSS rule to float to label to the left. For example:

html .ui-chkbox .ui-chkbox-label {
  float: left;
}

Of course you could add a style class to your p:triStateCheckbox and create a more specific rule.

See also:

Jasper de Vries
  • 19,370
  • 6
  • 64
  • 102