Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The altSyntax changes the behavior of how tags are interpreted. Instead of evaluating each tag parameter against the value stack and needing single quotes to mark string literals, only marked expressions are evaluated in altSyntax.

Example:

the following code uses the Tag Syntax:

Code Block

<ww:iterator value="cart.items">
   ...
   <ww:textfield label="'Cart item No.' + #rowstatus.index + ' note'" name="'cart.items[' + #rowstatus.index + '].note'" value="note" />
</ww:iterator>

this is somewhat counter intuitive to normal HTML tag behaviour, and you get loads of single quotes. Now the same example in altSyntax:

Code Block

<ww:iterator value="cart.items">
   ...
   <ww:textfield label="Cart item No. %{#rowstatus.index} note" name="cart.items[%{#rowstatus.index}].note" value="%{note}" />
</ww:iterator>

Only expressions enclosed with %{} are evaluated. The code is shorter and clearer, very similar to JSTL EL usage. Quoting problems, eg. with to javascript function calls, are avoided.

In order to fully understand why this option exists and what the differences are, it is best to get a bit of history about WebWork.

...