[
https://issues.apache.org/jira/browse/PIVOT-573?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Greg Brown resolved PIVOT-573.
------------------------------
Resolution: Won't Fix
You can achieve the same thing without modifying the serializer by defining a
script block:
<wtkx:script>
var validator = Packages.ms.allman.pivot.Validators.getZipCodeValidator();
</wtkx:script>
<TextInput validator="$validator"/>
Alternatively, you can do this:
<TextInput>
<validator>
<allman:ZipCodeValidator/>
</validator>
</TextInput>
Or this:
<wtkx:define>
<allman:ZipCodeValidator wtkx:id="validator"/>
</wtkx:define>
<TextInput validator="$validator">
Note that future patches submitted against the 1.5 branch will probably not be
applied (unless they are critical bug fixes). Development is currently focused
on the 2.0 branch.
> Execute script expressions in WTKX component attributes
> -------------------------------------------------------
>
> Key: PIVOT-573
> URL: https://issues.apache.org/jira/browse/PIVOT-573
> Project: Pivot
> Issue Type: New Feature
> Components: wtk-wtkx
> Affects Versions: 1.5
> Environment: Using patched Pivot 1.5
> Reporter: Michael Allman
> Attachments: script_expressions_in_attributes.patch
>
>
> The attached patch allows users to put arbitrary script expressions in wtkx
> component attributes. This provides a superset of existing functionality,
> which allows the user to reference an object by its wtkx:id.
> For example, I have a Java class ms.allman.pivot.Validators with a static
> method getZipCodeValidator() that returns a Validator. Then the following
> WTKX fragment sets a zip code validator on the given TextInput:
> <TextInput
> validator="$Packages.ms.allman.pivot.Validators.getZipCodeValidator()"/>
> (This example assumes the use of the JavaScript engine for scripting.)
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.