开发者

<button> with JSF 1.2

开发者 https://www.devze.com 2023-04-10 20:02 出处:网络
Simple question: Is there any way of rendering a html <button>-element using JSF or any other framework (RichFaces, Tomahawk etc.)? Or would I have re开发者_运维技巧sort to writing a custom co

Simple question:

Is there any way of rendering a html <button>-element using JSF or any other framework (RichFaces, Tomahawk etc.)? Or would I have re开发者_运维技巧sort to writing a custom component for this?


No, there isn't. Since a <button> is usually only used in GET requests, you can also just put it plain vanilla in the JSF template. You don't need to bind any action to a JSF managed bean anyway.

In JSF 2.0, there's by the way the <h:button> which renders a GET button and offers the option to include view parameters and/or to perform implicit navigation. Both features aren't available in JSF 1.2, so there's not really a point of having similar component in JSF 1.2 anyway.

On the other hand, if you actually intend to use a <button> to invoke a POST managed bean action method, then you should really be using a <h:commandButton> instead. If you're having a specific problem with it for which you thought that using <button> was the solution, then you'd need to reframe your question to elaborate in more detail about that specific problem so that we can answer how to achieve the same with <h:commandButton>.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号