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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T02:42:54+00:00 2026-06-07T02:42:54+00:00

When I click the save button, ‘addCompany’ action is called but when I debug

  • 0

When I click the save button, ‘addCompany’ action is called but when I debug and see the value of instance variable companyName in my backing bean, its showing null. I think I am doing some real silly mistake.

Modal XHTML: Included in form tag of another xhtml.

<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                    xmlns:ui="http://java.sun.com/jsf/facelets"
                    xmlns:h="http://java.sun.com/jsf/html"
                    xmlns:a4j="http://richfaces.org/a4j"
                    xmlns:rich="http://richfaces.org/rich"
                    xmlns:f="http://java.sun.com/jsf/core">

        <rich:modalPanel id="AddDmpCompanyModalId"
                             showWhenRendered="#{companyAdminAction.showAddCompanyModal}"
                             width="500"
                             height="340"
                             autosized="true">

                <f:facet name="header">
                    <h:outputText value="Add Company"/>
                </f:facet>


                <a4j:outputPanel id="addDmpCompanyInputPanel">

                            <label style="font-weight:bold;margin-top:5px">Name: </label>
                            <h:inputText id="companyName"  value="#{companyAdminAction.companyName}"/>

                                <a4j:commandLink id="submit-add-company-name-link"
                                                 immediate="true"
                                                 action="#{companyAdminAction.addCompany()}"
                                                 styleClass="button"
                                                 reRender="AddDmpCompanyModalId,addDmpCompanyInputPanel"
                                                 limitToList="true">
                                    <span class="inner-button">Save</span>
                                </a4j:commandLink>


                </a4j:outputPanel>

            </rich:modalPanel>

    </ui:composition>

Backing Bean (Seam Component)

Name("companyAdminAction")
@Scope(ScopeType.CONVERSATION)
public class CompanyAdmin {

    private String companyName;     

    public String getCompanyName() {
        return companyName;
    }

    public void setCompanyName(String companyName) {
        this.companyName = companyName;
    }

      public void addCompany() {
    // On click of save debugger comes here, but shows the value of          
      //companyName as null 
     }  

}
  • 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-07T02:42:56+00:00Added an answer on June 7, 2026 at 2:42 am

    Yes, the reason is very simple: you’re using immediate=true in your <a4j:commandLink/>. This option makes JSF invoke the addCompany() function BEFORE values are converted and the model updated.

    The solution is equally simple: remove the immediate=true attribute from <a4j:commandLink/>.

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

Sidebar

Related Questions

After select a value in DataGridView ComboBox and click a save button in bindingnavigator,
I currently have a simple form that when you click the save button will
$('#ms_cats_meta_eduyear, #ms_cats_meta_semester, #ms_cats_meta_subject').change(function () { $('#publish').removeClass('button-primary-disabled'); $('#save-post').removeClass('button-disabled'); $('input#publish').click( function () { var eduyear_val =
I am using the TSaveDialog component to save a file from a button click.
I collapse some codes in Notepad++ and click Save button to save my code,then
I have some jQuery that when you click the save button it triggers a
I have this certain viewmodel with viewmodels and collections. When I click save button
How to save record lists when click save button(PHP and MSQL). Example: ID Name
I am saving records on save button click, if user don't click save button
i have listview with checkboxes and save button. Whichever checkboxes i check and click

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.