[richfaces-issues] [JBoss JIRA] Commented: (RF-10940) Client side validation refers to non existing javascript function

Niels Soeffers (JIRA) jira-events at lists.jboss.org
Thu May 12 02:14:18 EDT 2011


    [ https://issues.jboss.org/browse/RF-10940?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12601559#comment-12601559 ] 

Niels Soeffers commented on RF-10940:
-------------------------------------

Apparently it is not the exact same issue, however I do think we discovered a very related one.
Don't know if I have to log a new issue for this, or reopen the original one?
When logging the original bug we only made use of the rich:validator. And that rich validator was responsible for creating a javascript function. Which is still okay in the nightly build. My apologies for my previous comment on that. What we discovered now is that when we leave the rich:validator but we remove the @NotNull from the class, and replace the @NotNull by a required="true" attribute on the rich:inputField then the "required" attribute is going to do an ajax call in the function (groupName_3av). However here we see the same problem appearing as we did before with the client side validation. That is everything is going well as long as we don't rerender the form. When we rerender the form the function is renamed as with the client side validation but is not defined. 

> Client side validation refers to non existing javascript function
> -----------------------------------------------------------------
>
>                 Key: RF-10940
>                 URL: https://issues.jboss.org/browse/RF-10940
>             Project: RichFaces
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>          Components: component-validators
>    Affects Versions: 4.0.0.Final
>            Reporter: Niels Soeffers
>            Assignee: Pavel Yaschenko
>            Priority: Critical
>              Labels: tran
>             Fix For: 4.1.0.Milestone1
>
>
> Client Side Javascript functions are called on the component tags (for example onChange attribute) and defined at the bottom of the rendered page. We encountered a case where the function called in the onchange attribute is not defined at the bottom of the page.
> Our domain layer contains two different classes RG and SRG (they do not inherit from each other). However they both embed an embeddable class E with a field "name"
> In the GUI we have a page with a single form and two regions. One for adding a RG object and one for adding a SRG object. Both regions contain a h:inputText for the "name" field. So the first inputText is bound to {{RG.embedded.name}} and the second on {{SRG.embedded.name}}. Both inputTexts have a rich:validator tag as a child component.
> When the page is initially rendered both h:inputText have the same javascript function referred to in their onchange attribute (RGName_3Av). 
> Which is not wrong because the validation (@NotNull on the "name" field in the Embedded class) is the same for both value bindings. It is a little bit confusing to see a method with a name of RGName_3Av on a component that is actually bound to SRG and so we would expect the method to call SRGName_3Av, but it's certainly not wrong and I even find it a very nice optimization.
> However when we click on an a:commandButton in the second region and rerender this second region, then suddenly the javascript function in the onchange attribute of the second inputText is changed and the name refers to the SRG component (SRGName_3Av), but this javascript method is never defined, because it was optimized when we initially rendered the complete page.
> Hope you can reproduce the problem with the above description and fix the problem or provide a workaround?
> Kind Regards,
> Niels

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the richfaces-issues mailing list