But I think that's the correct behaviour. Esp since it's coming directly
from json.org. Dojo got it wrong, I'll correct it tomorrow.

On 7/31/06, Jun Tsai <[EMAIL PROTECTED]> wrote:

I find  in JSONObject:


/**
     * [EMAIL PROTECTED]
     */
    public JSONObject accumulate(String key, Object value)
    {
        JSONArray a;
        Object o = opt(key);
        if (o == null)
        {
            put(key, value);
        }
        else if (o instanceof JSONArray)
        {
            a = (JSONArray) o;
            a.put(value);
        }
        else
        {
            a = new JSONArray();
            a.put(o);
            a.put(value);
            put(key, a);
        }
        return this;
    }

When one required validator,It can't output Array.


Jun Tsai

在06-7-31,Jun Tsai <[EMAIL PROTECTED]> 写道:
>
> When one requried validator,tapestry  produce
>
> tapestry.form.registerProfile
>
('AForm',{"required":"nameField","nameField":{"required":"请输入[NAME]的内容。"}});
>
> When two or more requried validator,tapestry produce
>
> tapestry.form.registerProfile
('AForm',{"required":["nameField","passwordField"],"nameField":{"required":"请输入[NAME]的内容。"},"passwordField":{"required":"请输入[NUM]的内容。"}});
>
>
>
> When one required validator, tapestry should produce
> tapestry.form.registerProfile
('AForm',{"required":["nameField"],"nameField":{"required":"请输入[NAME]的内容。"}});
>
>
>
>
> Jun Tsai
>
>
> 2006/7/31, Jun Tsai <[EMAIL PROTECTED]>:
> >
> > In the dojo.validate.check
> >
> > if ( profile.required instanceof Array ) {
> >
> > When only one required validator,profile.required is object.
> >
> > Jun Tsai
> >
> > 2006/7/31, Jun Tsai < [EMAIL PROTECTED]>:
> >
> > > When in a form ,only one required validator.the dojo dialog can't be
> > > shown.
> > >
> > > ex:
> > > <?xml version="1.0" encoding="utf-8"?>
> > > <!DOCTYPE page-specification PUBLIC "-//Apache Software
> > > Foundation//Tapestry Specification 4.0//EN" "
> > > http://jakarta.apache.org/tapestry/dtd/Tapestry_4_0.dtd";>
> > >
> > > <page-specification class="corner.orm.tapestry.page.PoFormPage ">
> > >   <description>corner.demo.model.one.A Form Page</description>
> > >   <bean class="org.apache.tapestry.valid.ValidationDelegate"
> > > name="delegate"/>
> > >   <property persist="entity" initial-value="new
> > > corner.demo.model.one.A()" name="entity"/>
> > >   <component type="Form" id="AForm">
> > >     <binding value="ognl:beans.delegate" name="delegate"/>
> > >     <binding value="ognl:true" name="clientValidationEnabled"/>
> > >     <binding value="listener:doSaveEntityAction" name="success"/>
> > >     <binding value="listener:doCancelEntityAction" name="cancel"/>
> > >   </component>
> > >   <component type="TextField" id="nameField">
> > >     <binding value="message:name" name="displayName"/>
> > >     <binding value="translator:string" name="translator"/>
> > >     <binding value="ognl: entity.name" name="value"/>
> > >      <binding name="validators" value="validators:required"/>
> > >   </component>
> > >     <component type="TextField" id="passwordField">
> > >     <binding value="message:password" name="displayName"/>
> > >     <binding value="translator:string" name="translator"/>
> > >     <binding value="ognl:entity.password " name="value"/>
> > >   </component>
> > > </page-specification>
> > >
> > >
> > > Jun Tsai
> > >
> > > --
> > > Welcome to China Java Users Group(CNJUG).
> > > http://cnjug.dev.java.net
> > >
> >
> >
> >
> > --
> > Welcome to China Java Users Group(CNJUG).
> > http://cnjug.dev.java.net
> >
>
>
>
> --
> Welcome to China Java Users Group(CNJUG).
> http://cnjug.dev.java.net
>



--
Welcome to China Java Users Group(CNJUG).
http://cnjug.dev.java.net




--
Jesse Kuhnert
Tacos/Tapestry, team member/developer

Open source based consulting work centered around
dojo/tapestry/tacos/hivemind.

Reply via email to