You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pivot.apache.org by "Michael Allman (JIRA)" <ji...@apache.org> on 2010/06/25 22:21:50 UTC

[jira] Created: (PIVOT-549) Storing to fields with data binding doesn't work

Storing to fields with data binding doesn't work
------------------------------------------------

                 Key: PIVOT-549
                 URL: https://issues.apache.org/jira/browse/PIVOT-549
             Project: Pivot
          Issue Type: Bug
          Components: core-beans
    Affects Versions: 1.5
            Reporter: Michael Allman
         Attachments: Field_Bug.tgz

Pivot allows you to prefix a textKey attribute value with a "~" to indicate that that property should be accessed via the object's field.  Currently, it doesn't work.  When I try to do it, I get an IllegalArgumentException: Illegal identifier character.

I'm attaching a test case Eclipse project.  Run FieldBug, put some stuff in the fields or not, and press "Store".  You should see the exception.  Set a breakpoint on the JSON.split method and rerun the app in the debugger.  Step through and you'll see where the exception is being thrown.

Cheers.

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


[jira] Updated: (PIVOT-549) Storing to fields with data binding doesn't work

Posted by "Greg Brown (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/PIVOT-549?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Greg Brown updated PIVOT-549:
-----------------------------

    Fix Version/s: 2.0

> Storing to fields with data binding doesn't work
> ------------------------------------------------
>
>                 Key: PIVOT-549
>                 URL: https://issues.apache.org/jira/browse/PIVOT-549
>             Project: Pivot
>          Issue Type: Bug
>          Components: core-beans
>    Affects Versions: 1.5
>            Reporter: Michael Allman
>             Fix For: 1.5.1
>
>         Attachments: Field_Bug.tgz
>
>
> Pivot allows you to prefix a textKey attribute value with a "~" to indicate that that property should be accessed via the object's field.  Currently, it doesn't work.  When I try to do it, I get an IllegalArgumentException: Illegal identifier character.
> I'm attaching a test case Eclipse project.  Run FieldBug, put some stuff in the fields or not, and press "Store".  You should see the exception.  Set a breakpoint on the JSON.split method and rerun the app in the debugger.  Step through and you'll see where the exception is being thrown.
> Cheers.

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


[jira] Resolved: (PIVOT-549) Storing to fields with data binding doesn't work

Posted by "Greg Brown (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/PIVOT-549?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Greg Brown resolved PIVOT-549.
------------------------------

    Resolution: Fixed

The JSON class has been updated to allow the tilde character in identifiers.


> Storing to fields with data binding doesn't work
> ------------------------------------------------
>
>                 Key: PIVOT-549
>                 URL: https://issues.apache.org/jira/browse/PIVOT-549
>             Project: Pivot
>          Issue Type: Bug
>          Components: core-beans
>    Affects Versions: 1.5
>            Reporter: Michael Allman
>             Fix For: 1.5.1
>
>         Attachments: Field_Bug.tgz
>
>
> Pivot allows you to prefix a textKey attribute value with a "~" to indicate that that property should be accessed via the object's field.  Currently, it doesn't work.  When I try to do it, I get an IllegalArgumentException: Illegal identifier character.
> I'm attaching a test case Eclipse project.  Run FieldBug, put some stuff in the fields or not, and press "Store".  You should see the exception.  Set a breakpoint on the JSON.split method and rerun the app in the debugger.  Step through and you'll see where the exception is being thrown.
> Cheers.

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


[jira] Commented: (PIVOT-549) Storing to fields with data binding doesn't work

Posted by "Noel Grandin (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PIVOT-549?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12884282#action_12884282 ] 

Noel Grandin commented on PIVOT-549:
------------------------------------

 Hi

According to www.json.org, the tilde is a valid identifier character. Which spec are you using?

In fact, pretty much anything except doublequote and backslash are valid characters in an identifier.

-- Noel Grandin




> Storing to fields with data binding doesn't work
> ------------------------------------------------
>
>                 Key: PIVOT-549
>                 URL: https://issues.apache.org/jira/browse/PIVOT-549
>             Project: Pivot
>          Issue Type: Bug
>          Components: core-beans
>    Affects Versions: 1.5
>            Reporter: Michael Allman
>         Attachments: Field_Bug.tgz
>
>
> Pivot allows you to prefix a textKey attribute value with a "~" to indicate that that property should be accessed via the object's field.  Currently, it doesn't work.  When I try to do it, I get an IllegalArgumentException: Illegal identifier character.
> I'm attaching a test case Eclipse project.  Run FieldBug, put some stuff in the fields or not, and press "Store".  You should see the exception.  Set a breakpoint on the JSON.split method and rerun the app in the debugger.  Step through and you'll see where the exception is being thrown.
> Cheers.

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


Re: [jira] Resolved: (PIVOT-549) Storing to fields with data binding doesn't work

Posted by Noel Grandin <no...@gmail.com>.
 Hi

According to www.json.org, the tilde is a valid identifier character. Which spec are you using?

