dev@woodstock.java.net

Re: autoValidate problem.

From: Steven Bell <bell.steven_at_gmail.com>
Date: Wed, 17 Oct 2007 15:36:08 -0700

I do have the "setTimeout('init();', 0);"

I am using facelets 1.1.13. I'm using build 14 of the woodstock components.
I do see the com_sun_faces_ajax-max.js in the jar. The
com_sun_faces_ajax.js file wasn't actually an uncompressed version, I just
ran it through a formatter after having this problem so I could see what the
javascript was trying to do and manually put it in the jar. That doesn't
seem to have affected the behavior at all.

On 10/17/07, Dan Labrecque <Dan.Labrecque_at_sun.com> wrote:
>
> Are you using facelets, by chance? What build are you working with? I ask
> because we recently updated the Dynamic Faces jar to RC4, which could
> address your issue. I suspect you're using an older build because you should
> see a file named com_sun_faces_ajax-max.js The uncompressed version is now
> only downloaded during debug mode.
>
> Dan
>
> Steven Bell wrote:
>
> Hello,
>
> I'm trying to get autoValidate to work on a textField, modeled after the
> payment page in the example app, and I keep running into a javascript error.
>
> The error is coming out of the com_sun_faces_ajax.js file in the
> jsf-extensions-dynamic-faces-0.1.jar. It is "I has no properties". The
> javascript that throws the error is:
>
> ...
> var I = G.getElementsByTagName("components")[0];
> var C = I.getElementsByTagName("render"); <---- I appears to be null
> here.
> for(var F = 0; F < C.length; F++) {
> ...
>
> Here is the textField code:
>
> <w:form id="PayableForm">
> <w:textField style="display:none;" />
> <w:message for="vendorGci" />
> <w:label id="vendorGciLabel" for="vendorGci" text="Vendor: "
> />
> <w:textField id="vendorGci" autoValidate="true"
> text="${vendorBean.searchGci}" maxlength="8"
> required="true"
> validatorExpression="#{ vendorBean.validateVendor}" />
>
>
> Here is the javascript in the page (the init function is called from the
> onLoad of the body, this does happen):
>
> <w:script type="text/javascript">
> function VendorListener(){
> }
>
> function VendorNotify(props){
> alert("VendorNotify called!"); <--------------- I never see
> this alert message
> if ( props.id != "PayableForm:vendorGci") { return; }
>
> var field = document.getElementById("PayableForm:vendorGciLabel");
> field.setProps({
> valid: props.valid
> });
> }
>
> VendorListener.prototype.notify = VendorNotify;
>
> function initAccountRows(){
> var table = document.getElementById
> ("PayableForm:vendorAccountTable");
> table.initAllRows();
> }
>
> function init(){
> initAccountRows();
>
> var listener = new VendorListener();
> dojo.subscribe(
> webui.suntheme.widget.textField.event.validation.endTopic ,
> listener, listener.notify);
> }
>
> Here is the validator method. It currently doesn't do anything, just
> trying to get something to work. I never see the output, and I never hit
> the breakpoint in the method.
>
> public void validateVendor(FacesContext context, UIComponent comp,
> Object value){
> System.out.println("**********************************");
> System.out.println("validateVendor called");
> System.out.println(value);
> System.out.println("**********************************");
> }
>
>
> I attached a screenshot of firebug running and catching the error. The
> line number listed is because I used the javascript formatter from here:
>
> http://javascript.about.com/b/a/176259.htm
>
> To reformat the com_sun_faces_ajax.js so I could get some idea of where it
> was failing.
>
> Any help or ideas would be greatly appreciated.
>
> --
> Thanks,
>
> Steven Bell
> ------------------------------
>
> ------------------------------
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe_at_woodstock.dev.java.net
> For additional commands, e-mail: dev-help_at_woodstock.dev.java.net
>
>
>
>


-- 
Regards,
Steven Bell