[ 
https://issues.apache.org/jira/browse/TAP5-887?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12779776#action_12779776
 ] 

Leonard Lu commented on TAP5-887:
---------------------------------

I would suggest adding a type coercer to TapestryModule.  This would at least 
make writing Tapestry components that integrate or wrap Javascript libraries 
easier to write.
======================================================================
    public static void contributeTypeCoercer(Configuration<CoercionTuple> 
configuration) {
        configuration.add(new CoercionTuple<String,JSONObject>(
            String.class,
            JSONObject.class,
            new Coercion<String, JSONObject>(){
                public JSONObject coerce(String input) {
                    return new JSONObject(input);
                }
            }
        ));
    }
======================================================================

which would allow for templates like:
<t:mycomponent 
        t:mixins="highlightEffectMixin" 
        
jsonObject="literal:{startcolor:'#00FF00',endcolor:'#FFFFFF',restorecolor:'#FFFFFF',duration:3.0}"
/>


> Easier way to initialize a JSONObject with keys and values
> ----------------------------------------------------------
>
>                 Key: TAP5-887
>                 URL: https://issues.apache.org/jira/browse/TAP5-887
>             Project: Tapestry 5
>          Issue Type: Improvement
>          Components: tapestry-core
>    Affects Versions: 5.2.0.0
>            Reporter: Howard M. Lewis Ship
>            Priority: Minor
>
> Perhaps a static factory method that tooks keys/values.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to