Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8792319
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T22:57:46+00:00 2026-06-13T22:57:46+00:00

Requirement is to skip field validation conditionally. When user selects add, the form fields

  • 0

Requirement is to skip field validation conditionally. When user selects add, the form fields should be validated and values added to the table.
If edit is clicked, form field validation should be skipped but bean values should be copied to the input fields.

<composite:nameInput id="name" value="#{buyer.name}" 
  disableBeanValidation ="#{param['skipBeanValidation']}"/>
<h:commandLink action="#{buyerBacking.cancelEdit}" value="cancel"/>

 <h:dataTable value="#{bean.list}">
    <h:commandLink value="Edit" action="#{buyerBacking.edit}">
     <f:param name="skipBeanValidation" value="true" /> 
    </h:commandLink>
 </h:dataTable>

   <h:commandLink id="add" action="#{buyerBacking.add}"/>

Name Input composite component

<h:inputText id="fName" value="#{bean.fname}">
     <f:validateBean disabled="#{cc.attrs. disableBeanValidation}"/>
</h:inputText>

If user enter’s details and selects add, the details are added to the table.
If validation errors, we display the error message.

Then user selects edit, the values are copied to the input fields.
User selects cancel edit, the values are removed from the input fields.
If user selects edit again, we get a index out of bound exception error. Index out of bound exception for name_firstName.

But this does not occur if user selects add and cancel edit is selected.
Does it has to do with the view parameter being passed which is null somehow?

javax.faces.FacesException: Unexpected error restoring state for component with id frmAddAuthBuyerBR_inpAuthBuyerBRName_prefix_input. Cause: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0.
at com.sun.faces.application.view.StateManagementStrategyImpl$2.visit(StateManagementStrategyImpl.java:272)
at com.sun.faces.component.visit.FullVisitContext.invokeVisitCallback(FullVisitContext.java:151)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1612)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1626)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1626)
at javax.faces.component.UINamingContainer.visitTree(UINamingContainer.java:163)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1626)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1626)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1626)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1626)
at javax.faces.component.UINamingContainer.visitTree(UINamingContainer.java:163)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1626)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1626)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1626)
at javax.faces.component.UIForm.visitTree(UIForm.java:371)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1626)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T22:57:47+00:00Added an answer on June 13, 2026 at 10:57 pm

    Your code is incomplete as you’re nowhere showing how disableBeanValidation is implemented and how you’re passing the #{param[skipBeanValidation]} around.

    But it should basically boil down to:

    <f:validateBean disabled="#{param.skipBeanValidation}" />
    
    ...
    
    <h:commandLink value="Edit" action="#{buyerBacking.edit}"/>
        <f:param name="skipBeanValidation" value="true" />
    </h:commandLink>
    

    Please note that #{param.skipBeanValidation} is quite different from #{param[skipBeanValidation]} (but the same as #{param['skipBeanValidation']}). Also please note that the desired request parameter to skip the bean validation is been passed as a HTTP request parameter, exactly as is been expected by #{param}.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Requirement is like: I want to take input values from user in frame but
The requirement is when i click on a text field, a table has to
There is a requirement in Section 508 to code a Skip Navigation at the
Requirement : Should update MySQL database with that of MS Sql Server updates which
requirement is, both field must be equal, what would you do declare @var datetime
My Requirement is whenever I click on the Extension Icon that should send a
requirement is to transfer all inserted records to one table to another. i've used
Requirement : To find out which phone the user is using by parsing the
Requirement is to render a component outside the form after an ajax call. I
Requirement: I'd like a jQuery autocomplete element that allows the user to pick an

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.