[ 
https://issues.apache.org/jira/browse/TAPESTRY-1379?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Andrea Chiumenti updated TAPESTRY-1379:
---------------------------------------


Hello,
Happy Easter!

I've found a cleaner solution to this problem.

A change to:
org.apache.tapestry.form. FormSupportImpl#render(String, IRender, ILink, 
String, Integer) should be done:
on the last instruction:

if (_form.isClientValidationEnabled()) {
            _pageRenderSupport.addDojoIncludes("tapestry.widget.Widget");
            _pageRenderSupport.addDojoIncludes("tapestry.form");
            _pageRenderSupport.addInitializationScript(_form, 
"dojo.require('tapestry.widget.Widget');dojo.require('tapestry.form');tapestry.form.clearProfiles('"
                    + formId + "'); tapestry.form.registerProfile('" + formId + 
"'," 
                    + _profile.toString() + ");");
        }

This solves the problem above and appears to be a cleaner solution to it.

A remark I'd like to do is the following:

When we render a page in the last script all the code is made into 
dojo.addOnLoad into this function whe have the dojo.require calls too.

Wouldn't be better to have calls to dojo.require outside the addOnLoad 
function, this shoul be a cleaner approach.

If yes, would you like me to refactor the code ?

kiuma


> Exception when creating widgets on AJAX requests
> ------------------------------------------------
>
>                 Key: TAPESTRY-1379
>                 URL: https://issues.apache.org/jira/browse/TAPESTRY-1379
>             Project: Tapestry
>          Issue Type: Bug
>          Components: JavaScript
>    Affects Versions: 4.1.1, 4.1.2
>         Environment: any
>            Reporter: Andrea Chiumenti
>         Assigned To: Jesse Kuhnert
>             Fix For: 4.1.2
>
>         Attachments: WidgetDemo-1.0.0-SNAPSHOT-src.zip
>
>
> Teh problem is this:
> when you have a page with a form that initially doesn't display any widget 
> and, on form ajax submission you want to display a widget, if you use client 
> side validation you'll get this exception on next submit if a client 
> validation exception is fired:
> ERROR: 14:35:46: Error validating Error : Could not locate widget 
> implementation for "alertdialog" in "tapestry.widget" registered to namespace 
> "tapestry" : http://localhost:8080/app?service=asset&path=%2Fdojo%2Fdojo.js : 
> line 756

-- 
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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to