Max Rydahl Andersen wrote:
> Yes, It's possible.
>
ok, so but wouldn't it make more sense to add it as a seperate tag instead of string
based function embedded into an attribute of vpe:if ?
-max
By my opinion no, because in VPE already exists some examples of using
vpe:if for testing various conditions, for examples:
Example 1:
<vpe:tag name="h:graphicImage" case-sensitive="yes">
<vpe:if test="attrpresent('value')">
Example 2:
<vpe:if test="(@disabled='true')">
<vpe:template children="yes" modify="yes">
Examples 3:
<vpe:if test="@disabled='on'">
<vpe:template children="no" modify="no">
Example 4:
<vpe:tag name="img" case-sensitive="no">
<!-- in this case the tag is a facelets's tag -->
<vpe:if test="attrpresent('jsfc')" >
<vpe:template children="no" modify="no">
But I haven't founded not one tag which used for filter
functionality, except vpe:if, so I think it better to use vpe:if for
filtering templates using various
functions like tld_version, attrpresent and others.
>>> In VPE was added support for taglib versions
>>>
see(http://jira.jboss.com/jira/browse/JBIDE-1466).
>>> Checks for versions was resolved in
>>> org.jboss.tools.vpe.editor.template.expression.VpeFunctionTldVersionCheck
>>> class.
>>> Here some examples how it's can be used in template configuration file:
>>> Example 1:
>>> <vpe:tag name="f:testTldVersion"
case-sensitive="yes">
>>> <vpe:if test="tld_version('min=0.0 max=1.2')"
>
>>> <vpe:template children="yes"
modify="yes">
>>> <div style="background-color:red">
>>> Tld Check function
>>> </div>
>>> </vpe:template>
>>> </vpe:if>
>>> </vpe:tag>
>>> Example 2:
>>> <vpe:tag name="f:testTldVersion"
case-sensitive="yes">
>>> <vpe:if test="tld_version('min=0.0')" >
>>> <vpe:template children="yes"
modify="yes">
>>> <div style="background-color:red">
>>> Tld Check function
>>> </div>
>>> </vpe:template>
>>> </vpe:if>
>>> </vpe:tag>
>>> Example 3:
>>> <vpe:tag name="f:testTldVersion"
case-sensitive="yes">
>>> <vpe:if test="tld_version('max=1.2')" >
>>> <vpe:template children="yes"
modify="yes">
>>> <div style="background-color:red">
>>> Tld Check function
>>> </div>
>>> </vpe:template>
>>> </vpe:if>
>>> </vpe:tag>
>>> Function tld_version() checks for taglib version in projects, here can
>>> be 2 parametrs:
>>> 1) 'min' - minimal taglib version
>>> 2) 'max' - maximal taglib version
>>> In function can' be specified only one paramter 'min' or
'max'.
>>> _______________________________________________
>>> jbosstools-dev mailing list
>>> jbosstools-dev(a)lists.jboss.org
>>>
https://lists.jboss.org/mailman/listinfo/jbosstools-dev
>>>
>>>
>>>
>>
>>
>>
>