[
https://jira.jboss.org/browse/RF-9216?page=com.atlassian.jira.plugin.syst...
]
Alexander Smirnov updated RF-9216:
----------------------------------
Labels: client_side_validator (was: )
Description:
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.
Complexity: Medium
CSV: server side development
----------------------------
Key: RF-9216
URL:
https://jira.jboss.org/browse/RF-9216
Project: RichFaces
Issue Type: Sub-task
Security Level: Public(Everyone can see)
Components: component-a4j-core
Affects Versions: 4.0.0.Milestone2
Reporter: Ilya Shaikovsky
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