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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T15:04:13+00:00 2026-05-23T15:04:13+00:00

I have a simple login form. When I click Login, the a4j:commandButton works well

  • 0

I have a simple login form. When I click Login, the a4j:commandButton works well and the place where contain Login form become the User Information with Logout link. But when I click the Logout link the ajax just show the status but nothing happen if I click it again the user will be logged out just what I want

That’s mean I must click twice to log the user out ??? What happen ?

<a4j:outputPanel id="login_wrapper" ajaxRendered="true">
                <h:form id="fm_logged" rendered="#{mAccount.loggedIn}">
                    <h3>User Information</h3>
                    <a4j:status name="login_form_status">
                            <f:facet name="start">
                                    <h:graphicImage library="images" name="ajax-loader.gif" />
                            </f:facet>
                    </a4j:status>

                    <h6><h:outputText value="Welcome! #{mAccount.acc.name}" /></h6>
                        <ul class="list1">
                        <li><h:link value="User Account Control" outcome="/pages/management/buyer_home" style="text-decoration:none;"></h:link></li>
                        <li><a4j:commandLink id="logout" status="login_form_status" actionListener="#{mAccount.Logout}" value="Logout" style="text-decoration:none;"></a4j:commandLink></li>
                        </ul>
                </h:form>           
                <h:form id="login-form" class="login-form" rendered="#{!mAccount.loggedIn}" >
                    <h3>Login Form</h3> 
                    <a4j:status name="login_form_status">
                            <f:facet name="start">
                                    <h:graphicImage library="images" name="ajax-loader.gif" />
                            </f:facet>
                    </a4j:status>                       
                    <h:outputText value="Wrong username or password" rendered="#{mAccount.wrongUsername}" style="color:red;" />
                    <fieldset>
                        <div class="field">
                            <label>Email: </label><h:inputText value="#{mAccount.acc.email}" /> 
                        </div>
                        <div class="field">
                            <label>Password</label><h:inputSecret value="#{mAccount.acc.password}" /> 
                        </div>
                        <div class="field">
                            <label class="alt">Remember me</label><h:selectBooleanCheckbox value="#{mAccount.rememberMe}" />
                        </div>

                        <ul>
                            <li><h:link outcome="forgot_password">Forgot your password?</h:link>
                            </li>
                            <li><h:link outcome="registration">Create an account.</h:link>
                            </li>
                        </ul>

                        <div class="wrapper">
                            <a4j:commandButton id="login" status="login_form_status" value="Login" actionListener="#{mAccount.Login}"> </a4j:commandButton>
                        </div>
                    </fieldset>
                </h:form>
            </a4j:outputPanel>
  • 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-23T15:04:14+00:00Added an answer on May 23, 2026 at 3:04 pm

    You’ve 2 forms. When one form re-renders the other form using ajax, then the view state of the other form will get lost. JSF won’t process the form submit then until you refreshes the form (which is what the first click is doing and hence the second click just works).

    You need to rearrange the ajax re-rendering logic so that one form never re-renders the whole other form, but only its contents. So, add some containing component inside the other <h:form> with an id which you then reference using reRender attribute of the ajax command link/button from the submit form.

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

Sidebar

Related Questions

I have a simple login form, username and password. Basically, When a user is
I made a simple login form where a user can click on a register
There are some HTML based games (ie bootleggers.us) that have a simple login form
I have a simple GAE app that includes a login/logout link. This app is
I have a simple form for a login, and I want to display the
I have a simple login form and it does return the success text in
I have simple login form in my website. In given requirements stands, that password
I'm working on a simple login form. When the user clicks on the Login
so I have a simple login page like this: <fieldset> <legend>Verification</legend> <form method=post action=authentication.php>
I have a login form, which contains simple text box, that shows the text

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.