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

  • SEARCH
  • Home
  • 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 8499151
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T00:35:30+00:00 2026-06-11T00:35:30+00:00

I am looking for best-practice guidance on how to implement the following. I am

  • 0

I am looking for best-practice guidance on how to implement the following. I am using JSF2, Spring 3, PrimeFaces 3.3, MyBatis.

REQUIREMENT:

I have a data entry screen with input fields linked to VO object which is a property on the managed bean. The user can either create a new record, or search for existing records to edit.

When the edit an existing record option is selected, a dialog box appears where the user is able to search and retrieve a list of potential records to select from.

They are only able to select one record to edit at a time. Once they have made their selection, the dialog box closes, and the VO object is populated with the selected data ready for the user to edit.

PROBLEM:

When the search form is submitted to retrieve a list of potential records for editing, the VO object has not yet been initialised and causes the ProcessValidationPhase to fail the process with a “Target Unreachable”.

What is the best way to implement this scenario? Should the VO object be initialised with blank values in the managed bean? Or should there be an initialise method on the VO object that is called during the initialisation of the managed bean?

DataEntry.XHTML

The main data entry fields:

            <p:panelGrid id="dataEntry">
                <p:row>
                    <p:column style="width:200px;">
                        <h:outputLabel value="Field 1:"/></p:column>
                    <p:column>
                        <p:inputText value="#{managedBean.dataEntryVo.field1}"
                                     style="width:50px;"
                                     disabled="true"/>
                    </p:column>
                </p:row>

                <p:row>
                    <p:column>
                        <h:outputLabel value="Field 2:"/>
                    </p:column>
                    <p:column>
                        <p:inputText value="#{managedBean.dataEntryVo.field2}"
                                     style="width:50px;"
                                     disabled="true"/>
                    </p:column>
                </p:row>

            </p:panelGrid>

The command button on the dialog box used to retrieve a list of possible records for selection to edit:

            <p:commandButton id="retrieveDataCb"
                            value="Retrieve"
                            actionListener="#{managedBean.retrieveDataEntryList}"
                            update=":dataEntryForm:retrievedList">
            </p:commandButton>

Many thanks

  • 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-11T00:35:32+00:00Added an answer on June 11, 2026 at 12:35 am

    Initialising the search criterion to a dummy object will definitely work. Not very neat but it works. On the other hand, you could try using a data container component like a <p:dataGrid/> or <p:dataTable/>. There is a var attribute that will let you get away with null references like the case that you are trying to achieve. The var attribute compensates for empty datasets. That being said, you can now have a List<DataEntryVo> in your backing bean and then in your view:

    <p:dataGrid id="dataEntry" value="#{managedBean.theVoList}"  var="vo">
                <p:panel>
                   <p:panelGrid>
                    <p:column style="width:200px;">
                        <h:outputLabel value="Field 1:"/>
                    </p:column>
                    <p:column>
                        <p:inputText value="#{vo.field1}" style="width:50px;" disabled"true"/>
                    </p:column>
                      <p:row>
                    <p:column>
                        <h:outputLabel value="Field 2:"/>
                    </p:column>
                    <p:column>
                        <p:inputText value="#{vo.field2}" style="width:50px;" disabled="true"/>
                    </p:column>
                    </p:row>
                    </p:panelGrid>
                </p:panel> 
               </p:dataGrid>
    

    Another alternative, you could avoid binding the input fields to an object in your managed bean altogether, instead binding the input fields to the managed bean directly as in <p:inputText binding="#{vo.field1Input}" style="width:50px;" disabled="true"/> and in your backing bean you will have UIcomponent field1Input = new HtmlInputText(); (or whatever the class is for primefaces and then call field1Input.getValue() or field1Input.setValue() according to your needs. It’s also a good idea to make your bean a ViewScoped bean to avoid unnecessary trouble getting this solution to work.

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

Sidebar

Related Questions

Looking for some best-practice guidance. Let's say I have a line of code like
I am looking for best practice for uploading excel data in Sql server 2000
Looking for a best-practice advice: Let's suppose I have a Account object with limit
Looking for best practice advice on what string substitution technique to use when using
I am looking for best practice of using tab navigation with sherlock actionbar. What
I'm looking at the best practice approach here. I have a web page that
In a way I am looking for best-practice here. I have a common project
I m looking for the best practice to implement a service for logging gps-
I'm looking for a best practice solution.... I have table that holds products called
I'm looking for the best practice to solve the following situation: I've got 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.