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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T06:09:46+00:00 2026-05-12T06:09:46+00:00

I have a Seam application originally generated by seam-gen with a view Search.xhtml. Search.xhtml

  • 0

I have a Seam application originally generated by seam-gen with a view Search.xhtml.

Search.xhtml has a number of input fields, half of which are bound to the Office entity and half to the Devices entity.

For example, if you enter a hostname, it is bound to a field in Devices, if you enter a City, it is bound to a field in Office.

The destination page is going to be OfficeResult.xhtml by default, or, if a “Devices” property has been entered, to the DeviceResult.xhtml.

My question has 2 parts:

  1. What component should I use in Search.xhtml for the submit button? I assume h:commandButton, but then what do I use for the action? If I use a destination view, will that be overridden by the navigation rule in page.xml file?

  2. How to set up my Search.page.xml file? How do I condition the navigation on the parameter?

Here is Search.xhtml (pseudo code):

<h:inputText value="#{devicesList.devices.devSerialNum}" />
<h:inputText id="state" value="#{officeList.office.state}" />

<h:commandButton id="search" action="/OfficeResult.xhtml" value="Search"  />

Search.page.xml (pseudo code):

<navigation>
  <rule if devSerNum is set >
<redirect view-id="/DeviceResult.xhtml"/>
  </rule>
  <rule if state is set >
    <redirect view-id="/OfficeResult.xhtml"/>
  </rule>
</navigation>
  • 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-12T06:09:46+00:00Added an answer on May 12, 2026 at 6:09 am

    If I’m understanding your question correctly, and based on your current design, I believe you could do something similar to this:

    Your Search.xhtml file:

    <h:inputText value="#{devicesList.devices.devSerialNum}" />
    <h:inputText id="state" value="#{officeList.office.state}" />
    
    <h:commandButton id="search" action="#{devicesList.isDeviceSearch()}" value="Search"  />
    

    Add a new method to your DevicesList.java file

    @Name("devicesList")
    public class DevicesListImpl implements DevicesList {
    
        ...other properties and methods...
    
        public boolean isDeviceSearch() {
    
            boolean result;
    
            ...logic to determine if the search value exists...
    
            return result;
    
        }
    }
    

    And then in your Search.page.xml file:

    <navigation from-action="#{devicesList.isDeviceSearch()}">
        <rule if-outcome="true">
            <redirect view-id="/DeviceResult.xhtml" />
        </rule>
    
        <redirect view-id="/OfficeResult.xhtml" />
    </navigation>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following problem. I have a Seam web application which features e-mail
We have a rather restrictive architecture where we have a portal-like Seam application which
I have the following class in a Seam 2 application, which is used in
I have written an application using Seam 2.2.1 & MySQL which is working. I
In my Seam application, I have a Seam component that returns a ( @Datamodel
I'm doing a project in seam that requires restful URLs. I have a view
Hi I'm building a Seam application and have a question: I got a stateless
We have a Seam 2 based web application with the usual user login and
I have a strange problem in my application with Seam (2.1) and Internet explorer.
I'm writing an application using Seam 2.2.x which will be deployed on JBoss 5.1.

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.