1

I got this error each time I click on a b:commandButton that contains a iconAwesome

bsf.js.xhtml?ln=bsf:7 Uncaught TypeError: Cannot read property 'id' of     nullBsF.ajax.onevent @ bsf.js.xhtml?ln=bsf:7sendEvent @ jsf.js.xhtml?ln=javax.faces:1response @ jsf.js.xhtml?ln=javax.faces:1onComplete @ jsf.js.xhtml?ln=javax.faces:1AjaxEngine.req.xmlReq.onreadystatechange @ jsf.js.xhtml?ln=javax.faces:1

Here the code used on the xhtml that cause such exception, blocking all the other features on the interface.

 <b:commandButton look="primary" value="Accept" 
iconAwesome="fa-pencil-square-o" 
                                    ajax="true" 
                                    update="@form"
                                    actionListener="#  {navState.popSubContents(1)}"
                                    action="#{courtMan.saveCourtEdit()}" />

Without the iconAwesome it works well.

So how to use iconAwesome on the commandButton ?

Thanks

b.lopes
  • 435
  • 1
  • 7
  • 17
  • Please give more context, and add some line breaks to your stacktrace. What's an `iconAwesome`? Have a quick look at [How to ask](http://stackoverflow.com/help/how-to-ask) to get answers faster :) – Norman Apr 12 '16 at 19:56
  • done I forgot the code sample :) thanks – b.lopes Apr 12 '16 at 22:04
  • why this is rated -1 ? do I have to create a new one, since nobody did answered it til now. Thanks – b.lopes Apr 14 '16 at 18:26
  • I'm not familiar with JSF, so I'll give general advice on improving your question: 1. Insert line breaks into the error message (before every `@`). 2. Properly indent the code sample (second line is off). That way, your question will please the eye :-) Then, try to give a little more context or introduction for people that are less familiar with your subject matter. There aren't many `bootsfaces` questions here, so answerers might take longer. Maybe explain what you want to achieve with `iconAwesome`. The best thing *always* is providing an [mcve]. (Though maybe not necessary in this case.) – Norman Apr 14 '16 at 19:23
  • I couldn't reproduce this with the current Snapshot, may try 0.8.1 another time. Does the error also occur without the `action` and `actionListener`, so we can get a more minimal example of this error? – Zhedar Apr 15 '16 at 23:56
  • It still gives that error with or without action or actionListener here a youtube link with the simulation [link](https://youtu.be/HeCAEQXIdYk) – b.lopes Apr 16 '16 at 11:54
  • To simulate it you have to do a double click over the comandbutton that has the iconAwesome! a normal click will not cause the issue, sometimes it seems that a fast 1 click also causes the issue – b.lopes Apr 16 '16 at 17:46
  • Hey, never mind this, looks like this is not linked to the iconAwesome. After few more tests, without the IconAwesome I managed to reproduce the issue still! So it may be linked to the ActionListener that has a server bean method which receives as parameter an object. This commandButton is inside a ui:repeat for the iteration of a list of these objects... It works sometimes but with fast clicks or fasts double clicks doesn't... any idea ? Thanks – b.lopes Apr 16 '16 at 19:45

1 Answers1

0

After few more tests we detected that the issue is not caused by the presence of the iconAwesome attribute. By having it seems to help the exception to be released more often, but after removed all the iconAwesome attributes I managed to reproduce the issue.

I had to click several times on the same commandButton and with simultaneous clicks, it a I click on the button and wait few seconds and the click again it works, but by clicking with a interval very short, few milliseconds the exception appears.

Since this commandButton is inside a ui:repeat loop and contains a ActionListener that calls a bean method which receives an parameter ( the object of the list that is being iterated) I think that it maybe some issue on this... analyse will continue.. thanks.

b.lopes
  • 435
  • 1
  • 7
  • 17
  • Could you page me or [@stephan-rauh](http://stackoverflow.com/users/3466464/stephan-rauh), when you know more about this? Even better would be to [open an issue on GitHub](https://github.com/TheCoder4eu/BootsFaces-OSP/issues), so we can track the problem down and fix it. – Zhedar Apr 19 '16 at 12:10
  • Did you solve your problem. Im stuck in similar issue – Crawler May 13 '16 at 06:14
  • No, it still happens, if I perform fasts clicks one after other. Since it is for us a minor issue at the moment we are not currently investigating for a better solution. But before the product be in a live server we will have to fix it somehow. Than you if you find any solution for it. – b.lopes May 22 '16 at 19:50