Barcode sample not working

UI Components for JSF
Post Reply
hondus
Posts: 5
Joined: 14 Oct 2014, 16:15

30 Oct 2014, 08:14

Hey,
i just tried to just copy-paste sample from PrimeFaces Showcase about Barcode.
Here is this code, and I get: (i added library primefaces-5.1.jar)

I just wanted to test it go get same effect as sample.

Code: Select all

<html xmlns="http://www.w3.org/1999/xhtml"  
      xmlns:h="http://java.sun.com/jsf/html"  
      xmlns:f="http://java.sun.com/jsf/core" 
      xmlns:pm="http://primefaces.org/mobile"
      xmlns:p="http://primefaces.org/ui">  


    <h:head> 
    </h:head>  

    <h:body>
        <p:panelGrid columns="2">
           
            <h:outputText value="Postnet" />
            <p:barcode value="0123456789" type="postnet"/>

            <h:outputText value="QR" />
            <p:barcode value="0123456789" type="qr"/>
        </p:panelGrid>
    </h:body>  

</html>  
Image

kukeltje
Expert Member
Posts: 9605
Joined: 17 Jun 2010, 13:34
Location: Netherlands

30 Oct 2014, 11:54

Check your logging... Most likely an error in there. And did you also add the barcode jar?

hondus
Posts: 5
Joined: 14 Oct 2014, 16:15

30 Oct 2014, 18:29

Hey, ofc i did mistake and forgot to include .jar files. I added Barcode-4j-light.jar and it's working but to deal with QR codes i needed to include another jar qrgen (1.4) and then i got error wile trying to run project:Image

Without qrgen lib it's running but qrcode not working (looks like images at first post)

hehehehehmeng
Posts: 1
Joined: 09 Nov 2014, 23:25

10 Nov 2014, 12:14

Hi, I'm also having this problem. Have solved it?

User avatar
andyba
Expert Member
Posts: 2473
Joined: 31 Mar 2011, 16:27
Location: Steinfeld, near Bremen/Osnabrück, DE
Contact:

10 Nov 2014, 16:45

hehehehehmeng wrote:Hi, I'm also having this problem. Have solved it?
Please read the forum rules.
Ask your question in a new Thread please.
PF 4.x (Elite versions), PF 5, Pf 5.1, PF 6.0
Glassfish 4.1, Mojarra 2.x, Java 8, Payara 4.1.1.
If you haven't read the forum rules read them now

EufranioDiogo
Posts: 1
Joined: 14 Jun 2023, 02:16

14 Jun 2023, 02:19

I was with this problem, but I solved putting those dependencies to my pom.xml file:

Code: Select all

<dependency>
            <groupId>net.glxn</groupId>
            <artifactId>qrgen</artifactId>
            <version>1.4</version>
        </dependency>
        <dependency>
            <groupId>org.primefaces.extensions</groupId>
            <artifactId>barcode4j-light</artifactId>
            <version>2.3.0</version>
        </dependency>
Hope that could helps

jepsar
Posts: 166
Joined: 03 Sep 2014, 11:41
Location: NL / BE
Contact:

14 Jun 2023, 17:21

Note that the dependencies will not be the same for all PrimeFaces versions. Always consult the documentation.
PrimeFaces Developer | PrimeFaces Extensions Developer
GitHub: https://github.com/jepsar
Spotify: 90s Rave, Acid, Trance, House

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 44 guests