You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In BootsFaces 0.8.1, I found an unnormal behaviour on using buttons with icons. Whenever I click on such a button, the method defined in the action attribute is called twice.
First question: why is there an onclick event on the i tag? Surrounding button tag still contains an onclick event, this should be enough.
Nevertheless, firebugging this generated code and removing onclick from i tag doesn't reduce the second method call, I could see that by setting a break point in eclipse.
Also did I find out that the method "myMethod" was called in the "before INVOKE_APPLICATION" phase and also in the "after RENDER_RESPONSE" phase.
When I change it to <h:commandButton ... />, only the "before INVOKE_APPLICATION" phase calls the method. So it could be a bug that in the "after RENDER_RESPONSE" phase myMethod is called.
Maybe it's a relict from ajax, as even on b:commandButton's ajax="false" BsF.ajax.cb is generated to be called. So I think to myself: "Why do you do such things? I'd like to have a h:commandButton with bootstrap design when I use b:commandButton, not a component that works on ajax only." Is there a good reason for that, and how can we fix this to make b:commandButton work again?
Besides, I found a workaround for my case to have a styled commandButton on my own using composite components; whoever has the same problem can use this one and replace all b:commandButton entries in its project. This is my composite component definition for my file commandButton.xhtml:
Thank you very much for your very detailed and useful analysis!
I believe we've already found and solved a part of the "called twice" bug in BootsFaces 0.8.2 (see #151 on how to get the current developer snapshot). However, I've missed the onclick handler of the icon. Thank for pointing this out! Probably this particular error is caused by trying to reuse the class rendering icons - but I'll have to check this later.
In BootsFaces 0.8.1, I found an unnormal behaviour on using buttons with icons. Whenever I click on such a button, the method defined in the action attribute is called twice.
Example:
was rendered to
First question: why is there an onclick event on the i tag? Surrounding button tag still contains an onclick event, this should be enough.
Nevertheless, firebugging this generated code and removing onclick from i tag doesn't reduce the second method call, I could see that by setting a break point in eclipse.
Also did I find out that the method "myMethod" was called in the "before INVOKE_APPLICATION" phase and also in the "after RENDER_RESPONSE" phase.
When I change it to
<h:commandButton ... />
, only the "before INVOKE_APPLICATION" phase calls the method. So it could be a bug that in the "after RENDER_RESPONSE" phase myMethod is called.Maybe it's a relict from ajax, as even on b:commandButton's ajax="false" BsF.ajax.cb is generated to be called. So I think to myself: "Why do you do such things? I'd like to have a h:commandButton with bootstrap design when I use b:commandButton, not a component that works on ajax only." Is there a good reason for that, and how can we fix this to make b:commandButton work again?
Besides, I found a workaround for my case to have a styled commandButton on my own using composite components; whoever has the same problem can use this one and replace all b:commandButton entries in its project. This is my composite component definition for my file commandButton.xhtml:
I know that there are many attributes missing, at least the ajax ones, but that's what I intended to do.
Please let me know if this workaround could help anyone just by leaving a note here. Thanks.
The text was updated successfully, but these errors were encountered: