ClientValidatorRendererunit tests and implementation.
-----------------------------------------------------

                 Key: RF-9507
                 URL: https://jira.jboss.org/browse/RF-9507
             Project: RichFaces
          Issue Type: Task
      Security Level: Public (Everyone can see)
          Components: component-a4j-core
            Reporter: Alexander Smirnov
            Assignee: Alexander Smirnov
             Fix For: 4.0.0.Milestone4


ClientValidator renderer getScript method:

    * performs arguments check ( not null, behavior is instance of 
ClientValidatorBehavior.
    * get Converter instance from behavior by getConverter method, then use 
ClientScriptLookupService to find client-side JavaScript. Both 
ConverterNotFoundException and ScriptNotFoundException enforce AJAX callback 
rendering unless input component has no validators.
    * If Converter script found, get Collection of validators from behavior. If 
collection is empty, return null instead of script. Otherwise, loop through all 
validators to construct client-side validator function, using 
ClientScriptLookupService. Record number of validators that cannot be performed 
on client.
    * If there is no Converter script or at least one validator has no 
client-side version, add AJAX callback to client-side validator.
    * Find or Create UIValidatorScript in UIView.viewResources associated with 
"form" target. Create ScriptObject that will be used to build validator call. 
If UIValidatorScript already contains ScriptObject with same signature use its 
function name for page size optimization.  Problem: JSF 2.0 doesn't like 
components tree changes, and specification does not allow dynamic including of 
script libraries. At least, it seems not possible to change controls with 
client-side validation by AJAX. Solution: use the same way as queue component ( 
create UIValidatorScript in ViewHandler )
    * Return JavaScript code that calls function build by ScriptObject.

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

        
_______________________________________________
richfaces-issues mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/richfaces-issues

Reply via email to