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 7044329
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T02:23:49+00:00 2026-05-28T02:23:49+00:00

I have a data entry form where user enters lots of data. When user

  • 0

I have a data entry form where user enters lots of data. When user comes to the page to view existing data, the page should be displayed in read-only mode (all values shown as text), when he clicks ‘Edit’ button, normal form with all input controls should be shown so that user can change and save data.

We are using JSF 2.0 with PrimeFaces library. It is easy to achieve above behavior for text box and text area but not for Checkbox, multi-select, radio,….. controls. Is there any easy way available to achieve above behavior rather than writing our own code (which may run into lot of lines thus making backing bean code ugly)

Thanks for your help…

  • 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-05-28T02:23:49+00:00Added an answer on May 28, 2026 at 2:23 am

    I’m not sure why you think that you need additional backing bean code for this. You’ve all the needed values in the backing bean already. Your problem is more in the presentation of those values. Just display them in the desired format by writing the view code accordingly. Perhaps you were thinking it too the hard way.

    Instead of a select boolean checkbox, you could display for example a “Yes” or “No” value.

    <h:selectBooleanCheckbox value="#{bean.checked}" rendered="#{bean.edit}" />
    <h:outputText value="#{bean.checked ? 'Yes' : 'No'}" rendered="#{not bean.edit}" />
    

    Instead of a select one menu/radio, you could just display the value in an output text.

    <h:selectOneMenu value="#{bean.selectedItem}" rendered="#{bean.edit}">
        <f:selectItems value="#{data.availableItems}" />
    </h:selectOneMenu>
    <h:outputText value="#{bean.selectedItem}" rendered="#{not bean.edit}" />
    

    Instead of a select many listbox/checkbox, you could just display for example all values comma separated in a loop.

    <h:selectManyListbox value="#{bean.selectedItems}" rendered="#{bean.edit}">
        <f:selectItems value="#{data.availableItems}" />
    </h:selectManyListbox>
    <h:panelGroup rendered="#{not bean.edit}">
        <ui:repeat value="#{bean.selectedItems}" var="selectedItem" varStatus="loop">
            #{selectedItem}#{not loop.last ? ', ' : ''}
        </ui:repeat>
    </h:panelGroup>
    

    You could wrap it all in a tag file or a composite to minimize boilerplate and code repetition.

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

Sidebar

Related Questions

Folks, I have an MVC3 data entry form scenario that involves asking the user
I'm developing an ASP.NET form for data-entry. Users have to select a client from
I have this big data-entry sort of page, a table kind of layout using
I have a PHP form that enters data into my MySQL database. My primary
I have a form that is used for data entry, and on one form
I have a custom data entry form which is bound to a ViewModel (VM).
I have a WinForms data entry form that will have upwards of 1500 questions.
I have data entry form like... Data Entry Form http://img192.imageshack.us/img192/2478/inputform.jpg There are some empty
I have a simple form that dynamically presents a data entry form, and the
I have a form with 3 tabs: one tab is for user entry and

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.