pivot-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Greg Brown <gkbr...@mac.com>
Subject Re: Problem with resource prefix
Date Fri, 16 Apr 2010 11:48:22 GMT
Unfortunately, this is not supported. Applying a regex as you describe might work, but would
make a lot more assumptions about the content of an XML attribute than we currently do, which
is not desirable.

However, you could define your resources like this:

{   login.pwd.label: "Login",
    login.pwd.flag: {
        messageType: "info",
        message: "Login error"

and specify the text input field as follows:

<TextInput Form.label="%login.pwd.label" Form.flag="%login.pwd.flag">

On Apr 16, 2010, at 4:36 AM, alejandro.vilar@synacom.com.bo wrote:

> Hi,
>                 I’m trying to code a login form, using a text validation for empty
passwords and almost all works fine. Also I’m using the resource prefix to set the label
and flag values like this:
> <Form >
>     <sections>
>         <Form.Section>
>             <TextInput Form.label="%login.pwd.label"
>                        Form.flag="{messageType:'info', message:'%login.pwd.flag'}">
>                 <validator>
>                     <validation:RegexTextValidator>
>                         <pattern><![CDATA[.+]]></pattern>
>                     </validation:RegexTextValidator>
>                 </validator>
>             </TextInput>
>         </Form.Section>
>     </sections>
> </Form>
> The password label works fine, but the flag displays “%login.pwd.flag” instead of
the resource’s value.
> As I can see into the WTKXSerializer class, in the resolve()  method is where the prefixes
are processed, but only checks the first character, and as the first character is a bracket
the whole “{messageType:'info', message:'%login.pwd.flag'}” is ignored.
> A possible solution could be use a regex to find all the single-quoted values and call
same resolve() method for each match found and replace them correctly, in this case for: ‘info’
and ‘%login.pwd.flag’.
> Or is there another way ?
> Thanks in advance.
> -A

View raw message