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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T15:40:34+00:00 2026-05-29T15:40:34+00:00

I have been trying to solve this problem all day, I googled a lot,

  • 0

I have been trying to solve this problem all day, I googled a lot, I found answers but I can not understand why this is not working for me, I tried everything that I thought.

I have primefaces selectOneListbox:

    <p:selectOneListbox id="idCrawledDataSelectMenu"
            required="true"
            value="#{crawlerCorpusTreatmentBean.corpusId}"
            converter="crawledDataConverter"
            style="height: 200px; width: 500px;">
<f:selectItems id="idCrawledDataItems"
           value="#{crawlerCorpusTreatmentBean.crawledDataList}"
           var="crawledData"
           itemLabel="#{crawledData.url}"
           itemValue="#{crawledData}"/>
</p:selectOneListbox>

I have a converter:

@FacesConverter(value = "crawledDataConverter")
public class CrawledDataConverter implements Converter {

    @Override
    public Object getAsObject(FacesContext facesContext, UIComponent uiComponent, String s) {
        return s;
    }

    @Override
    public String getAsString(FacesContext facesContext, UIComponent uiComponent, Object o) {
        if (o instanceof CrawlerCorpusData) {
            CrawlerCorpusData data = (CrawlerCorpusData) o;
            return data.getId();
        }
        return null;
    }
}

I there is my managed bean where I form my crawledDataList object.

@ManagedBean(name="crawlerCorpusTreatmentAction")
@RequestScoped
public class CrawlerCorpusTreatmentAction extends BaseAction implements Serializable {

    /**
     * Logger.
     */
    private static final Logger LOGGER = LoggerFactory.getLogger(CrawlerCorpusTreatmentAction.class);

    /**
     * Processes continue action of crawled corpus treatment request.
     *
     * @return success if action was success, otherwise - failure
     */
    public String processContinue() {
        CrawlerCorpusTreatmentBean corpusTreatmentBean = getBean(Beans.CRAWLER_CORPUS_TREATMENT_BEAN);
        try {
            CrawlerInfoWrapper crawlerInfoWrapper = createCrawlerInfoWrapper();
            List<CrawledData> crawledDataList = crawlerInfoWrapper.getCrawledData(corpusTreatmentBean.getCorpusDomain());
            List<CrawlerCorpusData> corpusDataList = BeanUtils.convertCrawledDataFromPojo(crawledDataList);
            corpusTreatmentBean.setCrawledDataList(corpusDataList);
            return ACTION_SUCCESS;
        } catch (SystemException e) {
            String errorMessage = MessageFactory.getErrorString(MessageFactory.ERROR_SYSTEM_ERROR);
            LOGGER.error(errorMessage, e);
            addErrorMessage(errorMessage + e.getMessage());
            return ACTION_FAILURE;
        } catch (CrawlerInfoException e) {
            String errorMessage = MessageFactory.getErrorString(MessageFactory.ERROR_CRAWLER_INFO_ERROR);
            LOGGER.error(errorMessage, e);
            addErrorMessage(errorMessage + e.getMessage());
            return ACTION_FAILURE;
        }
    }

    public String processChooseCorpus() {
        CrawlerCorpusTreatmentBean corpusTreatmentBean = getBean(Beans.CRAWLER_CORPUS_TREATMENT_BEAN);
        corpusTreatmentBean.getCorpusId();

        return ACTION_SUCCESS;
    }

My CrawlerCorpusData object:

public class CrawlerCorpusData {

    private String id;

    private String url;

    public String getId() {
        return id;
    }

    public CrawlerCorpusData() {
    }

    public CrawlerCorpusData(String id, String url) {
        this.id = id;
        this.url = url;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    @Override
    public boolean equals(Object obj) {
        if (!(obj instanceof CrawlerCorpusData)) {
            return false;
        }
        CrawlerCorpusData data = (CrawlerCorpusData) obj;
        return this.id == data.getId();
    }
} 

I tried using List<SelectItem>, tried to use selectOneMenu, tried to use without converter, any success 🙁

Can someone tell me what am I missing here?

  • 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-29T15:40:36+00:00Added an answer on May 29, 2026 at 3:40 pm

    Values provided by selectItems should match the manipulated value, crawlerCorpusTreatmentBean.corpusId in your case. I would try

    itemValue="#{crawledData.id}"
    

    You should not be needing any converter in p:selectOneListbox, the default numeric one should do I believe. A converter would be necessary if you wanted to manipulate a full object value, like crawlerCorpusTreatmentBean.crawledData for example. Such object cannot be serialized in an obvious way and you need to provide a custom object<->string conversion.

    EDIT: If the corrected markup does not work, it may mean the items list is lost between requests. It is stored in corpusTreatmentBean, so this bean should have scope wider than request, for example View. Alternatively the list can be recreated in each request by moving processContinue logic to corpusTreatmentBean @PostConstruct for example.

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

Sidebar

Related Questions

I have been trying to solve this problem for a while, but couldn't with
I've been trying to solve this problem all day, and I've read some conflicting
I've been trying to solve this problem for a couple of hours but I
Background All day long I've been trying to solve a problem, I read all
I have been trying to solve this problem for three days now, it's really
I have been searching the internet for days trying to solve this problem. I
I have been trying to solve this bug for 2 days straight and can't
I have an interesting problem here I've been trying to solve for the last
I have been trying to solve a programming problem, one of the modules of
Here's a problem I've been trying to solve at work. I'm not a database

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.