New component: CodeScanner

Community Driven Extensions Project
Post Reply
jepsar
Posts: 166
Joined: 03 Sep 2014, 11:41
Location: NL / BE
Contact:

05 Mar 2021, 18:14

This component was added a while ago, but not yet announced here.

https://www.primefaces.org/showcase-ext ... canner.jsf

Scans QR and barcodes.

Code: Select all

    <pe:codeScanner width="600"
                    height="400">
        <p:ajax event="codeScanned" listener="#{codeScannerController.onCodeScanned}"/>
    </pe:codeScanner>

Code: Select all

    public void onCodeScanned(final SelectEvent<Code> event) {
        final Code code = event.getObject();
        FacesContext.getCurrentInstance().addMessage(
                    null,
                    new FacesMessage(FacesMessage.SEVERITY_INFO,
                                String.format("Scanned: %s (%s)", code.getValue(), code.getFormat()),
                                null));
    }
PrimeFaces Developer | PrimeFaces Extensions Developer
GitHub: https://github.com/jepsar
Spotify: 90s Rave, Acid, Trance, House

Post Reply

Return to “Extensions”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 11 guests