You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Stephane Delort <St...@edag.de> on 2004/07/26 13:57:10 UTC

jxtemplate: jx:if strange behaviour :)

Hi all,

sorry to post with the same title as a previous thread but my problem is
quite the same :

I would like to compare 2 values in a jxtemplate but I can't get it to
work.
here is my code :

<jx:forEach  items="#{language}" varStatus="status"  >
  <jx:choose>
    <jx:when test="#{status.current = $pagelang.pagelang}">
        ${status.current.label}
    </jx:when>
    <jx:otherwise>
        ${status.current.value} #{status.current.value = '8'}
${pagelang.pagelang}
    </jx:otherwise>
  </jx:choose>
</jx:forEach>


asa resault I have :   8 false 8
this means that the program went to the "otherwise".

I tried with #, $, "" and '' but still I am far away from the solution,
if anyone have an ieda ....


Thanx in advance,
Stephane


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: jxtemplate: jx:if strange behaviour :)

Posted by Olivier Billard <ob...@jouve.fr>.
Hi Stephane,

Are you sure you set the correct namespace ?
Are the jx tags really interpreted (in other, you may have <jx:*> tags 
after your generation) ?

It happened to me when I forgot to declare the jx namespace.

--
Olivier Billard

Stephane Delort wrote:
> Hi all,
> 
> sorry to post with the same title as a previous thread but my problem is
> quite the same :
> 
> I would like to compare 2 values in a jxtemplate but I can't get it to
> work.
> here is my code :
> 
> <jx:forEach  items="#{language}" varStatus="status"  >
>   <jx:choose>
>     <jx:when test="#{status.current = $pagelang.pagelang}">
>         ${status.current.label}
>     </jx:when>
>     <jx:otherwise>
>         ${status.current.value} #{status.current.value = '8'}
> ${pagelang.pagelang}
>     </jx:otherwise>
>   </jx:choose>
> </jx:forEach>
> 
> 
> asa resault I have :   8 false 8
> this means that the program went to the "otherwise".
> 
> I tried with #, $, "" and '' but still I am far away from the solution,
> if anyone have an ieda ....
> 
> 
> Thanx in advance,
> Stephane


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org