Hi again,

thx Gregor and Antonio, for pointing me to the xalan bug. That is
working for me. :)

I nearly finished the cform integration but I have one problem where I
can use some feedback.

On Thu, 2005-08-18 at 22:02 +0200, Gregor J. Rothfuss wrote:
> Thorsten Scherler wrote:
...
> >>> +                      //Fixme: use lenya doc
> >>> +                      var doc = 
> >>> Packages.javax.xml.parsers.DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();
> >>> +                      doc.appendChild(doc.createElement("contracts"));
> >>> +                      form.createBinding(viewBind);
> >>> +                      form.save(doc);
> >> can you explain what the purpose of the contracts element is?
> > 
> > That was my starting example (old code). It will have to be
> > configurable. That as well needs to be refactored.
> 

I changed the the view definition a wee bit in the spirit of Andreas:

<view template="usecases/test/cform.jx" type="cforms">
 <definition template="usecases/test/cform.xml"> 
  <before/>
  <after>
   form.setAttribute("counter", new java.lang.Integer(0));
  </after>
 </definition>
 <binding template="usecases/test/cform_binding.xml">
  <before>
   var doc =
Packages.javax.xml.parsers.DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();
   doc.appendChild(doc.createElement("contracts"));
  </before>
  <after>
   form.save(doc);
  </after>
 </binding>
</view>

The before/after elements should get rid of the old code I mentioned in
the earlier message. So instead of using:
 var doc =
Packages.javax.xml.parsers.DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();
 doc.appendChild(doc.createElement("contracts"));
in the usecase.js directly (that is limited to my special usecase) I
wanted to use:
 view.getCformBindingBefore()

That should allow custom flowscript additions that may be necessary for
the cforms. The problem is that "view.getCformBindingBefore()" is a
string that contains javascript commands which needs to be executed.

I tried with eval( view.getCformBindingAfter()) but that gave:
"Calling eval() with anything other than a primitive string value will
simply return the value. Is this what you intended?"

Does anybody know how to overcome that problem? For cforms we need to be
able to extend the usecase.js through custom flowscript. 

TIA for any thoughts or suggestions.

salu2

> i would be +1 to apply a cleaned up version of this patch, ideally 
> together with some documentation. cforms integration is a common 
> request, and there are some (now obsolete with this patch) instructions 
> in the wiki that should be superseded by some notes in the vicinity of 
> http://lenya.apache.org/1_4/reference/usecase-framework/index.html
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
-- 
thorsten

"Together we stand, divided we fall!" 
Hey you (Pink Floyd)


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

Reply via email to