In fact, pretty much anything except doublequote and backslash are valid characters in an identifier.

-- Noel Grandin

Greg Brown (JIRA) wrote:
>      [ https://issues.apache.org/jira/browse/PIVOT-549?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
>
> Greg Brown resolved PIVOT-549.
> ------------------------------
>
>     Fix Version/s:     (was: 2.0)
>        Resolution: Not A Problem
>
> Sorry for the confusion. This is not actually a bug. The tilde is not a valid identifier character, so it can't be used unquoted in a JSON path (which is what the textKey property expects). For example, the following is not a valid JSON path:
>
> foo.~bar
>
> However, this is valid:
>
> foo["~bar"]
>
> So, to bind to a field rather than a bean property, you can do something like the following:
>
> <TextInput textKey="['~bar']"/>
>
>
>> Storing to fields with data binding doesn't work
>> ------------------------------------------------
>>
>>                 Key: PIVOT-549
>>                 URL: https://issues.apache.org/jira/browse/PIVOT-549
>>             Project: Pivot
>>          Issue Type: Bug
>>          Components: core-beans
>>    Affects Versions: 1.5
>>            Reporter: Michael Allman
>>         Attachments: Field_Bug.tgz
>>
>>
>> Pivot allows you to prefix a textKey attribute value with a "~" to indicate that that property should be accessed via the object's field.  Currently, it doesn't work.  When I try to do it, I get an IllegalArgumentException: Illegal identifier character.
>> I'm attaching a test case Eclipse project.  Run FieldBug, put some stuff in the fields or not, and press "Store".  You should see the exception.  Set a breakpoint on the JSON.split method and rerun the app in the debugger.  Step through and you'll see where the exception is being thrown.
>> Cheers.


[jira] Resolved: (PIVOT-549) Storing to fields with data binding doesn't work

Posted by "Greg Brown (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/PIVOT-549?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Greg Brown resolved PIVOT-549.
------------------------------

    Fix Version/s:     (was: 2.0)
       Resolution: Not A Problem

Sorry for the confusion. This is not actually a bug. The tilde is not a valid identifier character, so it can't be used unquoted in a JSON path (which is what the textKey property expects). For example, the following is not a valid JSON path:

foo.~bar

However, this is valid:

foo["~bar"]

So, to bind to a field rather than a bean property, you can do something like the following:

<TextInput textKey="['~bar']"/>


> Storing to fields with data binding doesn't work
> ------------------------------------------------
>
>                 Key: PIVOT-549
>                 URL: https://issues.apache.org/jira/browse/PIVOT-549
>             Project: Pivot
>          Issue Type: Bug
>          Components: core-beans
>    Affects Versions: 1.5
>            Reporter: Michael Allman
>         Attachments: Field_Bug.tgz
>
>
> Pivot allows you to prefix a textKey attribute value with a "~" to indicate that that property should be accessed via the object's field.  Currently, it doesn't work.  When I try to do it, I get an IllegalArgumentException: Illegal identifier character.
> I'm attaching a test case Eclipse project.  Run FieldBug, put some stuff in the fields or not, and press "Store".  You should see the exception.  Set a breakpoint on the JSON.split method and rerun the app in the debugger.  Step through and you'll see where the exception is being thrown.
> Cheers.

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


[jira] Updated: (PIVOT-549) Storing to fields with data binding doesn't work

Posted by "Greg Brown (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/PIVOT-549?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Greg Brown updated PIVOT-549:
-----------------------------

    Fix Version/s: 2.0
                       (was: 1.5.1)

> Storing to fields with data binding doesn't work
> ------------------------------------------------
>
>                 Key: PIVOT-549
>                 URL: https://issues.apache.org/jira/browse/PIVOT-549
>             Project: Pivot
>          Issue Type: Bug
>          Components: core-beans
>    Affects Versions: 1.5
>            Reporter: Michael Allman
>             Fix For: 2.0
>
>         Attachments: Field_Bug.tgz
>
>
> Pivot allows you to prefix a textKey attribute value with a "~" to indicate that that property should be accessed via the object's field.  Currently, it doesn't work.  When I try to do it, I get an IllegalArgumentException: Illegal identifier character.
> I'm attaching a test case Eclipse project.  Run FieldBug, put some stuff in the fields or not, and press "Store".  You should see the exception.  Set a breakpoint on the JSON.split method and rerun the app in the debugger.  Step through and you'll see where the exception is being thrown.
> Cheers.

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


[jira] Updated: (PIVOT-549) Storing to fields with data binding doesn't work

Posted by "Greg Brown (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/PIVOT-549?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Greg Brown updated PIVOT-549:
-----------------------------

    Fix Version/s: 1.5.1
                       (was: 2.0)

> Storing to fields with data binding doesn't work
> ------------------------------------------------
>
>                 Key: PIVOT-549
>                 URL: https://issues.apache.org/jira/browse/PIVOT-549
>             Project: Pivot
>          Issue Type: Bug
>          Components: core-beans
>    Affects Versions: 1.5
>            Reporter: Michael Allman
>             Fix For: 1.5.1
>
>         Attachments: Field_Bug.tgz
>
>
> Pivot allows you to prefix a textKey attribute value with a "~" to indicate that that property should be accessed via the object's field.  Currently, it doesn't work.  When I try to do it, I get an IllegalArgumentException: Illegal identifier character.
> I'm attaching a test case Eclipse project.  Run FieldBug, put some stuff in the fields or not, and press "Store".  You should see the exception.  Set a breakpoint on the JSON.split method and rerun the app in the debugger.  Step through and you'll see where the exception is being thrown.
> Cheers.

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


[jira] Reopened: (PIVOT-549) Storing to fields with data binding doesn't work

Posted by "Greg Brown (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/PIVOT-549?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Greg Brown reopened PIVOT-549:
------------------------------


> Storing to fields with data binding doesn't work
> ------------------------------------------------
>
>                 Key: PIVOT-549
>                 URL: https://issues.apache.org/jira/browse/PIVOT-549
>             Project: Pivot
>          Issue Type: Bug
>          Components: core-beans
>    Affects Versions: 1.5
>            Reporter: Michael Allman
>             Fix For: 2.0
>
>         Attachments: Field_Bug.tgz
>
>
> Pivot allows you to prefix a textKey attribute value with a "~" to indicate that that property should be accessed via the object's field.  Currently, it doesn't work.  When I try to do it, I get an IllegalArgumentException: Illegal identifier character.
> I'm attaching a test case Eclipse project.  Run FieldBug, put some stuff in the fields or not, and press "Store".  You should see the exception.  Set a breakpoint on the JSON.split method and rerun the app in the debugger.  Step through and you'll see where the exception is being thrown.
> Cheers.

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


[jira] Commented: (PIVOT-549) Storing to fields with data binding doesn't work

Posted by "Greg Brown (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PIVOT-549?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12884294#action_12884294 ] 

Greg Brown commented on PIVOT-549:
----------------------------------

A tilde is only valid when in quotes:

{ "~foo" : "bar" }

The JSON spec actually requires quotes around the keys, so a tilde is always a valid identifier character. However, Pivot, like JavaScript, allows callers to use unquoted identifiers as long as they conform to Java identifier rules:

{ ~foo: "bar" } // not OK
{ foo : "bar" } // OK

But note that this issue doesn't apply to the JSON format itself - it applies to the JSON path syntax used by Pivot (and JavaScript) to access values in a JSON structure (which isn't addressed by the JSON spec):

