Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible bug in collapsible panels with ajax #490

Closed
ScreamingTree86 opened this issue Aug 18, 2016 · 2 comments
Closed

Possible bug in collapsible panels with ajax #490

ScreamingTree86 opened this issue Aug 18, 2016 · 2 comments
Assignees
Milestone

Comments

@ScreamingTree86
Copy link

ScreamingTree86 commented Aug 18, 2016

Hi,
i think there is a bug in the ajax feature of the panels. It occures if you use the onexpand and oncollapse tags in the Firefox browser. A simple test is to open the you panel showcase site http://showcase.bootsfaces.net/layout/panels.jsf in firefox and chrome. In the ajax and javascript paragraph try to collapse the panel. In chrome it works well but in firefox nothing happens.

Taking a closer look in the generated js code this is generated:

<script>
    $('#j_idt248_j_idt250content').on('show.bs.collapse', function(e) {
        console.log('expand - start');;
        BsF.ajax.callAjax(this, event, 'j_idt248:messages', '@all', null, null, null, 'expand');
        document.getElementById('j_idt248_j_idt250_collapsed').value = 'false';
    });
</script>

As you can see the three JS code lines are called inside a function(e) where e carrys the event. But BsF.ajax.callAjax(this, event, 'j_idt248:messages', '@all', null, null, null, 'expand'); use event. In chrome there is no Problem, because chrome resolves event to window.event. But Firefox does not.
In my test application i get an additional js consol error saying "ReferenceError: event is not defined" clearly pointing at this problem.

Beside this, i use the oncollapse and onexpand to persist the collapsed state to a sessionbean. Do you know any workaround to quickfix this and persist the state?

€dit:
just to be complete. A simple workaround is to use p:remoteCommand and let the remotecommand call you backing bean method...

@stephanrauh
Copy link
Collaborator

@asterd noticed and fixed this bug two weeks ago. At the time, we didn't know it causes problems, so we didn't think too much about this. Would you like to fetch the latest developer snapshot of BootsFaces-1.0.0 and confirm the bug has been fixed? See #369 on how to get it.

Thanks in advance
Stephan

@ScreamingTree86
Copy link
Author

Okay, i tested it. Works 👍

Thank you :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants