You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by christian bindeballe <ot...@gmail.com> on 2006/06/28 21:38:41 UTC

portal > binding forms error

Hi there,

I am trying to edit a file with a form inside the portal. I have the
form-definition -template and -binding all set up. I used the JavaScript
Debugger to sort out where the problem occurs, and it seems that the
binding doesn't work properly. I get an exception in Form.js in line 236
and the error message I get says:

org.apache.cocoon.forms.binding.BindingException: Cannot build binding
at file:/D:/my/path/to/cocoon/abbrev/scrum_bind_xml.xml:25:56

The line in the binding document is this one:

<fb:javascript id="id" path="@id" direction="save">

and pos. 56 is right in the word "direction".

does direction "save" in this on-bind element work together with the
attribute "save" in the identity-element? or do they collide? (see below)

I got this from the form-binding sample and adapted it to my
data-document (i.e. changing the element name from contact to member), I
thought it was necessary, but maybe I don't need it?

<fb:identity>
 <fb:value id="id" path="@id" direction="load">
  <fd:convertor datatype="long" />
 </fb:value>
</fb:identity>

<fb:on-bind><!-- executed on updates AND right after the insert -->
 <fb:javascript id="id" path="@id" direction="save">
  <fb:save-form>
   var appValue = jxpathPointer.getValue();
   if (appValue == '') {
    var precSiblId =
jxpathContext.getValue("../preceding-sibling::member/@id");
    var newId = Number(precSiblId) + 2
    jxpathPointer.setValue(newId.toFixed(0));
   }
  </fb:save-form>
 </fb:javascript>

 <fb:value id="team_member-name" path="name"/>
 <fb:value id="team_member-contact" path="contact"/>
</fb:on-bind>


I hope someone can help me out here, I am kind of confused as to what
all this does.

thank you all in advance,

christian


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


Re: portal > binding forms error

Posted by christian bindeballe <ot...@gmail.com>.
ok, I got rid of all <fb:javascript> inside this <fb:on-bind> and now it
works again. strange.

> <fb:on-bind><!-- executed on updates AND right after the insert -->
>  <fb:javascript id="id" path="@id" direction="save">
>   <fb:save-form>
>    var appValue = jxpathPointer.getValue();
>    if (appValue == '') {
>     var precSiblId =
> jxpathContext.getValue("../preceding-sibling::member/@id");
>     var newId = Number(precSiblId) + 2
>     jxpathPointer.setValue(newId.toFixed(0));
>    }
>   </fb:save-form>
>  </fb:javascript>
> 
>  <fb:value id="team_member-name" path="name"/>
>  <fb:value id="team_member-contact" path="contact"/>
> </fb:on-bind>
> 

still I cannot edit a file via a binding form inside my portal. and I
don't get any errors in my cocoon.log nor portal.log. the debugger shows
that all functions are executed fine, no exceptions, but when cocoon
comes to the point where it should display the page, the functions are
exited, but the page doesn't show. I compared the logs for the same page
when accessed inside and outside the portal, and they didn't show any
key differences, except that displaying the form in one is called via a
cocoon-portal-events and in the other by the URI, for which the reason
is obvious. but still I don't get what I have done wrong, or where I
could look, since there are no error messages. I can post the logs, if
anyone wants to see them, but this seems to me to be a more general error.
any ideas anyone?

TIA

christian

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