[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now


How to direct to a new page on a4j:commandButton onComplete

Posted on 2009-02-08
Medium Priority
Last Modified: 2013-11-24
I have the following a4j:commandButton:

<a4j:commandButton id="runButton" value="Run Now"
                          onclick="this.disabled=true;this.value='Running ...'"
                          oncomplete="this.disabled=false;this.value='Run Now'"">

If this button is clicked, I want the user to be redirected to the following link:

 <a4j:commandLink id="latestResultLink" action="#{ContentReconciliationHome.viewResultAction}" value="View Latest Result">
                                <a4j:actionparam name="resultId" value="#{ContentReconciliationHome.latestContentReconciliationResult.id}" assignTo="#{ViewResult.resultId}"/>

I have tried different things, but can't seem to make it work. What do I need to do to make it work? Thank you for your help.

Question by:qrahman
1 Comment
LVL 22

Accepted Solution

mbonaci earned 2000 total points
ID: 23587210
Why use command link if you have the trigger for your event?
Simply do all you have to do in the method reconcileContent.

If you have some validation on form (including required attributes on input fields) use immediate="true" if you want the method called regardles of validation result.

If you want the action to redirect you to another page, use faces-config to speficy navigation rule and return the outcome as the string from reconcileContent.

Hope this helps,

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
The viewer will learn how to implement Singleton Design Pattern in Java.
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
Suggested Courses

872 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question