You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by "Jun Tsai (JIRA)" <ta...@jakarta.apache.org> on 2006/08/10 09:18:13 UTC

[jira] Created: (TAPESTRY-1053) Can't use IJSONWriter to write a JSONArray object.

Can't use IJSONWriter to write a JSONArray object.
--------------------------------------------------

                 Key: TAPESTRY-1053
                 URL: http://issues.apache.org/jira/browse/TAPESTRY-1053
             Project: Tapestry
          Issue Type: Improvement
    Affects Versions: 4.1.1
            Reporter: Jun Tsai


I want to write an array ({{x,x,x,x},{y,y,y,y}}) using IJSONWriter,I find I can't do it.

I want to use JSONArray to create json string.



-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org


[jira] Reopened: (TAPESTRY-1053) Can't use IJSONWriter to write a JSONArray object.

Posted by "Jesse Kuhnert (JIRA)" <ta...@jakarta.apache.org>.
     [ http://issues.apache.org/jira/browse/TAPESTRY-1053?page=all ]

Jesse Kuhnert reopened TAPESTRY-1053:
-------------------------------------

      Assignee: Jesse Kuhnert
             
Hmmm...I see your point. (Thanks for pointing out the controller section, reading that tree widget code gives me a headache.) 

This introduces new "problems". I'll have to see what can be done. 

> Can't use IJSONWriter to write a JSONArray object.
> --------------------------------------------------
>
>                 Key: TAPESTRY-1053
>                 URL: http://issues.apache.org/jira/browse/TAPESTRY-1053
>             Project: Tapestry
>          Issue Type: Improvement
>    Affects Versions: 4.1.1
>            Reporter: Jun Tsai
>         Assigned To: Jesse Kuhnert
>
> I want to write an array ({{x,x,x,x},{y,y,y,y}}) using IJSONWriter,I find I can't do it.
> I want to use JSONArray to create json string.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org


[jira] Commented: (TAPESTRY-1053) Can't use IJSONWriter to write a JSONArray object.

Posted by "Jun Tsai (JIRA)" <ta...@jakarta.apache.org>.
    [ http://issues.apache.org/jira/browse/TAPESTRY-1053?page=comments#action_12427378 ] 
            
Jun Tsai commented on TAPESTRY-1053:
------------------------------------

But I don't need key.

I want to implement dojo tree widget in tapestry.The tree need json object array without key.

How to implement?



> Can't use IJSONWriter to write a JSONArray object.
> --------------------------------------------------
>
>                 Key: TAPESTRY-1053
>                 URL: http://issues.apache.org/jira/browse/TAPESTRY-1053
>             Project: Tapestry
>          Issue Type: Improvement
>    Affects Versions: 4.1.1
>            Reporter: Jun Tsai
>
> I want to write an array ({{x,x,x,x},{y,y,y,y}}) using IJSONWriter,I find I can't do it.
> I want to use JSONArray to create json string.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org


[jira] Commented: (TAPESTRY-1053) Can't use IJSONWriter to write a JSONArray object.

Posted by "Jesse Kuhnert (JIRA)" <ta...@jakarta.apache.org>.
    [ http://issues.apache.org/jira/browse/TAPESTRY-1053?page=comments#action_12427227 ] 
            
Jesse Kuhnert commented on TAPESTRY-1053:
-----------------------------------------

I don't think the syntax you've shown is valid JSON. An array looks like:

[x,x,x,] 

Properties can be specified within {}, but they need to be in the form of key/value pairs like:

{key:value,key2:value2,keyarray:[1,2,3]} 

I've been using arrays in the validation logic. You can call accumulateProperty or just instantiate a new JSONArray if you want.

> Can't use IJSONWriter to write a JSONArray object.
> --------------------------------------------------
>
>                 Key: TAPESTRY-1053
>                 URL: http://issues.apache.org/jira/browse/TAPESTRY-1053
>             Project: Tapestry
>          Issue Type: Improvement
>    Affects Versions: 4.1.1
>            Reporter: Jun Tsai
>
> I want to write an array ({{x,x,x,x},{y,y,y,y}}) using IJSONWriter,I find I can't do it.
> I want to use JSONArray to create json string.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org


[jira] Commented: (TAPESTRY-1053) Can't use IJSONWriter to write a JSONArray object.

Posted by "Jun Tsai (JIRA)" <ta...@jakarta.apache.org>.
    [ http://issues.apache.org/jira/browse/TAPESTRY-1053?page=comments#action_12427382 ] 
            
Jun Tsai commented on TAPESTRY-1053:
------------------------------------

In dojo TreeLoadingController 

loadProcessResponse: function(node, result, callObj, callFunc) {
     .............
     .............



		var newChildren = result;

		if (!dojo.lang.isArray(newChildren)) {
			dojo.raise('loadProcessResponse: Not array loaded: '+newChildren);
		}

		for(var i=0; i<newChildren.length; i++) {
			// looks like dojo.widget.manager needs no special "add" command
			newChildren[i] = dojo.widget.createWidget(node.widgetType, newChildren[i]);
			node.addChild(newChildren[i]);
		}


So I think the syntax should be [{"title":"title","isFolder":"true"},{"title":"title","isFolder":"true"},{"title":"title","isFolder":"true"},{"title":"title","isFolder":"true"}]


> Can't use IJSONWriter to write a JSONArray object.
> --------------------------------------------------
>
>                 Key: TAPESTRY-1053
>                 URL: http://issues.apache.org/jira/browse/TAPESTRY-1053
>             Project: Tapestry
>          Issue Type: Improvement
>    Affects Versions: 4.1.1
>            Reporter: Jun Tsai
>
> I want to write an array ({{x,x,x,x},{y,y,y,y}}) using IJSONWriter,I find I can't do it.
> I want to use JSONArray to create json string.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org


[jira] Commented: (TAPESTRY-1053) Can't use IJSONWriter to write a JSONArray object.

Posted by "Jun Tsai (JIRA)" <ta...@jakarta.apache.org>.
    [ http://issues.apache.org/jira/browse/TAPESTRY-1053?page=comments#action_12427414 ] 
            
Jun Tsai commented on TAPESTRY-1053:
------------------------------------

I had tested it. It can't work.dojo debug message is "FATAL: loadProcessResponse: Not array loaded: [object Object]".

> Can't use IJSONWriter to write a JSONArray object.
> --------------------------------------------------
>
>                 Key: TAPESTRY-1053
>                 URL: http://issues.apache.org/jira/browse/TAPESTRY-1053
>             Project: Tapestry
>          Issue Type: Improvement
>    Affects Versions: 4.1.1
>            Reporter: Jun Tsai
>         Assigned To: Jesse Kuhnert
>
> I want to write an array ({{x,x,x,x},{y,y,y,y}}) using IJSONWriter,I find I can't do it.
> I want to use JSONArray to create json string.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org


[jira] Resolved: (TAPESTRY-1053) Can't use IJSONWriter to write a JSONArray object.

Posted by "Jesse Kuhnert (JIRA)" <ta...@jakarta.apache.org>.
     [ http://issues.apache.org/jira/browse/TAPESTRY-1053?page=all ]

Jesse Kuhnert resolved TAPESTRY-1053.
-------------------------------------

    Resolution: Invalid

> Can't use IJSONWriter to write a JSONArray object.
> --------------------------------------------------
>
>                 Key: TAPESTRY-1053
>                 URL: http://issues.apache.org/jira/browse/TAPESTRY-1053
>             Project: Tapestry
>          Issue Type: Improvement
>    Affects Versions: 4.1.1
>            Reporter: Jun Tsai
>
> I want to write an array ({{x,x,x,x},{y,y,y,y}}) using IJSONWriter,I find I can't do it.
> I want to use JSONArray to create json string.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org


[jira] Resolved: (TAPESTRY-1053) Can't use IJSONWriter to write a JSONArray object.

Posted by "Jesse Kuhnert (JIRA)" <ta...@jakarta.apache.org>.
     [ http://issues.apache.org/jira/browse/TAPESTRY-1053?page=all ]

Jesse Kuhnert resolved TAPESTRY-1053.
-------------------------------------

    Fix Version/s: 4.1.1
       Resolution: Fixed

Changed interface for IJSONWriter, can now call writer.array() to get access to the array type response.

> Can't use IJSONWriter to write a JSONArray object.
> --------------------------------------------------
>
>                 Key: TAPESTRY-1053
>                 URL: http://issues.apache.org/jira/browse/TAPESTRY-1053
>             Project: Tapestry
>          Issue Type: Improvement
>    Affects Versions: 4.1.1
>            Reporter: Jun Tsai
>         Assigned To: Jesse Kuhnert
>             Fix For: 4.1.1
>
>
> I want to write an array ({{x,x,x,x},{y,y,y,y}}) using IJSONWriter,I find I can't do it.
> I want to use JSONArray to create json string.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org


[jira] Commented: (TAPESTRY-1053) Can't use IJSONWriter to write a JSONArray object.

Posted by "Andreas Andreou (JIRA)" <ta...@jakarta.apache.org>.
    [ http://issues.apache.org/jira/browse/TAPESTRY-1053?page=comments#action_12427410 ] 
            
Andreas Andreou commented on TAPESTRY-1053:
-------------------------------------------

I have the feeling that 
{0:{"title":"title","isFolder":"true"}, 1:{"title":"title","isFolder":"true"}}
might just work

> Can't use IJSONWriter to write a JSONArray object.
> --------------------------------------------------
>
>                 Key: TAPESTRY-1053
>                 URL: http://issues.apache.org/jira/browse/TAPESTRY-1053
>             Project: Tapestry
>          Issue Type: Improvement
>    Affects Versions: 4.1.1
>            Reporter: Jun Tsai
>         Assigned To: Jesse Kuhnert
>
> I want to write an array ({{x,x,x,x},{y,y,y,y}}) using IJSONWriter,I find I can't do it.
> I want to use JSONArray to create json string.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org


[jira] Commented: (TAPESTRY-1053) Can't use IJSONWriter to write a JSONArray object.

Posted by "Jun Tsai (JIRA)" <ta...@jakarta.apache.org>.
    [ http://issues.apache.org/jira/browse/TAPESTRY-1053?page=comments#action_12427122 ] 
            
Jun Tsai commented on TAPESTRY-1053:
------------------------------------

I think we can reference http://www.json.org/java/org/json/JSONWriter.java  to do it.


> Can't use IJSONWriter to write a JSONArray object.
> --------------------------------------------------
>
>                 Key: TAPESTRY-1053
>                 URL: http://issues.apache.org/jira/browse/TAPESTRY-1053
>             Project: Tapestry
>          Issue Type: Improvement
>    Affects Versions: 4.1.1
>            Reporter: Jun Tsai
>
> I want to write an array ({{x,x,x,x},{y,y,y,y}}) using IJSONWriter,I find I can't do it.
> I want to use JSONArray to create json string.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org