You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by "geert-jan brits (JIRA)" <de...@tapestry.apache.org> on 2007/11/29 11:12:43 UTC

[jira] Created: (TAPESTRY-1939) DataField component throws js error: 'afterUpdateElement is not a function'

DataField component throws js error: 'afterUpdateElement is not a function'
---------------------------------------------------------------------------

                 Key: TAPESTRY-1939
                 URL: https://issues.apache.org/jira/browse/TAPESTRY-1939
             Project: Tapestry
          Issue Type: Bug
          Components: Core Components
    Affects Versions: 5.0.6
         Environment: -
            Reporter: geert-jan brits


DateField is Tapestry 5 is based on the excellent dynarch.com DHTML/JavaScript Calendar. This calendar provides hooks for javascript callback functions. 

Currently it's not possible to define such an clientside javascript function because the method JSONObject#valueToString is always quoting all the elements of the json object, while javascript expects a reference to a javascript function

Therefore the js-error:  "... not a function" is given.

For example: what is needed is: 
Calendar.setup({"inputField":"a","ifFormat":"%d-%m-%y","button":"a:trigger","onUpdate":afterUpdateElement});

while DateField outputs: 
Calendar.setup({"inputField":"a","ifFormat":"%d-%m-%y","button":"a:trigger","onUpdate":"afterUpdateElement"}); // <-- difference is in the quotes round afterUpdateElement

issue is similar to TAPESTRY-1795 (tapestry 4)

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


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


[jira] Commented: (TAPESTRY-1939) DateField can not leverage full Calendar behavior because it only supports JSON, not full JavaScript hash, for configuring the Calendar

Posted by "Davor Hrg (JIRA)" <de...@tapestry.apache.org>.
    [ https://issues.apache.org/jira/browse/TAPESTRY-1939?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12547063 ] 

Davor Hrg commented on TAPESTRY-1939:
-------------------------------------

not allowing references may be good...
but nevertheless I like to have my options open.

add this class to your classpath,

    static class JSONRef extends JSONArray{
        private final String _ref;
        public JSONRef(String ref) {
            _ref = ref;
        }
        
        public String toString() {
            return _ref;
        }
    }

then you can use,
        JSONObject jo = new JSONObject();
        jo.put("str", "bla");
        jo.put("func", new JSONRef("myFunc"));
        
        System.out.println(jo.toString());//QDEBUG remove

of course you don't have to use the default JSON support, but your own lib...
.. something that will make json code out of JAvaBeans...
so long as tapestry leaves this part open for tweaking :)




> DateField can not leverage full Calendar behavior because it only supports JSON, not full JavaScript hash, for configuring the Calendar
> ---------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: TAPESTRY-1939
>                 URL: https://issues.apache.org/jira/browse/TAPESTRY-1939
>             Project: Tapestry
>          Issue Type: Bug
>          Components: Core Components
>    Affects Versions: 5.0.6
>         Environment: -
>            Reporter: geert-jan brits
>
> DateField is Tapestry 5 is based on the excellent dynarch.com DHTML/JavaScript Calendar. This calendar provides hooks for javascript callback functions. 
> Currently it's not possible to define such an clientside javascript function because the method JSONObject#valueToString is always quoting all the elements of the json object, while javascript expects a reference to a javascript function
> Therefore the js-error:  "... not a function" is given.
> For example: what is needed is: 
> Calendar.setup({"inputField":"a","ifFormat":"%d-%m-%y","button":"a:trigger","onUpdate":afterUpdateElement});
> while DateField outputs: 
> Calendar.setup({"inputField":"a","ifFormat":"%d-%m-%y","button":"a:trigger","onUpdate":"afterUpdateElement"}); // <-- difference is in the quotes round afterUpdateElement
> issue is similar to TAPESTRY-1795 (tapestry 4)

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


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


[jira] Closed: (TAPESTRY-1939) DateField can not leverage full Calendar behavior because it only supports JSON, not full JavaScript hash, for configuring the Calendar

