You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Ma...@rrd.com on 2004/05/14 18:36:24 UTC

Cocoon Forms v3 onClick

Hi all,

I have a FlowScript that uses Cocoon Forms.  I sets the onClick function 
of an Action widget like so:

  var wid = form.getWidget();
  wid.submit.onClick = function() {
    form.save(occ);
    occ.store(occ.getMetaData());
  }

I recently switched from Cocoon Forms v2 to v3 to take advantage of the 
multiple bindings feature.  Suddenly the FlowScript fails on the line 
wid.submit.onClick = function().

Anybody know what is going on?
Does  form.getWidget() return something different in v3?

Thanks

Mark

Re: Cocoon Forms v3 onClick

Posted by Bruno Dumon <br...@outerthought.org>.
On Fri, 2004-05-14 at 18:36, Markx.Johnson@rrd.com wrote:
> Hi all,
> 
> I have a FlowScript that uses Cocoon Forms.  I sets the onClick
> function of an Action widget like so:
> 
>   var wid = form.getWidget();
>   wid.submit.onClick = function() {
>     form.save(occ);
>     occ.store(occ.getMetaData());
>   }
> 
> I recently switched from Cocoon Forms v2 to v3 to take advantage of
> the multiple bindings feature.  Suddenly the FlowScript fails on the
> line wid.submit.onClick = function().
> 
> Anybody know what is going on?
> Does  form.getWidget() return something different in v3?

yes, the forms v3 API isn't compatible with v2.

in v3, getWidget() returns the java widget. The javascript form model is
accessible via the property form.model, thus where you previously used
form.getWidget(), now use form.model

Furthermore, onClick has been renamed to onActivate (and may be renamed
to onAction in the future, which would fit better).

-- 
Bruno Dumon                             http://outerthought.org/
Outerthought - Open Source, Java & XML Competence Support Center
bruno@outerthought.org                          bruno@apache.org


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