Hi Marc my Cform is binded to an XML document, This is the part we are concirned with : <fb:repeater id="uploads" parent-path="newuploads" row-path="upload"> <rooms> <room id="1"> <newuploads> <upload path=""/> <upload path=""/>..etc <newuploads> </room> <room id="2"> <newuploads> <upload path=""/> <newuploads> </room> </rooms>
******************************************* <fb:on-bind> <fb:javascript id="path" path="@path" direction="save"> <fb:save-form> if(widget.getValue() != null){ var roomid = jxpathContext.parentContext.getValue("../../@id"); var formValue = "/room"+roomid+"/"+widget.getValue().getHeaders().get("filename"); jxpathPointer.setValue(formValue); } </fb:save-form></fb:javascript></fb:on-bind> As you can see my @path should be relative to the room it is in So on bind I would like to retreive the id of the room it is in ;) but I cant go back further than <upload> which is the parentContext on the JXPathContext, var roomid = jxpathContext.getValue("../../@id") doesn't work , neither does the one above ??? is this possible or do I really have to do a post bind transformation ?? I'm sure there's a way to XPoint at the whole binded document?? Thanks for the help Tibor Marc Portier wrote: > > > oceatoon wrote: > >> Hello every one >> >> I've allready posted about this earlier, with no answer, I desperatly >> post it again because this is something I really need for a cforms >> function and I'm sure it's just some guidance away. >> >> on javascript binding a widget, I need to get some data that is outside >> the JXPathcontext. I noticed the parentContext points to the tag I bound >> my widget with. I don't need to go far, the info I need is one xpath >> parent higher :) but how to access it??? >> I tried everything I could think off >> getValue("../../@id"); nop >> parentContext(./@id) is my widgets one >> > > this depends on the structure (xml or bean) you want to bind to, maybe > you can provide some details on that and dump the relevant parts of your > current binding file explaining what works different to what you expect. > > regards, > -marc= > >> Thanx >> >> Tibor >> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: [EMAIL PROTECTED] >> For additional commands, e-mail: [EMAIL PROTECTED] >> > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]