cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gary Larsen" <gary.lar...@envisn.com>
Subject CForms hide button on load
Date Fri, 20 Jan 2006 18:39:41 GMT
Hi,

I'm stuck on something simple again.

I want to hide a button widget if the value of a boolean field is false on
form load. I'm trying using <fd:on-create>:

  <fd:form>
    <fd:on-create>
      <fd:javascript>
        var widgetStateInvisible =
org.apache.cocoon.forms.formmodel.WidgetState.INVISIBLE;
        var thisForm = event.source.form;

        if (!thisForm .lookupWidget("okToSync").getValue) {
            thisForm.lookupWidget("submitButton").state =
widgetStateInvisible;
        }
     </fd:javascript>
   </fd:on-create>

It appears that I'm able to get a reference to the "okToSync" wigdet (it's
not null) but the value is null, I'm assuming because it is not loaded yet.

Thanks for any help,
Gary


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message