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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T14:25:58+00:00 2026-06-12T14:25:58+00:00

When I click the search button, I’m trying to have my index.xhtml take me

  • 0

When I click the search button, I’m trying to have my index.xhtml take me to another page w/ the results. I’m using primefaces JSF.

My problem is that I can’t get it to go to the next page. It is calling my searchController beans findItem method, but the resulting pages doesn’t change. It just stays on the index.xhtml page.

Anyone have ideas?

@ManagedBean(name="sController")
@RequestScoped
public class SController implements Serializable {
    private static final long serialVersionUID = 1L;

    public SController() { }

    public String findItem() {
        System.out.println("findItem called!");

        return "success";
    }

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

    public String getName() {
        return name;
    }
} 

Here’s my faces-config.xml.

<?xml version="1.0" encoding="UTF-8"?>
<faces-config 
    xmlns="http://java.sun.com/xml/ns/javaee" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd"
    version="2.0">

<navigation-rule>
    <from-view-id>/index.xhtml</from-view-id>
    <navigation-case>
        <from-action>#{sController.findItem}</from-action>
        <from-outcome>success</from-outcome>
        <to-view-id>/items.xhtml</to-view-id>
    </navigation-case>
</navigation-rule>
</faces-config>

And here’s my index.xhtml.

<f:view>
<h:form>
    <p:panel id="search" header="Search Item">
        <p:panelGrid columns="2" cellpadding="5">

            <h:outputLabel value="Name" for="name"/>
            <p:inputText id="name" value="#{sController.name}"/>

        </p:panelGrid>
    </p:panel>

    <p:commandButton value="Search" 
        actionListener="#{sController.findItem}"/>
</h:form>
</f:view>
  • 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-12T14:25:59+00:00Added an answer on June 12, 2026 at 2:25 pm

    That’s a workaround. For the benefit of anyone else who might visit this page with the same problem, your page failed to navigate because the method expression you’re using in the actionListener attribute should not be used there (only ActionListener type methods are allowed there). Use that method instead in the action attribute of the command button.

    A method that correctly implements the ActionListener interface has a return type of void and as a result will not implicitly do any JSF-based navigation. A regular method expression returning a type of String however is what is used for JSF based nav.

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

Sidebar

Related Questions

I have search button on page. user input som data and click search button.
Have a look at this page: http://173.203.72.190:12123/Search-Results.aspx?Mode=Browse&Cuisine=-1&Zone=-1 If you click 'Browse' with the 'Any
I have a home page with a search box and a button on it.
I have a VF page which has 2 date fields and search button. On
I'm using this bookmarklet to programmatically click on the search button in Google's Keyword
I am trying to make dropdown enabling using jquery and click search then that
I have a particularly difficult form that I am trying to click the search
I created a Search Interface in Android. when we click on hardware search button
Using ASP.NET 3.5 and jQuery UI. When a user clicks the Search button, a
i am trying to get a search box to work on both click a

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.