Posted by "Howard M. Lewis Ship (JIRA)" <de...@tapestry.apache.org>.
     [ https://issues.apache.org/jira/browse/TAPESTRY-1939?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Howard M. Lewis Ship closed TAPESTRY-1939.
------------------------------------------

    Resolution: Invalid
      Assignee: Howard M. Lewis Ship

Because of TAPESTRY-2069, this is no longer relevant; we now have a less functional date picker, but one with the proper license for use as part of Tapestry.

> DateField can not leverage full Calendar behavior because it only supports JSON, not full JavaScript hash, for configuring the Calendar
> ---------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: TAPESTRY-1939
>                 URL: https://issues.apache.org/jira/browse/TAPESTRY-1939
>             Project: Tapestry
>          Issue Type: Bug
>          Components: Core Components
>    Affects Versions: 5.0.6
>         Environment: -
>            Reporter: geert-jan brits
>            Assignee: Howard M. Lewis Ship
>
> DateField is Tapestry 5 is based on the excellent dynarch.com DHTML/JavaScript Calendar. This calendar provides hooks for javascript callback functions. 
> Currently it's not possible to define such an clientside javascript function because the method JSONObject#valueToString is always quoting all the elements of the json object, while javascript expects a reference to a javascript function
> Therefore the js-error:  "... not a function" is given.
> For example: what is needed is: 
> Calendar.setup({"inputField":"a","ifFormat":"%d-%m-%y","button":"a:trigger","onUpdate":afterUpdateElement});
> while DateField outputs: 
> Calendar.setup({"inputField":"a","ifFormat":"%d-%m-%y","button":"a:trigger","onUpdate":"afterUpdateElement"}); // <-- difference is in the quotes round afterUpdateElement
> issue is similar to TAPESTRY-1795 (tapestry 4)

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


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


[jira] Updated: (TAPESTRY-1939) DateField can not leverage full Calendar behavior because it only supports JSON, not full JavaScript hash, for configuring the Calendar

Posted by "Howard M. Lewis Ship (JIRA)" <de...@tapestry.apache.org>.
     [ https://issues.apache.org/jira/browse/TAPESTRY-1939?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Howard M. Lewis Ship updated TAPESTRY-1939:
-------------------------------------------

    Summary: DateField can not leverage full Calendar behavior because it only supports JSON, not full JavaScript hash, for configuring the Calendar  (was: DataField component throws js error: 'afterUpdateElement is not a function')

Would it be possible to perform some of the setup (such as binding the onUpdate handler) as additional JavaScript after Tapestry has performed its initialization?



> DateField can not leverage full Calendar behavior because it only supports JSON, not full JavaScript hash, for configuring the Calendar
> ---------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: TAPESTRY-1939
>                 URL: https://issues.apache.org/jira/browse/TAPESTRY-1939
>             Project: Tapestry
>          Issue Type: Bug
>          Components: Core Components
>    Affects Versions: 5.0.6
>         Environment: -
>            Reporter: geert-jan brits
>
> DateField is Tapestry 5 is based on the excellent dynarch.com DHTML/JavaScript Calendar. This calendar provides hooks for javascript callback functions. 
> Currently it's not possible to define such an clientside javascript function because the method JSONObject#valueToString is always quoting all the elements of the json object, while javascript expects a reference to a javascript function
> Therefore the js-error:  "... not a function" is given.
> For example: what is needed is: 
> Calendar.setup({"inputField":"a","ifFormat":"%d-%m-%y","button":"a:trigger","onUpdate":afterUpdateElement});
> while DateField outputs: 
> Calendar.setup({"inputField":"a","ifFormat":"%d-%m-%y","button":"a:trigger","onUpdate":"afterUpdateElement"}); // <-- difference is in the quotes round afterUpdateElement
> issue is similar to TAPESTRY-1795 (tapestry 4)

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


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


[jira] Commented: (TAPESTRY-1939) DateField can not leverage full Calendar behavior because it only supports JSON, not full JavaScript hash, for configuring the Calendar

Posted by "Howard M. Lewis Ship (JIRA)" <de...@tapestry.apache.org>.
    [ https://issues.apache.org/jira/browse/TAPESTRY-1939?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12555462#action_12555462 ] 

Howard M. Lewis Ship commented on TAPESTRY-1939:
------------------------------------------------

I've looked into using net.sf.json-lib as a replacement for T5's JSON code ... but the docs and code don't match and it sucks in a bunch of unwanted dependencies, such as commons-logging.

> DateField can not leverage full Calendar behavior because it only supports JSON, not full JavaScript hash, for configuring the Calendar
> ---------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: TAPESTRY-1939
>                 URL: https://issues.apache.org/jira/browse/TAPESTRY-1939
>             Project: Tapestry
>          Issue Type: Bug
>          Components: Core Components
>    Affects Versions: 5.0.6
>         Environment: -
>            Reporter: geert-jan brits
>
> DateField is Tapestry 5 is based on the excellent dynarch.com DHTML/JavaScript Calendar. This calendar provides hooks for javascript callback functions. 
> Currently it's not possible to define such an clientside javascript function because the method JSONObject#valueToString is always quoting all the elements of the json object, while javascript expects a reference to a javascript function
> Therefore the js-error:  "... not a function" is given.
> For example: what is needed is: 
> Calendar.setup({"inputField":"a","ifFormat":"%d-%m-%y","button":"a:trigger","onUpdate":afterUpdateElement});
> while DateField outputs: 
> Calendar.setup({"inputField":"a","ifFormat":"%d-%m-%y","button":"a:trigger","onUpdate":"afterUpdateElement"}); // <-- difference is in the quotes round afterUpdateElement
> issue is similar to TAPESTRY-1795 (tapestry 4)

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


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