-1

i'm getting an error in xhtml.. the code is:

<h:form>
  <h:panelGrid columns="2">
    <h:outputLabel value="Name:" />
    <h:inputText value="#{newAuctionWizard.auction.name}" />

    <h:outputLabel value="Description:" />
    <h:inputTextarea value="#{newAuctionWizard.auction.description}" />

    <p:outputLabel for="category" value="Categories from which to pick:" />
    <p:selectOneRadio id="category" value="#{newAuctionWizard.auction.category}"  
     layout="grid" columns="3">
      <f:selectItems value="#{newAuctionWizard.auction.categories}" 
       var="c" itemLabel="#{category}" itemValue="#{category}"/>
    </p:selectOneRadio>

    <h:commandButton value="Cancel" action="#{newAuctionWizard.cancel()}" />    
    <h:commandButton value="Details" action="newAuctionDetails" />  
  </h:panelGrid>

the error appeared after including this section:

 <p:outputLabel for="category" value="Categories from which to pick:" />
   <p:selectOneRadio id="category" value="#{newAuctionWizard.auction.category}"  
   layout="grid" columns="3">
     <f:selectItems value="#{newAuctionWizard.auction.categories}" var="c"
      itemLabel="#{category}" itemValue="#{category}"/>
   </p:selectOneRadio>

i've added the namespace for p element but still cannot include it in the panelGrid.. can someone tell me what i am doing wrong ? the error is:

2017-02-07 14:52:12,275 ERROR [org.jboss.as.controller.management-operation] (DeploymentScanner-threads - 2) WFLYCTL0013: Operation ("deploy") failed - address: ([("deployment" => "auctioner-0.0.1-SNAPSHOT.war")]) - failure description: {"WFLYCTL0080: Failed services" => {"jboss.persistenceunit.\"auctioner-0.0.1-SNAPSHOT.war#auctionPersistenceUnit\"" => "org.jboss.msc.service.StartException in service jboss.persistenceunit.\"auctioner-0.0.1-SNAPSHOT.war#auctionPersistenceUnit\": javax.persistence.PersistenceException: [PersistenceUnit: auctionPersistenceUnit] Unable to build Hibernate SessionFactory
Caused by: javax.persistence.PersistenceException: [PersistenceUnit: auctionPersistenceUnit] Unable to build Hibernate SessionFactory
Caused by: org.hibernate.MappingException: Could not determine type for: java.util.List, at table: AUCTION, for columns: [org.hibernate.mapping.Column(categories)]"}}
6
  • Your title states you get an 'error' (title is too generic) but you don not even post WHAT error in your text. That way it is impossible to help (and suspicious upvoting here)
    – Kukeltje
    Commented Feb 7, 2017 at 12:59
  • what is the error?? Commented Feb 7, 2017 at 13:02
  • i've done editing now..sorry:)
    – DaianaB
    Commented Feb 7, 2017 at 13:21
  • you are referencing in value a list of categories, and that does not exist in auction, see my answer. Commented Feb 7, 2017 at 13:25
  • they are in auction.. private List<String> + getters and setters
    – DaianaB
    Commented Feb 7, 2017 at 13:31

1 Answer 1

0

According to your question the error appears when you try to add selectOneRadio, you are using c as var and then you put category as itemLabel, and that is wrong, var is used to reference the object you are showing in f:selectItems, so to define the labels you have to use var, something like this :

itemLabel="#{c}"
itemValue="#{c}"

and value should be a list of categories you define, and fill it in the managedBean :

value="#{newAuctionWizard.categories}"

check primefaces : http://www.primefaces.org/showcase/ui/input/oneRadio.xhtml

10
  • done.. it says now: New missing/unsatisfied dependencies: service jboss.deployment.unit."auctioner-0.0.1-SNAPSHOT.war".WeldBootstrapService (missing) dependents: [service jboss.deployment.unit."auctioner-0.0.1-SNAPSHOT.war".component.AuctionManagerImpl.WeldInterceptorBindingsService, service jboss.deployment.unit."auctioner-0.0.1-SNAPSHOT.war".component.NewAuctionWizard.WeldInstantiator, service jboss.deployment.unit."auctioner-0.0.1-SNAPSHOT.war".component.UserManagerImpl.WeldInstantiator, service
    – DaianaB
    Commented Feb 7, 2017 at 13:35
  • this log has nothing to do with the selectOneRadio Commented Feb 7, 2017 at 13:39
  • you have to put itemLabel="#{c}" itemValue="#{c}", and make sure that auction.category is a String Commented Feb 7, 2017 at 13:41
  • done.. now it says: 2017-02-07 15:48:01,479 INFO [org.jboss.as.repository] (ServerService Thread Pool -- 60) WFLYDR0011: Couldn't list directory files for C:\Users\user\Downloads\wildfly-10.0.0.Final (1)\wildfly-10.0.0.Final\standalone\data\content ... really dont know what's happening
    – DaianaB
    Commented Feb 7, 2017 at 13:49
  • yeah, sorry.. it says: SNAPSHOT.war#auctionPersistenceUnit\": javax.persistence.PersistenceException: [PersistenceUnit: auctionPersistenceUnit] Unable to build Hibernate SessionFactory Caused by: javax.persistence.PersistenceException: [PersistenceUnit: auctionPersistenceUnit] Unable to build Hibernate SessionFactory Caused by: org.hibernate.MappingException: Could not determine type for: java.util.List, at table: AUCTION, for columns: [org.hibernate.mapping.Column(categories)]"}}
    – DaianaB
    Commented Feb 7, 2017 at 14:13

Not the answer you're looking for? Browse other questions tagged or ask your own question.