You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by "Carsten Ziegeler (JIRA)" <ji...@apache.org> on 2006/12/16 16:50:23 UTC

[jira] Closed: (COCOON-1916) viewData is undefined in event handler when event is triggered outside showForm/sendPageAndWait

     [ http://issues.apache.org/jira/browse/COCOON-1916?page=all ]

Carsten Ziegeler closed COCOON-1916.
------------------------------------

    Fix Version/s: 2.2-dev (Current SVN)
                   2.1.10-dev (current SVN)
       Resolution: Fixed

The viewData is now always set; if it's not available it is set to null.

> viewData is undefined in event handler when event is triggered outside showForm/sendPageAndWait
> -----------------------------------------------------------------------------------------------
>
>                 Key: COCOON-1916
>                 URL: http://issues.apache.org/jira/browse/COCOON-1916
>             Project: Cocoon
>          Issue Type: Bug
>          Components: Blocks: Forms
>    Affects Versions: 2.1.8, 2.1.9, 2.1.10-dev (current SVN)
>            Reporter: Rob Berens
>         Assigned To: Carsten Ziegeler
>            Priority: Minor
>             Fix For: 2.2-dev (Current SVN), 2.1.10-dev (current SVN)
>
>
> When calling a java script snippet defined in the form description file, viewData is passed in the context as long as viewData is available from the objectModel and is not null. This makes it difficult to reliably use viewData in the snippet. Consider the case where you create a form and then dynamically assign some values to some widgets before actually showing the form. This results in value-changed events to be fired with viewData undefined in the context of the listener. Then using viewData in the snippet results in a reference error. If the event is fired from a sendPageAndWait context, viewData is neatly passed.
> The problem is how to distinguish this in the event handler. It would be better to always pass viewData be it a null value some times. Then a simple test viewData == null could be used in the event handler. Note that viewData is also null when sendPageAndWait is called with only one parameter.
> This problem occurs on line 69 in o.a.c.forms.event.impl.JavaScriptWidgetListener.java.
> Is this a bug or is there some intentional use?

-- 
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