Hi guys,

I still can't find a simple example on binding with forms.

Here is my use case :
i display a list of elements (taken from the database) with a link per item. (this is working correctly) when i follow one of the edit link, i got no value in the resulting html page. (it seems to me that i don't have well binded my hibernate object, but can't find real infos on how to do it correctly)

I really have no ideas why my object values are not shown.

In advance, many thanks for any help

Regards,

Raphaël

Here is the excerpt of the flow for the edit:
Language.prototype.edit = function(languageId) {
if (cocoon.log.isDebugEnabled()) { cocoon.log.debug("Edit language " + languageId); }
   if (languageId == undefined) {
       languageId = cocoon.request.getParameter("language");
   }
if (cocoon.log.isDebugEnabled()) { cocoon.log.debug("language=" + languageId); }
   var language = adminUiFacade.getLanguage(languageId);
if (cocoon.log.isDebugEnabled()) { cocoon.log.debug("from db lang=" + language.getLanguage()); } /* Correctly executed */ if (cocoon.log.isDebugEnabled()) { cocoon.log.debug("from db langT=" + language.getLanguageT()); } /* too */
   var editLanguageForm = new Form("view/language/edit.cform");
   editLanguageForm.createBinding("view/language/edit.bind");
   editLanguageForm.load(language);
   editLanguageForm.showForm("view/language/edit.xml", {
           language: language
   });
   cocoon.sendPage("view/language/show.xml", {
           language: model
   });
}

Here is the full cform file:
<?xml version="1.0" encoding="UTF-8"?>
<fd:form xmlns:fd="http://apache.org/cocoon/forms/1.0#definition"; xmlns:i18n="http://apache.org/cocoon/i18n/2.1";>
   <fd:widgets>
       <fd:field id="language" required="true">
           <fd:label>Language</fd:label>
           <fd:datatype base="string"/>
       </fd:field>
       <fd:field id="languageT" required="true">
           <fd:label>Language T</fd:label>
           <fd:datatype base="string"/>
       </fd:field>
   </fd:widgets>
</fd:form>

Here is the full bind file:
<?xml version="1.0" encoding="UTF-8"?>
<fb:context xmlns:fb="http://apache.org/cocoon/forms/1.0#binding"; path="/">
   <fb:value id="language" path="language"/>
   <fb:value id="languageT" path="languageT"/>
</fb:context>

Here the full xml file:
<?xml version="1.0" encoding="UTF-8"?>
<page xmlns:ft="http://apache.org/cocoon/forms/1.0#template"; xmlns:fi="http://apache.org/cocoon/forms/1.0#instance";>
   <site signOn="false" view="cforms">
<ft:form-template action="${cocoon.continuation.id}.cont" method="POST">
           <fi:group>
               <fi:label>User Information</fi:label>
               <fi:items>
                   <ft:widget id="language"/>
                   <ft:widget id="languageT"/>
               </fi:items>
           </fi:group>
           <input type="submit" name="save" value="Save" />
           <input type="submit" name="cancel" value="Cancel" />
       </ft:form-template>
   </site>
</page>

And now my result with cocoon-view=debug
<?xml version="1.0" encoding="ISO-8859-1"?><page xmlns:ft="http://apache.org/cocoon/forms/1.0#template"; xmlns:fi="http://apache.org/cocoon/forms/1.0#instance";>
   <site signOn="false" view="cforms">
<ft:form-template action="2c87533d3375788b261f257d431056575d583c82.cont" method="POST">
           <fi:group>
               <fi:label>User Information</fi:label>
               <fi:items>
                   <ft:widget id="language"/>
                   <ft:widget id="languageT"/>
               </fi:items>
           </fi:group>
           <input type="submit" name="save" value="??? Save ???"/>
           <input type="submit" name="cancel" value="??? Cancel ???"/>
       </ft:form-template>
   </site>
</page>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to