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:
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?
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>