validation error value is required !!

UI Components for JSF
Post Reply
AmineS
Posts: 16
Joined: 14 Jun 2013, 10:53

02 Aug 2013, 12:27

Hi everybody , please help , when i use the selectonemenu , i have this error j_idt:j_idt11 Validation error value is required , and i don't know what's the problem :

here is my code :

Code: Select all

 <h:panelGrid columns="4" cellpadding="10"> 
                            <h:selectOneMenu  value="#{candsBean.recs.comp1}" effect="fade"    >  
                                <f:selectItem itemLabel="Select One" itemDisabled="true" />  
                                <f:selectItems value="#{competenceBean.competences}" var="competence" itemLabel="#{competence.titre}" itemValue="#{competence.titre}"     />  
                            </h:selectOneMenu>

                            <div style="width:20px">       <h:selectOneMenu  immediate="true" id="nivcom1"  value="#{candsBean.recs.nivcomp1}"  >  
                                     <f:selectItem itemLabel="Niveau" itemValue="" /> 
                                    <f:selectItem itemLabel="Assez bien" itemValue="Assez Bien" />  
                                    <f:selectItem itemLabel="Bien" itemValue="Bien" /> 
                                    <f:selectItem itemLabel="Très Bien" itemValue="Très Bien" /> 
                                </h:selectOneMenu>>  </div>

                        </h:panelGrid> 
                        <br/>
                        
                        
                        <h:panelGrid columns="4" cellpadding="10"> 
                            <h:selectOneMenu  value="#{candsBean.recs.comp2}" effect="fade"    >  
                                <f:selectItem itemLabel="Select One" itemValue="" />  
                                <f:selectItems value="#{competenceBean.competences}" var="competence" itemLabel="#{competence.titre}" itemValue="#{competence.titre}"     />  
                            </h:selectOneMenu>

                            <div style="width:20px">       <h:selectOneMenu  immediate="true" id="nivcom2"  value="#{candsBean.recs.nivcomp2}">   
                                     <f:selectItem itemLabel="Niveau" itemValue="" /> 
                                    <f:selectItem itemLabel="Assez bien" itemValue="Assez Bien" />  
                                    <f:selectItem itemLabel="Bien" itemValue="Bien" /> 
                                    <f:selectItem itemLabel="Très Bien" itemValue="Très Bien" /> 
                                </h:selectOneMenu> </div>

                        </h:panelGrid> 

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

02 Aug 2013, 12:45

Possibly you need to supply an item value for the dummy selectItem?

Please remember that this is a PrimeFaces forum and you aren't using it in your code.
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

AmineS
Posts: 16
Joined: 14 Jun 2013, 10:53

02 Aug 2013, 12:51

i used the same component with <p:selectonemenu> and i have the same error , What is the error in your opinion ?

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

02 Aug 2013, 12:51

andyba wrote:Possibly you need to supply an item value for the dummy selectItem?

AmineS
Posts: 16
Joined: 14 Jun 2013, 10:53

02 Aug 2013, 12:55

i delete the dummy selectitem and the problem persists

AmineS
Posts: 16
Joined: 14 Jun 2013, 10:53

02 Aug 2013, 13:15

it works now , i changed the code by :

Code: Select all

 <h:panelGrid columns="4" cellpadding="10"> 
                            <h:selectOneMenu  value="#{candsBean.recs.comp1}" effect="fade"    >  
                                <f:selectItem itemLabel="Select One" itemDisabled="true" />  
                                <f:selectItems value="#{competenceBean.competences}" var="competence" itemLabel="#{competence.titre}" itemValue="#{competence.titre}"     />  
                            </h:selectOneMenu>

                            <div style="width:20px">       <h:selectOneMenu value="#{candsBean.recs.nivcomp1}"   >  
                                            <f:selectItem itemLabel="" itemValue="" />  
                                        <f:selectItem itemLabel="AssezBien" itemValue="AssezBien" />  
                                        <f:selectItem itemLabel="Bien" itemValue="Bien" />  
                                        <f:selectItem itemLabel="TresBien" itemValue="TresBien" /> 
                                    </h:selectOneMenu>    </div>

                        </h:panelGrid> 

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

02 Aug 2013, 16:34

great that it works... can you also mention what you changed, so others don't have to compare your posts

thanks in advance

heather_p
Posts: 10
Joined: 29 Aug 2016, 15:55

29 Jun 2023, 19:03

I had a similar issue. I was getting an error dialog saying: "Validation Error: value is required j_idt:j_idt3". It only occurred on the second click of "submit" button.

SOLUTION:
This occurred because I had changed

Code: Select all

<o:viewParam required="true" name="id" value="${mybean.myval}" converter="javax.faces.Integer" />
to

Code: Select all

<f:viewParam required="true" name="id" value="${mybean.myval}" converter="javax.faces.Integer" />
Changing it back to o:viewParam solved it.

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 15 guests