You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by oceatoon <t....@systheo.com> on 2004/08/23 17:47:19 UTC

CForm Binding javascript on save JXPathContext

Hello everyone 

I am doing XML binding.
On bind save, in a fb:javascript 
I would like to retreive information outside the context of my widget in the
binded document?? But it seems JXPathContext points only to the piece of
the document that concerns him ?? Is this true? 
Having binded my form to the document below, and a repeater widget "totos"
row "toto" to @path , I would like to retreive doc/name/@id on the save
bind of the toto row  but this doesn't seem to work, I cannot go beyond
"totos"

<fb:repeater id="totos" parent-path="totos" row-path="toto">
 <fb:javascript id="toto" path="@path" direction="save">
 <fb:save-form> 
    if(widget.getValue() != null){
      var name = jxpathContext.getValue("../../name/@id"));
      var formValue = name + widget.getValue().getHeaders().get("filename");
      jxpathPointer.setValue(formValue); 
       }
 </fb:save-form>
</fb:javascript>
 ...

document:
<doc>
        <name id="coco">

        <totos>
        <toto path ="blabla.jpg">
        <toto path ="111_blabla.jpg">
        </totos>

        </name> 
</doc>

I dont know If this is very clear, sorry
Does jxpathContext contain all the binded document? or just the specific
piece concerning the widget?
Thanks for the help
Tibor


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