Re: Woody binding: save/load-form not triggered
On Wed, 2004-07-28 at 10:38, Gunter D'Hondt wrote: I've got the following binding definition but the save-form and load-form is never triggered (or is doesn't have any effect anyway): bnd:value id=field1 path=field1/value bnd:on-update bnd:javascript id=field1 path=field1/value bnd:load-form var appValue = jxpathPointer.getValue(); if (appValue==||appValue==null) appValue=0; widget.setValue(appValue); /bnd:load-form bnd:save-form var formValue = widget.getValue(); if (formValue==||formValue==null) jxpathPointer.setValue(0); else jxpathPointer.setValue(appValue); /bnd:save-form /bnd:javascript /bnd:on-update /bnd:value Any help is welcome! Simply put the javascript binding outside of the value binding, you don't need the value binding at all. -- Bruno Dumon http://outerthought.org/ Outerthought - Open Source, Java XML Competence Support Center [EMAIL PROTECTED] [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Woody binding: save/load-form not triggered
I've removed the value binding and just put a _javascript_-binding inside my repeater but still no action is triggered (only the other value bindings are logging). I've got other bindings where the _javascript_ inside the value binding does work; like this one: bnd:value id=name path=customername bnd:on-update bnd:_javascript_ id=name path=.. bnd:load-form/ bnd:save-form var wsfield = jxpathContext.getPointer('country'); wsfield.setValue(159); /bnd:save-form /bnd:_javascript_ /bnd:on-update /bnd:value But that only works for jxpath's not equal to the one of the value binding; so I cannot change the customername but only the country. Is the _javascript_-binding recently added coz I'm working on a cvshead from 12/May ? Regards, Gunter Bruno Dumon [EMAIL PROTECTED] 29/07/2004 10:03 Please respond to [EMAIL PROTECTED] To [EMAIL PROTECTED] cc Subject Re: Woody binding: save/load-form not triggered On Wed, 2004-07-28 at 10:38, Gunter D'Hondt wrote: I've got the following binding definition but the save-form and load-form is never triggered (or is doesn't have any effect anyway): bnd:value id=field1 path=field1/value bnd:on-update bnd:_javascript_ id=field1 path=field1/value bnd:load-form var appValue = jxpathPointer.getValue(); if (appValue==||appValue==null) appValue=0; widget.setValue(appValue); /bnd:load-form bnd:save-form var formValue = widget.getValue(); if (formValue==||formValue==null) jxpathPointer.setValue(0); else jxpathPointer.setValue(appValue); /bnd:save-form /bnd:_javascript_ /bnd:on-update /bnd:value Any help is welcome! Simply put the _javascript_ binding outside of the value binding, you don't need the value binding at all. -- Bruno Dumon http://outerthought.org/ Outerthought - Open Source, Java XML Competence Support Center [EMAIL PROTECTED] [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Woody binding: save/load-form not triggered
On Thu, 2004-07-29 at 10:37, Gunter D'Hondt wrote: I've removed the value binding and just put a javascript-binding inside my repeater but still no action is triggered (only the other value bindings are logging). I've got other bindings where the javascript inside the value binding does work; like this one: bnd:value id=name path=customername bnd:on-update bnd:javascript id=name path=.. bnd:load-form/ bnd:save-form var wsfield = jxpathContext.getPointer('country'); wsfield.setValue(159); /bnd:save-form /bnd:javascript /bnd:on-update /bnd:value But that only works for jxpath's not equal to the one of the value binding; so I cannot change the customername but only the country. Is the javascript-binding recently added coz I'm working on a cvshead from 12/May ? No, it's been there for a long time. I recommend switching to CForms though (it's just some XML namespace and java package names that need updating, see info on the wiki). -- Bruno Dumon http://outerthought.org/ Outerthought - Open Source, Java XML Competence Support Center [EMAIL PROTECTED] [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Woody binding: save/load-form not triggered
Consider this issue solved; apparently if value binding and _javascript_ binding is performed on the same formfield (or binding field) then a subnode is made; so the result is: customername customername.../customername /customername Regards, Gunter Gunter D'Hondt [EMAIL PROTECTED] 29/07/2004 10:37 Please respond to [EMAIL PROTECTED] To [EMAIL PROTECTED] cc Subject Re: Woody binding: save/load-form not triggered I've removed the value binding and just put a _javascript_-binding inside my repeater but still no action is triggered (only the other value bindings are logging). I've got other bindings where the _javascript_ inside the value binding does work; like this one: bnd:value id=name path=customername bnd:on-update bnd:_javascript_ id=name path=.. bnd:load-form/ bnd:save-form var wsfield = jxpathContext.getPointer('country'); wsfield.setValue(159); /bnd:save-form /bnd:_javascript_ /bnd:on-update /bnd:value But that only works for jxpath's not equal to the one of the value binding; so I cannot change the customername but only the country. Is the _javascript_-binding recently added coz I'm working on a cvshead from 12/May ? Regards, Gunter Bruno Dumon [EMAIL PROTECTED] 29/07/2004 10:03 Please respond to [EMAIL PROTECTED] To [EMAIL PROTECTED] cc Subject Re: Woody binding: save/load-form not triggered On Wed, 2004-07-28 at 10:38, Gunter D'Hondt wrote: I've got the following binding definition but the save-form and load-form is never triggered (or is doesn't have any effect anyway): bnd:value id=field1 path=field1/value bnd:on-update bnd:_javascript_ id=field1 path=field1/value bnd:load-form var appValue = jxpathPointer.getValue(); if (appValue==||appValue==null) appValue=0; widget.setValue(appValue); /bnd:load-form bnd:save-form var formValue = widget.getValue(); if (formValue==||formValue==null) jxpathPointer.setValue(0); else jxpathPointer.setValue(appValue); /bnd:save-form /bnd:_javascript_ /bnd:on-update /bnd:value Any help is welcome! Simply put the _javascript_ binding outside of the value binding, you don't need the value binding at all. -- Bruno Dumon http://outerthought.org/ Outerthought - Open Source, Java XML Competence Support Center [EMAIL PROTECTED] [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Woody binding - How to debug?
Forgot to mention that if I want to save the document I get the error: org.apache.commons.jxpath.JXPathException: Exception trying to create xpath /data/wrapper/context; java.lang.ClassCastExceptionMaybe this error is caused by the same as the missing values in form.Regards,Christian - Original Message - From: Christian Rosenberger [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, May 12, 2004 6:16 PM Subject: Woody binding - How to debug? Hello! As mentioned in another posting this morning, I try to use the Woody binding framework to bind to a XML file got by an java class. I have specified similar to the XML binding samples my sitemap: map:match pattern=form2xml.flow map:call function=woody map:parameter name=function value=form2xml/ map:parameter name=form-definition value=forms/wd_info.xml/ map:parameter name=documentURI value=http://localhost/info.xml/ map:parameter name=bindingURI value=forms/wb_info.xml/ /map:call /map:match Alternative parameter für documentURI: map:parameter name=documentURI value=cocoon:/getData?ID={request-param:ID}/ My form appears, but without any data filled in. How can I debug the binding? There is no logging in WEB-INF/logs for the binding. Need to now, why the values are not filled in. Regards, Christian - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Woody binding - How to debug?
On 12.05.2004 18:16, Christian Rosenberger wrote: Hello! As mentioned in another posting this morning, I try to use the Woody binding framework to bind to a XML file got by an java class. My form appears, but without any data filled in. How can I debug the binding? There is no logging in WEB-INF/logs for the binding. Need to now, why the values are not filled in. Indeed a bit difficult - similar to sitemap debugging. When I had problems with binding I did remote debugging and set some break points, but of course you have to know where to set them. And the bindings *do* log, but on debug level, you might need to change your logkit.xconf. Example: http://cvs.apache.org/viewcvs.cgi/cocoon-2.1/src/blocks/forms/java/org/apache/cocoon/forms/binding/ValueJXPathBinding.java?annotate=1.7#102. Joerg - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Woody binding - How to debug?
I found the cocoon.log.info() method in flowscript to get some values. This is some kind of help to me. Saw that my input document is null. Now I have to find out why! ;-) Thanks! Regards, Christian Joerg Heinicke wrote: On 12.05.2004 18:16, Christian Rosenberger wrote: Need to now, why the values are not filled in. Indeed a bit difficult - similar to sitemap debugging. When I had problems with binding I did remote debugging and set some break points, but of course you have to know where to set them. And the bindings *do* log, but on debug level, you might need to change your logkit.xconf. Example: http://cvs.apache.org/viewcvs.cgi/cocoon-2.1/src/blocks/forms/java/org/apache/cocoon/forms/binding/ValueJXPathBinding.java?annotate=1.7#102. Joerg - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [woody binding] binding of multivalue fields supported?
Is binding of multivalue fields already supported in Woody? I cannot find any information on this at the Wiki or anywhere else on the web. I already found out myself that it was not supported in 2.1.4, but it is now in the current CVS snapshot. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Woody Binding
On Feb 12, 2004, at 7:56 AM, Ralph Goers wrote: Are there any examples of how to use Woody Binding without using FlowScript? Try the Form1 example in the Woody samples area. ~ml - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Woody Binding
On Thu, 2004-02-12 at 16:56, Ralph Goers wrote: Are there any examples of how to use Woody Binding without using FlowScript? * BindingWoodyApple.java * source of woody2.js might also prove helpful Basically just lookup the BindingManager, let it create a Binding object, and use its loadFormFromModel and saveFormToModel methods. -- Bruno Dumon http://outerthought.org/ Outerthought - Open Source, Java XML Competence Support Center [EMAIL PROTECTED] [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Woody Binding
On Feb 12, 2004, at 8:34 AM, I wrote: On Feb 12, 2004, at 7:56 AM, Ralph Goers wrote: Are there any examples of how to use Woody Binding without using FlowScript? Try the Form1 example in the Woody samples area. d'oh, my bad... belay that, I didn't see Binding in the above. Must not reply to email before morning coffee... ~ml - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: woody binding question
Worked it out. wb:value id="p" path="t" / needed to be wb:value id="p" path="." / Linc
Re: [Woody binding] Creating XML nodes in a namespace?
Uppps, the flowscript is like this (it doesn't influence the problem): //... var document = loadDocument(dirTitlePath); form.load(document); form.showForm(/form_templates/dirtitle.xml.html); form.save(document); saveDocument(document, dirTitlePath); //... - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Woody binding on XML subtree
On Mon, 20 Oct 2003 09:59:19 -0500, jcplerm wrote: Is there a way of having a Woody form being populated through the binding framework in a way that the form involves just a subtree of the original XML doc? For instance, given the following complete XML doc: root elem id=100 namename100/name addressaddress100/address /elem elem id=101 namename101/name addressaddress101/address /elem elem id=102 namename102/name addressaddress102/address /elem /root I would like a form to edit the just the subtree located by /root/[EMAIL PROTECTED]'101']. Can the binding definition file somehow be parametrized, or can something along these lines be done? It is possible to parametrize the binding file by filtering it through a JXTemplateGenerator for example. Here is an outline of the solution : In your sitemap, pass a form binding uri with value=cocoon:/bind_with The matcher for bind_with generates: map:generate type=jx src=form_bind.jx map:parameter name=parentpath value=[EMAIL PROTECTED]/ and in your form_bind.jx repeater, you will have : parent-path=${parameters.getParameter('parentpath')} -Kamal - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Woody binding on XML subtree
Hi, my approach is: create a document fragment from the original document and bind it to the woody form. after form submission reappend the fragment to the original document and save it. this is my code: try to adapt to your xml files, i'm using the position of the element i want to edit but you can use also an unique attribute. function form2xml() { var pos = cocoon.request.getParameter(pos); document=loadDocument(documentURI); var nl = document.getFirstChild().getChildNodes().item(1).getChildNodes(); for ( i = 0; i nl.getLength (); i++) { var cur_node=nl.item(i); if (cur_node.getNodeType()==1) { counter++; if (counter==pos) { var newdoc=document.createDocumentFragment(); newdoc.appendChild(cur_node); form.load(newdoc); form.show(display-edit, formHandler); form.save(newdoc); nl.item(1).getParentNode().appendChild( newdoc.getFirstChild()); saveDocument(document, documentURI); return; } } } } Hope this help. - Original Message - From: Kamal Dalal [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, January 16, 2004 10:41 AM Subject: Re: Woody binding on XML subtree On Mon, 20 Oct 2003 09:59:19 -0500, jcplerm wrote: Is there a way of having a Woody form being populated through the binding framework in a way that the form involves just a subtree of the original XML doc? For instance, given the following complete XML doc: root elem id=100 namename100/name addressaddress100/address /elem elem id=101 namename101/name addressaddress101/address /elem elem id=102 namename102/name addressaddress102/address /elem /root I would like a form to edit the just the subtree located by /root/[EMAIL PROTECTED]'101']. Can the binding definition file somehow be parametrized, or can something along these lines be done? It is possible to parametrize the binding file by filtering it through a JXTemplateGenerator for example. Here is an outline of the solution : In your sitemap, pass a form binding uri with value=cocoon:/bind_with The matcher for bind_with generates: map:generate type=jx src=form_bind.jx map:parameter name=parentpath value=[EMAIL PROTECTED]/ and in your form_bind.jx repeater, you will have : parent-path=${parameters.getParameter('parentpath')} -Kamal - 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]
Re: [Woody-binding] nested repeaters are allowed?
Antonio Gallardo wrote: Hi: Is posible to nest repeaters in the binding of a Java Bean? I am facing a database structure of type master(detailA[detailB]). I need to present it as: master (detail A) (detail B) so in order to do that, I need to nest the repeaters. Is this posible at all? good question! I've recently seen nested repeaters in template (building rows and columns) and definition and they seemed to work :-) in any case I see no conceptual reason (yet) why it should not work for the binding also of course if you have the first test case it might show some implementation bugs which I'll hapily look into just go for it and keep us posted? regards, -marc= Best Regards, Antonio Gallardo. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Marc Portierhttp://outerthought.org/ Outerthought - Open Source, Java XML Competence Support Center Read my weblog athttp://blogs.cocoondev.org/mpo/ [EMAIL PROTECTED] [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [Woody-binding] nested repeaters are allowed?
Hi Marc, thanks for the replay. I found a little trick to do so, but I am currently testing it. Maybe it would work. Who knows:-D wb:repeater id=detailA parent-path=. row-path=detailAList unique-row-id=detA_id unique-path=detA_id the usual stuff . /wb:repeater wb:repeater id=detailB parent-path=detailAList row-path=detailBList unique-row-id=detB_id unique-path=detA_id the usual stuff . /wb:repeater Note the play with attributes parent-path, row-path, unique-row-id and unique-path. I hope it would work. :-D Of course I will keep in touch with you about the success or failure. :-D Best Regards, Antonio Gallardo Marc Portier dijo: Antonio Gallardo wrote: Hi: Is posible to nest repeaters in the binding of a Java Bean? I am facing a database structure of type master(detailA[detailB]). I need to present it as: master (detail A) (detail B) so in order to do that, I need to nest the repeaters. Is this posible at all? good question! I've recently seen nested repeaters in template (building rows and columns) and definition and they seemed to work :-) in any case I see no conceptual reason (yet) why it should not work for the binding also of course if you have the first test case it might show some implementation bugs which I'll hapily look into just go for it and keep us posted? regards, -marc= Best Regards, Antonio Gallardo. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Marc Portierhttp://outerthought.org/ Outerthought - Open Source, Java XML Competence Support Center Read my weblog athttp://blogs.cocoondev.org/mpo/ [EMAIL PROTECTED] [EMAIL PROTECTED] - 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]
Re: [Woody-binding] nested repeaters are allowed?
Antonio Gallardo wrote: Hi Marc, thanks for the replay. I found a little trick to do so, but I am currently testing it. Maybe it would work. Who knows:-D wb:repeater id=detailA parent-path=. row-path=detailAList unique-row-id=detA_id unique-path=detA_id the usual stuff . /wb:repeater wb:repeater id=detailB parent-path=detailAList row-path=detailBList unique-row-id=detB_id unique-path=detA_id the usual stuff . /wb:repeater Note the play with attributes parent-path, row-path, unique-row-id and unique-path. I hope it would work. :-D hm, doesn't look like a mtach for the nesting at first glance? I was thinking about putting it nested inside the on-bind ? Of course I will keep in touch with you about the success or failure. :-D well, I suppose there is more chance it will not work then the other way around we should build a small test-case and do the required modifications to get it working am currently (finally I should say) cracking up the modifications in binding that were discussed recently, I add this to the (bottom of) the list... if you have a simple test-case ready that would help -marc= Best Regards, Antonio Gallardo Marc Portier dijo: Antonio Gallardo wrote: Hi: Is posible to nest repeaters in the binding of a Java Bean? I am facing a database structure of type master(detailA[detailB]). I need to present it as: master (detail A) (detail B) so in order to do that, I need to nest the repeaters. Is this posible at all? good question! I've recently seen nested repeaters in template (building rows and columns) and definition and they seemed to work :-) in any case I see no conceptual reason (yet) why it should not work for the binding also of course if you have the first test case it might show some implementation bugs which I'll hapily look into just go for it and keep us posted? regards, -marc= Best Regards, Antonio Gallardo. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Marc Portierhttp://outerthought.org/ Outerthought - Open Source, Java XML Competence Support Center Read my weblog athttp://blogs.cocoondev.org/mpo/ [EMAIL PROTECTED] [EMAIL PROTECTED] - 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] -- Marc Portierhttp://outerthought.org/ Outerthought - Open Source, Java XML Competence Support Center Read my weblog athttp://blogs.cocoondev.org/mpo/ [EMAIL PROTECTED] [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [Woody binding] Binding of wd:booleanfield - is it supported?
Sorry, it was my fault! I must have been very tired yesterday. It works even without wb:convertor. Thanks a lot! Marcin Okraszewski --- Marcin Okraszewski [EMAIL PROTECTED] wrote: Hi, It seems that binding of _wd:booleanfield_ isn't supported. Am I right or am I doing something wrong? Try this and please report back: wb:value id=your_widget_name path=your_path_to_value wd:convertor datatype=boolean/ /wb:value Note that convertor is spelled with or, the less common spelling, and that convertor is in the wd (woody definition) namespace, not the wb (woody binding) namespace that the rest of the binding file uses. Of course this also will mean that you need to ad the wd namespace declaration somewhere, such as to the top of the binding file. HTH, --Tim Larson __ Do you Yahoo!? New Yahoo! Photos - easier uploading and sharing. http://photos.yahoo.com/ - 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]
Re: [Woody binding] Binding of wd:booleanfield - is it supported?
--- Marcin Okraszewski [EMAIL PROTECTED] wrote: Hi, It seems that binding of _wd:booleanfield_ isn't supported. Am I right or am I doing something wrong? Try this and please report back: wb:value id=your_widget_name path=your_path_to_value wd:convertor datatype=boolean/ /wb:value Note that convertor is spelled with or, the less common spelling, and that convertor is in the wd (woody definition) namespace, not the wb (woody binding) namespace that the rest of the binding file uses. Of course this also will mean that you need to ad the wd namespace declaration somewhere, such as to the top of the binding file. HTH, --Tim Larson __ Do you Yahoo!? New Yahoo! Photos - easier uploading and sharing. http://photos.yahoo.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Woody Binding Selecting Rows
Jan, could you slide in the error you got? things that come to mind (possible reasons why it goes wrong) - jxpath fails on a setValue call with an xpath statement that contains a predicate (anyone that tested this on bare jxpath?) even if that would work: - the repeater-binding produces an additional row-index predicate for the setValue on the newly to be created node. It just appends the [rowindex] but if there is already a predicate present then the syntax should be more like [(part that is there) and position()=new_rowindex] actually the easiest way seems to be to remove the predicate from the statement just before doing the insert-phaze of the binding, ie. starting with counting how many rows there are left after delete (that count should also be regardless of predicates, so the additions get inserted at the end...) hm, still in thinking and considering mode wdot? regards, -marc= Jan Hoskens wrote: Hi, Im trying to use Woody Binding on my XML document (movie database). Im keeping my deleted rows in my document (for further use) and thus use the wb:set-attribute tag to do this. When I bind the XML document, I do not wish to see the rows that are deleted so I use: wb:repeater id=movies parent-path=movies row-path=[EMAIL PROTECTED] = 'false'] unique-row-id=id unique-path=@id Everythings fine just as long as I dont add a row. If I do try to add a row, I get an error while trying to save the form (I use Apples and call saveFormToModel()). The error that I get concerns the JXPath. Im guessing that I cannot use an expression instead of a path in my row-path? Is there another way to select only my @deleted=false rows from my XML document? Thanx Bye, JH -- Marc Portierhttp://outerthought.org/ Outerthought - Open Source, Java XML Competence Support Center Read my weblog athttp://blogs.cocoondev.org/mpo/ [EMAIL PROTECTED] [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [woody binding] insert attribute content into similar nodes
On Thu, 2003-11-13 at 14:33, Ulrich, Dominik wrote: Hi everybody it's a rather complicated woody question I have, at least for me :) I have a data xml file like this: context element title=A value=true/ element title=B value=false/ /context now I want to bind the value of a boolean widget to these elements in @value. problem: the binding must insert one value to one element with attribute content A and insert another value to the other element with B inside. both nodes have the same names, so what should I do? the binding file must choose the element based on his attribute, so how can I do this? I think this should work: wb:value id=mywidget1 path=[EMAIL PROTECTED]'A']/@value/ wb:value id=mywidget2 path=[EMAIL PROTECTED]'B']/@value/ -- Bruno Dumon http://outerthought.org/ Outerthought - Open Source, Java XML Competence Support Center [EMAIL PROTECTED] [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [WOODY] binding xml of a multiple repeaters inclusion
On Tue, 2003-11-04 at 23:29, Nicolas Maisonneuve wrote: hy , - what the xml binding file for this data ? description info email[EMAIL PROTECTED]/email /info contacts contact id=1 firstnameLucien/firstname phones phone id=1 nr=+32-2-222/ phone id=2 nr=+32-2-221/ /phones /contact contact id=2 firstnameJoris/firstname phones phone id=3 nr=+32-2-223/ phone id=4 nr=+32-2-224/ /phones /contact /contacts /description - in the binding repeater definition we must set : unique-row-id unique-path but when we dont have a id attribute , how do it ? I'm a bit confused because in the above example there are id attributes. Anyhow, the wb:repeater binding depends on an unique identification for each row. There is however another repeater binding implementation available (not documented on the wiki), which works by removing and re-adding all rows, and thus doesn't need an id. Here's a copy-paste of the javadoc which should help you: /** * A simple repeater binding that will replace (i.e. delete then re-add all) its * content. * pre * lt;wb:simple-repeater * id=contacts * parent-path=contactsgt; * lt;em... child bindings .../em * lt;/wb:simple-repeatergt; * /pre -- Bruno Dumon http://outerthought.org/ Outerthought - Open Source, Java XML Competence Support Center [EMAIL PROTECTED] [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Woody : binding
Olivier Billard Escribio :-) Hi all ! I have a problem concerning the binding in woody : I have repeater bound with following structure : person id= person_id156/person_id person_datasome data/person_data /person person id= person_id157/person_id person_dataother data/person_data /person ... try this organitation : persons person id=156 ... /person ... /persons regards, carlos chavez. here is the repeater binding : wb:repeater id=persons parent-path=. row-path=person unique-row-id=id unique-path=@id wb:on-bind wb:value id=person_id path=person_id / remove the line above wb:value id=person_data path=person_data / /wb:on-bind wb:on-delete-row wb:delete-node / /wb:on-delete-row wb:on-insert-row wb:insert-node person id= person_id / person_data / /person /wb:insert-node /wb:on-insert-row /wb:repeater and the container : wd:repeater id=persons wd:output id=id wd:datatype base=string/ /wd:output wd:field id=person_id wd:labelID/wd:label wd:datatype base=string/ /wd:field wd:field id=person_data wd:datatype base=string/ /wd:field /wd:repeater Obviously, @id and person_id play the same role, but this is the only way I get it work. When I set : row-path=person_id unique-row-id=person_id on the repeater binding, the last row added is equals to the same... and when I bind the widget person_id to @id : wb:on-bind wb:value id=person_id path=@id / wb:value id=person_data path=person_data / /wb:on-bind I have a JXPath exception, telling that the value cannot be bound with @id... What is wrong ? - is @id a wrong JXPath expression ? If yes, how can I bound the person_id widget with the person/@id in the structure ? - are the attrs of the repeater binding row-path=person_id unique-row-id=person_id wrong ? In this case, what is the true syntax ? Thanks in advance, and more if you read this mail until the end :) ... -- Olivier BILLARD - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Carlos Chávez - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Woody Binding?
-Original Message- From: Patrick Hess [mailto:[EMAIL PROTECTED] Sent: Monday, October 20, 2003 12:17 PM To: [EMAIL PROTECTED] Subject: Woody Binding? Hi there, the application I'm working on at the moment is using woody for some form handling. I managed to get everything working like I expected and saving some data works fine -- now I'm asking my self what's best way to prepopulate fields on typical edit scenarios. Do I have to use the binding framework or is there an other way to do this? yes, currently the binding framework uses JXPath for binding. So you can bind your forms with all objects that can be accessed by it. My business logic is implemented in EJB so the binding frameworks sounds like the right approach but if possible I would like to start with a more simple way and migrate to binding later... you can start with XML files to evaluate Woody wheter it fits your needs. Reinhard - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Woody Binding?
Reinhard Poetz wrote: My business logic is implemented in EJB so the binding frameworks sounds like the right approach but if possible I would like to start with a more simple way and migrate to binding later... you can start with XML files to evaluate Woody wheter it fits your needs. That's what I did for the moment and it works fine to save form data. But how can prefill the fields when displaying the form with som preexisting values? Patrick - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Woody Binding?
On Mon, 2003-10-20 at 16:05, Patrick Hess wrote: Reinhard Poetz wrote: My business logic is implemented in EJB so the binding frameworks sounds like the right approach but if possible I would like to start with a more simple way and migrate to binding later... you can start with XML files to evaluate Woody wheter it fits your needs. That's what I did for the moment and it works fine to save form data. But how can prefill the fields when displaying the form with som preexisting values? If the data to be prefilled is in the bean, you can use the load feature of the binding. Otherwise you can write code to give the widgets values. -- Bruno Dumon http://outerthought.org/ Outerthought - Open Source, Java XML Competence Support Center [EMAIL PROTECTED] [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Woody Binding?
From: Patrick Hess Reinhard Poetz wrote: My business logic is implemented in EJB so the binding frameworks sounds like the right approach but if possible I would like to start with a more simple way and migrate to binding later... you can start with XML files to evaluate Woody wheter it fits your needs. That's what I did for the moment and it works fine to save form data. But how can prefill the fields when displaying the form with som preexisting values? The form has a load( object ) method. You can pass a bean to it. HTH Reinhard - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Woody binding on XML subtree
On Mon, 2003-10-20 at 16:59, jcplerm wrote: Is there a way of having a Woody form being populated through the binding framework in a way that the form involves just a subtree of the original XML doc? For instance, given the following complete XML doc: root elem id=100 namename100/name addressaddress100/address /elem elem id=101 namename101/name addressaddress101/address /elem elem id=102 namename102/name addressaddress102/address /elem /root I would like a form to edit the just the subtree located by /root/[EMAIL PROTECTED]'101']. You could extract just that element from the document and pass that to the binding. Can the binding definition file somehow be parametrized, or can something along these lines be done? Nope, there's currently no such feature. -- Bruno Dumon http://outerthought.org/ Outerthought - Open Source, Java XML Competence Support Center [EMAIL PROTECTED] [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]