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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T17:25:34+00:00 2026-05-23T17:25:34+00:00

Trying to migrate a Richfaces 3.3 project to 4. Got to a rich:suggestionBox component

  • 0

Trying to migrate a Richfaces 3.3 project to 4. Got to a rich:suggestionBox component and converting it to a rich:autocomplete component, but having major troubles.

Requirements are: fill in part of the autocomplete, it presents user with suitable options. When the user selects something from the dropdown, the component should update it’s value, disable itself, and also calculate/update the default value in a secondary field, which the user is able to edit. So far I have this:

<a4j:jsFunction name="jsFunc"
    execute="autoComplete"
    render="species_name individualUserStr"
    actionListener="#{individualsBean.selectedIndividualElem.assignDefaultNickname}"/>


<rich:autocomplete
autocompleteMethod="#{individualsBean.speciesForBox}"
mode="cachedAjax"
layout="table"
var="sp"
id="species_name"
value="#{individualsBean.selectedIndividualElem.userCommonName}"
fetchValue="#{sp.commonName}"
disabled="#{individualsBean.selectedIndividualElem.userCommonName != null
    and individualsBean.selectedIndividualElem.userCommonName ne ''}"
onselectitem="jsFunc()"

>
...
</rich:autocomplete>

<h:inputText value="#{individualsBean.selectedIndividualElem.ssi.individualUserStr}"
id="individualUserStr"
maxlength="28"
styleClass="inputTextMediumRF">
</h:inputText>

Right now, when the user selects something the jsFunc is called, assignDefaultNickname is called and everything works fine, except for the fact that the calculation in assignDefaultNickname, used to determine the value of the secondary field, individualUserStr, depends upon the value of species_name, but species_name is not submitted until I submit the form, so the calculation done in assignDefaultNickname is incorrect.

I need to somehow call the setter on individualsBean.selectedIndividualElem.userCommonName, before assignDefaultNickname is called, but I cannot figure out how to do this. There seems to be problems with AJAX and this autocomplete function; that’s part of the reason why I have to use this round-a-bout jsFunction component to even call the method in the first place.

Any suggestions on how to solve this?

  • 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-23T17:25:35+00:00Added an answer on May 23, 2026 at 5:25 pm

    Found the solution to my own question. Basically, needed to learn how to use the execute attribute. The lesson to any other JSF 2.0 n00bs out there is to use execute to selectively reprocess the page. With execute you can make a white-space separated list of component IDs that should have their values re-bound to the backing bean, in case they need to be used in the listener responding to an AJAX event. In my case, this meant changing the jsFunction tag as follows:

    <a4j:jsFunction name="jsFunc"
    execute="species_name individualUserStr"
    render="species_name individualUserStr"
    actionListener="#{individualsBean.selectedIndividualElem.assignDefaultNickname}"/>
    

    As you can see, the jsFunction now, when it is calling the assignDefaultNickname function will first update the values bound to both the auto-complete and the inputText components and THEN run assignDefaultNickname.

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

Sidebar

Related Questions

I am trying to migrate a small project, replacing some factories with Guice (it
I am trying to migrate an application from OC4J to Weblogic, but I can
I'm trying to migrate from V5.3.2 to V6 of the SDK. I've got an
I'm trying to migrate a table from MySql to MSSQL using openquery but I
Im trying to migrate an old project from Delphi 5 to Delphi XE. When
I'm trying to migrate to ARC but I get this error, i really don't
I'm still trying to migrate from MSVC to GCC, but I can't seem to
I'm trying to migrate an existing eclipse web project (wtp) to maven, using m2e.
I am trying to migrate my service cross-platform with mono, but in attempting to
I am trying to migrate an application from Rails 3 to 3.1 and having

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.