Sylvain Wallez wrote:
...

<jx:when test="$widget.getWidget("items").size > 0">


Thanks for JXTemplateGenerator example. I assume $widget here should be woody form, which is stored in the request attribute, and according to [1], method call syntax is a bit different from the above. So I ended up with:

<jx:when test="getWidget(getAttribute($request, "form"), "items")/size > 0">

which actually worked for me, with JXTemplateGenerator. I'm now puzzled: how yours expression works?


The important difference with the WoodyTransformer is that the generator has access to the form model and therefore can produce a page layout whose content depend on the actual values of this model.


I'm worried a bit about performance of such a beastie - macros on top of interpreted jxpath language executed in interpreted java machine...


The above example is however a bit too simplistic since the same result could be achieved with the WoodyTransformer. The jx:when test expression would then be something like "$woody-form.getWidget("items").size > 0".


Now I'm lost. I have not found code in neither EffectWidgetReplacingPipe nor in WoodyTemplateTransformer which would implement any jx: functionality, except commented-out translateText method. What do I miss?

Vadim

[1] http://jakarta.apache.org/commons/jxpath/users-guide.html




Reply via email to