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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T21:31:19+00:00 2026-06-05T21:31:19+00:00

My problem is with Rich Faces 4.1.0 picklist. I have the item working in

  • 0

My problem is with Rich Faces 4.1.0 picklist. I have the item working in that I can populate the left and right sides. I can’t get the data from the right hand side (i.e. employeeBean.target), I don’t know why. Could someone please look at this code and advise me where I may have gone wrong.

View:

<rich:panel style="width:560px;">
            <h:form>
                <rich:pickList value="#{employeeBean.target}" var="emp" id="picklist"
                               sourceCaption="Available" targetCaption="Selected"
                               orderable="false"  converter="employeeConverter">
                    <f:selectItems value="#{employeeBean.source}" var="employee" itemValue="#{employee}" />
                    <f:converter converterId="employeeConverter" />
                </rich:pickList>
            </h:form>
            jobcardBean bean = #{employeeBean.target}
        </rich:panel>

Controller:

    @ManagedBean
@ViewScoped
public class EmployeeBean implements Serializable {

    private static final long serialVersionUID = 1L;
    List<Employee> source;
    List<Employee> target;

    public EmployeeBean() {
    }

    public List<Employee> getSource() {
        return new DatabaseBean().getAllEmployees();
    }

    public void setSource(List<Employee> source) {
        this.source = source;
    }

    public List<Employee> getTarget() {
        return target;
    }

    public void setTarget(List<Employee> target) {
        this.target = target;
    }

/***********************************/

    @FacesConverter(value = "employeeConverter")
public class EmployeeConverter implements Converter {

    @Override
    public Object getAsObject(FacesContext context, UIComponent component, String submittedValue) {
        if (submittedValue.trim().equals("")) {
            return null;
        } else {
            return submittedValue.toString();
        }
    }

    @Override
    public String getAsString(FacesContext context, UIComponent component, Object value) {
        if (value == null || value.equals("")) {
            return "";
        } else {
            return String.valueOf(((Employee) value));
        }
    }
}

Model:

public String toString() {
    return getName() + " " + getSurname();
}

@Override
public boolean equals(Object obj) {
    if (obj == null) {
        return false;
    }
    if (!(obj instanceof Employee)) {
        return false;
    }

    return ((Employee) obj).getName() == this.name && ((Employee) obj).getSurname() == this.surname;
}

@Override
public int hashCode() {
    int hash = 1;
    return hash * 31 + name.hashCode();
}
  • 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-05T21:31:21+00:00Added an answer on June 5, 2026 at 9:31 pm

    My trouble lay with my converter. The getAsObject as it stands here takes in a string and passes out a string. The method will compile but not do anything useful. I fixed this by getting getAsObject to return my model bean object and not just a string.

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

Sidebar

Related Questions

Problem: I have a table that prints out vertical but I would like it
I have a problem with showing a <rich:modalPanel> more than once. I have a
This is the code: <h:panelGrid columns=3 style=margin-left: auto; margin-right:auto;> <f:facet name=header> <rich:column colspan=2> <h:outputText
I'm using the component rich:fileUpload for uploading files to my server the problem is
Problem: Been struggling to get my code to load external shaders and it is
I have a strange problem which I have been trying to fix for some
I believe my problem is in a settings file somewhere, but I have no
I have a JSF 1.2 application (Sun RI, Facelets, Richfaces) that was used only
I have problem with richfaces calendar. I want to see only year and month
I have the following RichFaces (3.3.3) : <rich:calendar id="richCal1" value="#{user.CreateDate}" popup="true" mode="client" inputSize="20" datePattern="dd/M/yyyy

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.