• Settings
    • Locale
    • Change the locale of the datepicker, schedule and client side validation messages.

      Language
      English
      English
      English
      French
      German
      German
      German
      Italian
      Korean
      Spanish
      Catalan
      Dutch
      Portuguese
      Portuguese
      Arabic
      Arabic
      Bulgarian
      Bangla
      Bosnian
      Czech
      Greek
      Estonian
      Persian
      Finnish
      Danish
      Hindi
      Indonesian
      Icelandic
      Croatian
      Japanese
      Hungarian
      Hebrew
      Georgian
      Central Kurdish
      Khmer
      Kyrgyz
      Kazakh
      Lithuanian
      Latvian
      Malay
      Norwegian
      Polish
      Romanian
      Russian
      Slovak
      Slovenian
      Serbian
      Serbian
      Swedish
      Thai
      Turkish
      Ukrainian
      Uzbek
      Vietnamese
      Chinese
      Chinese
  • Resources

QRCode

QRCode dynamically generates QR codes with options such as rendering mode, color, size and more. Based on jQuery.qrcode by Lars Jung.

QrCode Tag Documentation

Generate QR codes dynamically

NameTypeRequiredDefaultDescription
id String false generated Unique identifier of the component in a namingContainer.
rendered boolean false true Boolean value to specify the rendering of the component, when set to false component will not be rendered.
binding UIComponent false generated An EL expression referring to a server side UIComponent instance in a backing bean.
widgetVar String false generated ('widget_' + componentClientId) Name of the client side widget.
background String false Background color.
converter Converter false EL expression resolves to a converter instance or literal converter ID defining a component converter.
ecLevel String false L Error correction level.
fillColor String false Fill color.
fontColor String false Label font color.
fontName String false Label font name.
label String false Label text.
labelPosX Double false 0.5 Label X position.
labelPosY Double false 0.5 Label Y position.
labelSize Double false 0.1 Label font size.
leftOffset int false 0 Left offset.
maxVersion int false 40 Maximum QR version.
minVersion int false 1 Minimum QR version.
quiet Double false 0.0 Quiet zone size.
radius Double false 0 Corner radius.
renderMethod String false Rendering method.
renderMode Integer false 0 Rendering mode.
size int false 200 Size in pixels.
style String false Inline style of the component.
styleClass String false Style class of the component.
text String false QR content text.
topOffset int false 0 Top offset.
value Object false Value of the component.
Tag Documentation Widget Source
Simple Usage

Play with the option values and click update to generate the QR code.

Render method:
Render mode:
Size:
Fill color:

Usage


<div class="card">
    <h5>Simple Usage</h5>
    <p>Play with the option values and click <i>update</i> to generate the QR code.</p>
    <h:form id="formBasicUsage">
        <h:panelGrid columns="2" style="margin-bottom:10px" cellpadding="5">
            <h:outputText value="Render method: "/>
            <p:selectOneButton value="#{qrCodeController.renderMethod}">
                <f:selectItem itemLabel="canvas" itemValue="canvas"/>
                <f:selectItem itemLabel="image" itemValue="img"/>
                <f:selectItem itemLabel="div" itemValue="div"/>
            </p:selectOneButton>
            <h:outputText value="Render mode:"/>
            <p:selectOneButton value="#{qrCodeController.mode}">
                <f:selectItem itemLabel="normal" itemValue="0"/>
                <f:selectItem itemLabel="label strip" itemValue="1"/>
                <f:selectItem itemLabel="label box" itemValue="2"/>
                <f:selectItem itemLabel="image strip" itemValue="3"/>
                <f:selectItem itemLabel="image box" itemValue="4"/>
            </p:selectOneButton>
            <h:outputText value="Size:"/>
            <h:panelGrid columns="1">
                <h:inputHidden id="txt2" value="#{qrCodeController.size}"/>
                <p:slider minValue="50" maxValue="500" for="txt2" style="width:200px"/>
            </h:panelGrid>
            <h:outputText value="Fill color:"/>
            <p:colorPicker value="#{qrCodeController.fillColor}"/>

            <p:commandButton value="update" update="qrCodeElem"/>
        </h:panelGrid>

        <p:divider/>

        <pe:qrCode id="qrCodeElem"
                   renderMethod="#{qrCodeController.renderMethod}"
                   renderMode="#{qrCodeController.mode}"
                   text="#{qrCodeController.text}"
                   label="#{qrCodeController.label}"
                   size="#{qrCodeController.size}"
                   fillColor="#{qrCodeController.fillColor}"
                   fontName="Ubuntu"
                   fontColor="#01A9DB"
                   ecLevel="H"
                   radius="0.5"/>
    </h:form>
</div>