3 Replies Latest reply on Nov 29, 2007 9:31 AM by demetrio812

    Problem with commandLink

    demetrio812 Apprentice

      I have this code:

      <rich:panel id="pnlCarteInMano">
       <f:facet name="header">Carte in mano</f:facet>
       <rich:dataGrid id="dgCarteInMano" border="0" style="background-color: transparent;" value="#{homepageHelper.giocatoreCorrente.carteInMano}" var="carta" columns="#{homepageHelper.giocatoreCorrente.carteInMano.size()}">
       <a:commandLink reRender="dgCarteInMano" immediate="true" action="#{homepageHelper.selezionaDeselezionaCarta(carta)}">
       <s:div style="height: 108px; width:70px">
       <h:graphicImage border="0" value="#{uiOptions.getPathImmagineCarta(carta)}">
       <rich:effect event="onmouseover" type="Opacity" params="duration:0.5, from:1.0, to:0.5" />
       <rich:effect event="onmouseout" type="Appear" params="duration:0.5" />

      The commandLink works fine the first time but after the reRender it is empty (in dom as I can see in firebug) and the structure become:

      <a:commandLink ... />
       <h:graphicImage ... />

      I have the same problem using ui:decorate or s:decorate instead of s:div...how can I solve this?

      Thank you!

      Demetrio FIlocamo

        • 1. Re: Problem with commandLink
          Ilya Shaikovsky Master

          have you tried to check your generated HTML with Tidy html validator?

          After you check it - you'll see that Tidy corrects your code just as you describe, because of needed corrections.

          You may turn of filter bur layout could be broken if there are errors

          B.t.w. why you can't just use image inside link without any other elements?

          • 2. Re: Problem with commandLink
            demetrio812 Apprentice

            I didn't try, but why doesn't it work? The code is correct in this case...

            Btw using only an image works but I would like to use s:decorate coz the real code is not just an image because it depends on some variables...this is a simple example to explain the problem...

            is there some hack to make it works?


            Demetrio Filocamo

            • 3. Re: Problem with commandLink
              demetrio812 Apprentice

              Hi, I checked the doc to disable forceparser param into org.ajax4jsf.Filter but I'm currently using Seam and I don't have org.ajax4jsf.Filter in my web.xml, how can I set the forceparser param?

              Btw I have this problem in other parts of application, don't you think it is a bug?

              You said that tidy corrects my code because of "needed" corrections, why needed? isn't fine putting more then one-level element? I think it's a bug...

              How can I solve this? Hava I to open a JIRA issue?