rewrite prevent Primefaces dialog from showing up

Splash Forums Rewrite Users rewrite prevent Primefaces dialog from showing up

This topic contains 14 replies, has 3 voices, and was last updated by  Lincoln Baxter III 2 years, 9 months ago.

Viewing 15 posts - 1 through 15 (of 15 total)
  • Author
    Posts
  • #25003

    banifou
    Participant

    Hello, I’m using primefaces-3.5 + Spring-security-3.1.2. After adding rewrite-2.0.7 my dialog <h:outputLink value="javascript:void(0)" onclick="dlg1.show();" /> doesn’t show up any more. I see just a javascript:null. Any hints?
    When I remove rewrite, it works fine.
    Thanks for your help.

    • This topic was modified 2 years, 10 months ago by  banifou.
    #25005

    banifou
    Participant

    I had a look in the source html: <a href="javascript:null" onclick="dlg1.show();">. The value of the link changed from javascript:void(0) to javascript:null !!

    • This reply was modified 2 years, 10 months ago by  banifou.
    #25007

    Seems like Rewrite tries to parse the address and fails.

    I think the simplest work around would be to use a plain HTML link for the dialog instead:

    <a href="javascript:void(0)" onclick="dlg1.show();" />

    There is really no good reason to use a JSF component in this case. Actually using a JSF component will increase your component tree size which has a negative impact on performance.

    An alternative would be to either change the value this way:

    <h:outputLink value="#" onclick="dlg1.show();" />

    Or just return false from onclick which will prevent the default action for the link. This is what I usually do:

    <h:outputLink value="javascript:void(0)" onclick="dlg1.show(); return false;" />

    #25010

    I created an issue report to track this:

    https://github.com/ocpsoft/rewrite/issues/130

    #25011

    banifou
    Participant

    return false; helped! Thank u very much.

    #25030

    Hey, could you tell me which container you are using? For some reason we cannot reproduce this issue on JBoss AS7.

    #25031

    banifou
    Participant

    I’m using glassfish.

    #25033

    And which version?

    #25034

    banifou
    Participant

    glassfish 3.1.2.2

    #25053

    banifou
    Participant

    Could u reproduce the issue on glassfish 3.1.2.2 too?

    #25174

    AFAIK Lincoln just tested in AS7. He also created an integration tests to verify that Rewrite behaves correctly for this. I’m currently working on getting our integration test suite to run on Glassfish:

    https://travis-ci.org/ocpsoft/rewrite

    But this may take some time to complete.

    #25177

    This test should have run on Travis – https://github.com/ocpsoft/rewrite/commit/7fc20b0acd3290ee3c7acf14776b408c052f766b#L0R15

    I believe the test passes, right? I wrote this test over a week ago.

    #25178

    Yeah, that’s right. Seems like your test passes on Glassfish:

    https://travis-ci.org/ocpsoft/rewrite/jobs/12488872#L8284

    @banifou Are you doing something differently? The test seems to run fine.

    #25279

    banifou
    Participant

    Sorry for the late response. I’m not doing anything differently!

    #25285

    Could you upload a sample maven application that reproduces your issue? We’ll take a look. Thanks!

Viewing 15 posts - 1 through 15 (of 15 total)

You must be logged in to reply to this topic.

Comments are closed.