How to create h:commandButton in JSF to open a new page

后端 未结 1 1852
旧巷少年郎
旧巷少年郎 2021-01-24 05:02

I want to create command button in JSF page. When I press it I want to open a new page and send a value using using the http. I tested this h:commnadButton but it\'

相关标签:
1条回答
  • 2021-01-24 05:16

    h:commandButton is for submitting forms, usually executing actions in the server.

    Use h:button for simple navigation:

    <h:button id="lnkHidden" value=" Edit User " outcome="EditAccountProfile.jsf">
     <f:param name="id" value="#{item.userid}" />
    </h:button>
    

    This will generate a normal HTML <input type="button" onclick="window.location.href=/correct/path/to/EditAccountProfile.jsf" />, no HTTP POST needed.

    See also:

    When should I use h:outputLink instead of h:commandLink?

    0 讨论(0)
提交回复
热议问题