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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T11:04:37+00:00 2026-05-27T11:04:37+00:00

I have an h:commandLink that calls a method that changes a property bound to

  • 0

I have an h:commandLink that calls a method that changes a property bound to a radio input.

I also have a text input on the same form with some validation (required=true).

If I leave the text input blank, and click on h:commandLink with execute="@this, the radio button updates from the model property as expected, because the text input is never processed and validation never fires.

However, if first I click on a different h:commandLink with execute="@form", then the link with execute="@this", the validation messages go away but the radio button value does not update from the model even though the UIInput for the radio button was never in an invalid state.

I’m finding it annoying that the execute="@this" behaves differently depending on what I had done previously, when my intent with @this was to force everything to update from the model and ignore any submitted values from the components.

I suspect what’s happening is something like this:

  • with @form, radio button and text are both processed.
  • Radio button is valid so localValue is set
  • Process validations phase fails overall because of invalid text input, so localValue remains set and does not get cleared or propagate to value
  • the only way out of this is to explicitly call resetValue() or to re-process the component in question (e.g., execute="@this radio") to clear out localValue and then allow refreshing from bean.

My questions are:

  • is my understanding of the lifecycle correct?
  • Am I doing something wrong, or is this one of the annoying-by design things about JSF?

It feels like this may just be another example of this question

How can I populate a text field using PrimeFaces AJAX after validation errors occur?

Unfortunately I feel like I’m finding lots of those lately. 🙁

Code example below:

<h:form>
<h:messages/>

Radio = 
<h:selectOneRadio value="#{testBean.radioValue}" id="radio" binding="#{radio}">
    <f:selectItem itemValue="foo" itemLabel="Foo"/>
    <f:selectItem itemValue="bar" itemLabel="Bar"/>
</h:selectOneRadio>

<br></br>
radio bean value = <h:outputText value="#{testBean.radioValue}"/>
<br></br>
radio UIInput localValue = <h:outputText value="#{radio.localValue}"/>
<br></br>
radio UIInput value = <h:outputText value="#{radio.value}"/>

<br></br>

String w/validation = <h:inputText value="#{testBean.stringValue}" required="true" />

<br></br>

<ul>
<li>
<h:commandLink actionListener="#{testBean.changeRadioValue}" value="execute = @form">
    <f:ajax render="@form" execute="@form"/>
</h:commandLink>
</li>

<li>
<h:commandLink actionListener="#{testBean.changeRadioValue}" value="execute = @this">
    <f:ajax render="@form" execute="@this"/>
</h:commandLink>
</li>

    <li>
<h:commandLink actionListener="#{testBean.changeRadioValue}" value="execute = @this radio">
    <f:ajax render="@form" execute="@this radio"/>
</h:commandLink>
</li>   
</ul>

</h:form>

And this bean:

@ManagedBean
@ViewScoped
public class TestBean {

private String radioValue = "foo";
private String stringValue;

public void changeRadioValue() {
    radioValue = "bar";
}
 // + getters/setters
 }
  • 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-27T11:04:37+00:00Added an answer on May 27, 2026 at 11:04 am

    is my understanding of the lifecycle correct?

    Yes.


    Am I doing something wrong, or is this one of the annoying-by design things about JSF?

    It’s one of the "annoying by-design things" of JSF. As stated in my answer on that related question:

    Coming back to the concrete problem, I’d imagine that this is an oversight in the JSF2 specification. It would make much more sense to us, JSF developers, when the JSF specification mandates the following:

    • When JSF needs to update/re-render an input component by an ajax request, and that input component is not included in the process/execute of the ajax request, then JSF should reset the input component’s value.

    I only don’t remember anymore if I have ever reported this against JSF spec. Edit: I reported it: JSF spec issue 1060.

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

Sidebar

Related Questions

I have some Python code that works correctly when I use python.exe to run
i'm doing a JSF2 project. 1 . i have a form with some checkbox.
I have a plugin that uses the Plexus Commandline to invoke some external process
I have a script that I've been using for a some time to easily
I have some java components that sometimes die and the only way I know
i have a commandLink that has a graphicImage inside and i want to change
If you have a JSF <h:commandLink> (which uses the onclick event of an <a>
I have such structure in my jsp: <h:commandLink action=#{docbean.save}> <a4j:actionParam name=somename value=bill_all assignTo=#{billdoc.billType}/> <a4j:actionParam
If I have an array that contains multiple FLV files like so: my @src_files
i have a code in MFC that is calling MsiInstallProduct(installerFullPath, commandLine); is it possible

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.