JavaScript:
var json = { "~foo" : "bar" };
var tildeFoo = json.~foo; // not OK
var tildeFoo = json["~foo"]; // OK

Pivot:
Object json = JSONSerializer.parse("{ '~foo' : 'bar' }");
Object tildeFoo = JSON.get(json, "json.~foo"); // not OK
Object tildeFoo = JSON.get(json, "json['~foo']"); // OK



> Storing to fields with data binding doesn't work
> ------------------------------------------------
>
>                 Key: PIVOT-549
>                 URL: https://issues.apache.org/jira/browse/PIVOT-549
>             Project: Pivot
>          Issue Type: Bug
>          Components: core-beans
>    Affects Versions: 1.5
>            Reporter: Michael Allman
>         Attachments: Field_Bug.tgz
>
>
> Pivot allows you to prefix a textKey attribute value with a "~" to indicate that that property should be accessed via the object's field.  Currently, it doesn't work.  When I try to do it, I get an IllegalArgumentException: Illegal identifier character.
> I'm attaching a test case Eclipse project.  Run FieldBug, put some stuff in the fields or not, and press "Store".  You should see the exception.  Set a breakpoint on the JSON.split method and rerun the app in the debugger.  Step through and you'll see where the exception is being thrown.
> Cheers.

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


[jira] Updated: (PIVOT-549) Storing to fields with data binding doesn't work

Posted by "Michael Allman (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/PIVOT-549?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Michael Allman updated PIVOT-549:
---------------------------------

    Attachment: Field_Bug.tgz

Test case

> Storing to fields with data binding doesn't work
> ------------------------------------------------
>
>                 Key: PIVOT-549
>                 URL: https://issues.apache.org/jira/browse/PIVOT-549
>             Project: Pivot
>          Issue Type: Bug
>          Components: core-beans
>    Affects Versions: 1.5
>            Reporter: Michael Allman
>         Attachments: Field_Bug.tgz
>
>
> Pivot allows you to prefix a textKey attribute value with a "~" to indicate that that property should be accessed via the object's field.  Currently, it doesn't work.  When I try to do it, I get an IllegalArgumentException: Illegal identifier character.
> I'm attaching a test case Eclipse project.  Run FieldBug, put some stuff in the fields or not, and press "Store".  You should see the exception.  Set a breakpoint on the JSON.split method and rerun the app in the debugger.  Step through and you'll see where the exception is being thrown.
> Cheers.

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