h:button

HtmlOutcomeTargetButton is a UIOutput component that renders a styleable HTML <input> element. The default type is button. The component does not need to be a child of h:form since the outcome attribute is designed to navigate via HTTP GET.

Navigation Usage

The component can be used to navigate between pages with the outcome attribute. Setting includeViewParams=true will automatically include all of the f:viewParam tags (view parameters) as URL parameters.
foo=

Source Code

  1. <ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://xmlns.jcp.org/jsf/html"
  2. xmlns:ui="http://xmlns.jcp.org/jsf/facelets">
  3.  
  4. <!-- Navigation based on outcome of navigation-case defined in navigation-rule.xml -->
  5. <h:button includeViewParams="true" outcome="toParam" value="#{i18n['to-param-page']} >" />
  6. <h:outputText id="parameterValue" value="foo=#{facesContext.externalContext.requestParameterMap['foo']}" />
  7.  
  8. </ui:composition>
  1. <?xml version="1.0"?>
  2.  
  3. <faces-config xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.2" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-facesconfig_2_2.xsd">
  4. <navigation-rule>
  5. <from-view-id>/views/component.xhtml</from-view-id>
  6. <navigation-case>
  7. <from-outcome>toParam</from-outcome>
  8. <to-view-id>/views/component.xhtml</to-view-id>
  9. <redirect>
  10. <view-param>
  11. <name>componentPrefix</name>
  12. <value>#{showcaseModelBean.selectedComponent.prefix}</value>
  13. </view-param>
  14. <view-param>
  15. <name>componentName</name>
  16. <value>#{showcaseModelBean.selectedComponent.lowerCaseName}</value>
  17. </view-param>
  18. <view-param>
  19. <name>componentUseCase</name>
  20. <value>param</value>
  21. </view-param>
  22. </redirect>
  23. </navigation-case>
  24. </navigation-rule>
  25. </faces-config>
Liferay Faces Bridge Implementation 5.0.0 + Showcase Common 3.1.1 + Liferay Faces Util 3.4.1 + Mojarra 2.2.20