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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T09:51:50+00:00 2026-06-15T09:51:50+00:00

Using PF 3.2 I faced this problem if I submit a form and their

  • 0

Using PF 3.2
I faced this problem
if I submit a form and their is a required field, validation done and required messages appeared. the problem is after that if I changed the combo value that -by ajax- changes the inputtext the value doesn’t change, however the listener called!
xhtml

<html xmlns="http://www.w3.org/1999/xhtml"
  xmlns:h="http://java.sun.com/jsf/html"
  xmlns:p="http://primefaces.org/ui"
  xmlns:f="http://java.sun.com/jsf/core">
<h:head>
    <title>Prime Test</title>
</h:head>


<h:body style="background: #F6F6F6;">
    <h:form id="idAjaxFormTest">
        <f:view>
           <h1> <h:outputText value="after submit ajax problem" /></h1>
            <p:messages showSummary="true" autoUpdate="true" />
            <p:panelGrid columns="2">
                <h:outputText value="Names" />
                <p:selectOneMenu value="#{ajaxTest.name}">
                    <f:selectItems value="#{ajaxTest.names}" var="varName"
                                   itemLabel="#{varName}" itemValue="#{varName}">
                    </f:selectItems>
                    <p:ajax listener="#{ajaxTest.listen}" update="idXname" />
                </p:selectOneMenu>

                <h:outputText value="Xname" />
                <p:inputText value="#{ajaxTest.xname}" id="idXname"/>

                <h:outputText value="Xuser" />
                <p:inputText required="true" transient="true" value="#{ajaxTest.xuser}" label="xUser" />
            </p:panelGrid>
            <p:commandButton value="Submit" action="#{ajaxTest.doAction}" />
        </f:view>
    </h:form>
</h:body>

Bean

package com.actions;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ViewScoped;


@ManagedBean(name = "ajaxTest")
@ViewScoped

public class AjaxTestBean implements Serializable{
    private List<String> names;
    private String name;
    private String xname;
    private String xuser;

public AjaxTestBean() {
    names = new ArrayList<String>();
    names.add("ahmed");
    names.add("mohamed");
    names.add("mahmoud");
    names.add("ayman");
    names.add("walid");
    names.add("khalid");
}

public void listen(){
    xname = "QQ "+ name;
    System.out.println("Listener "+ xname);
}
public void doAction(){
    System.out.println("Action Done: "+ name);
}

public List<String> getNames() {
    return names;
}

public void setNames(List<String> names) {
    this.names = names;
}

public String getName() {
    return name;
}

public void setName(String name) {
    this.name = name;
}

public String getXname() {
    return xname;
}

public void setXname(String xname) {
    this.xname = xname;
}

public String getXuser() {
    return xuser;
}

public void setXuser(String xuser) {
    this.xuser = xuser;
}


}

action01

action02

  • 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-15T09:51:51+00:00Added an answer on June 15, 2026 at 9:51 am

    Looks like you have run into this problem:

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

    Adding the following to faces-config.xml together with OmniFaces library made your select-one-menu update the inputField correctly

    <lifecycle>
        <phase-listener>org.omnifaces.eventlistener.ResetInputAjaxActionListener</phase-listener>
    </lifecycle>
    

    If you dont want to do it for all your components, OmniFaces has a showcase how to do it per component: http://showcase.omnifaces.org/eventlisteners/ResetInputAjaxActionListener

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

Sidebar

Related Questions

One of the problem I faced when using branches in GIT was that it
I faced this problem while using ActionBar and struggled to find the solution,found it
I have a problem with using facet. I need autocomplete and for this I
I faced a problem while using threading for the first time, In an SWT
I faced the following issue while I submitting my form using jQuery FORM and
I'm using django_webtest to test my application. I faced with problem when try to
I m creating an app using JSF. The problem I have is that every
I face some problem when I use submit. Here is the code using some
I seem to have faced this problem many times and I wanted to ask
I am new to regex and recently faced this problem Appending and Prepending '#'

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.