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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T20:11:55+00:00 2026-05-21T20:11:55+00:00

In JSF, I have this: <h:selectManyListbox id=createAccountBasicInfo_select_Types styleClass=selectManyCheckbox value=#{party.roles} size=6 converter=persistenceObjectToStringTwoWayConverter> <f:selectItems value=#{accTypes.selectItems} />

  • 0

In JSF, I have this:

<h:selectManyListbox id="createAccountBasicInfo_select_Types"
 styleClass="selectManyCheckbox" value="#{party.roles}" size="6"
 converter="persistenceObjectToStringTwoWayConverter">
      <f:selectItems value="#{accTypes.selectItems}" />
</h:selectManyListbox>

My Converter:

 //[...]
 import javax.faces.convert.Converter;
 //[...]

public class PersistenceObjectToStringJSFConverter implements Converter {
    //[...]

public Object getAsObject(FacesContext context, UIComponent component, String value) {
    Long id = Long.valueOf(value);
    Object object = null;
    try {
        object = getPersistenceService(context).loadByEntityId(id); // here I load the appropriate record
    } catch (CoreException e) {
        e.printStackTrace();
    } catch (ElementCreationException e) {
        e.printStackTrace();
    }
    return object; //here I need to return an ArrayList of the loaded Objects instead of a single object
}
 }

In HTML, I get this:

<select id="form_party:createAccountBasicInfo_select_Types"
 name="form_party:createAccountBasicInfo_select_Types" class="selectManyCheckbox" 
 multiple="multiple" size="6"> 
  <option value="171128">Andere</option>
  <option value="171133">Interessent</option>
  <option value="171130">Kunde</option>
  <option value="171131">Lieferant</option>
  <option value="171134">Mitarbeiter</option>
  <option value="171132">Mitbewerber</option>
  <option value="171129">Partner</option>
</select>

The value of each option is an Id, which I have to load from the database.
An ArrayList of the selected entries will then be given to the WebFlow and then saved to the database.

When I press my “save” button, the selected items run through a Converter, where I need to load the items from the database (by value, ex. “171128”) and add it to an ArrayList, which will be inserted into “party.roles” (check JSF Code).

My problem:
I’m getting the following JSF Exception:

/WEB-INF/page/core/fragments/account/accountBasicInfo.xhtml @152,58 value="#{party.roles}": Property 'roles' not writable on type java.util.List

I think there is a problem with my Converter. What do I have to change?

Thank’s for you anwsers!

(I’m using JSF 1.2)

  • 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-21T20:11:56+00:00Added an answer on May 21, 2026 at 8:11 pm

    The exception is telling that #{party} is actually a java.util.List which in turn indeed doesn’t have a setRoles() method so the #{party.roles} ain’t going to work.

    The #{party} should be a managed bean and it should have a private List<Role> roles property with a getter. The converter should not return a List<Role> on the getAsObject() but it should return Role.

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

Sidebar

Related Questions

I have JSF code like: <h:inputText id=from value=#{fromToMBean.fromName}/> I would like to get this
I have this login.xhtml JSF page: <?xml version=1.0?> <jsp:root version=2.0 xmlns:jsp=http://java.sun.com/JSP/Page xmlns:f=http://java.sun.com/jsf/core xmlns:h=http://java.sun.com/jsf/html> <jsp:directive.page
I have this seemingly-innocent code on my main JSF page: <a4j:outputPanel id=sidebarContainer> <a4j:include viewId=#{UserSession.currentSidebar}/>
I need to have this link: http://myserver:/myproject/innerpage/clip.jsf&id=9099 to extract the id from a code
From now on, I have this : ..... <a4j:commandButton action=#{ChoixContratBean.Submit1} reRender=suite value=valider > </a4j:commandButton>
Let's say I have this action in a JSF Managed Bean: public String doSomething()
Background: I have a JSF 2.0 application using MyFaces. Using this application, the users
As a java web applications developer I have used this last year JSF (SUN)
I have this JSF page trying to load a GWT app. The page works
Using jsf 1.2, hibernate, richfaces 3.3.0GA and facelets. I have this code in my

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.