Hi,
Well I have to admit, that I use Java and JavaFlow wherever I can.
In order to use Java-Listeners, all you have to do is to create a Java Class
implementing ValueChangedListener.
You then can reference this by a "<java src="class-name-with-full-path"/>"
element. If you use Jetty and Tomcat inside Eclipse in Debug mode, you can even
set Breakpoints in your classes, and you can debug your application as normal
java application. I don't like JavaScript, I have to admit that. Therefore I
like JavaFlow more, even if JavaFlow in 2.1.10 has some really annoying bugs
you have to get used to (No try-catch-blocks inside finally blocks ...
Forbidden usages of almost everything "static" ... even constants).
Regards,
Chris
-----Ursprüngliche Nachricht-----
Von: Magsend [mailto:[EMAIL PROTECTED]
Gesendet: Dienstag, 5. August 2008 14:00
An: [email protected]
Betreff: Re: AW: how to pass params from flowscript to the widget
Chris, thank you very much for support.
Could you please explain, how to process JAVA-file in the sitemap?
And I can't find the samples on this subject with Java.
Are you using Java or JavaScript for the form processing? What's better?
Thank you!!!
Christofer Dutz-3 wrote:
>
> Hi,
>
>
>
> you can set Attributes on CForms Widgets or maybe Fields, I know that I
> use
> these a lot to pass additional Information from JavaFlow to the Form.
>
>
>
> <fd:field id="density" required="true">
>
> <fd:label>Density</fd:label>
>
> <fd:datatype base="decimal"/>
>
> <fd:attributes>
>
> <fd:attribute name=" composition_id "
> value=":"/>
>
> </fd:attributes>
>
> </fd:field>
>
>
>
> Or from code
>
>
>
> <fd:field id="density" required="true">
>
> <fd:label>Density</fd:label>
>
> <fd:datatype base="decimal"/>
>
> <fd:on-value-changed>
>
> <java src="MyValueChangedListener"/>
>
> </fd:on-value-changed>
>
> </fd:field>
>
>
>
> public class MyValueChangedListener implements ValueChangedListener,
> Serviceable {
>
> protected ServiceManager manager;
>
>
>
> public void service(ServiceManager manager) throws ServiceException
> {
>
> this.manager = manager;
>
> }
>
>
>
> public void valueChanged(ValueChangedEvent event) {
>
> Widget sourceWidget = event.getSourceWidget();
>
> // Get your composite id somehow :
>
> String compositeId = "";
>
> sourceWidget.setAttribute("composite_id", compositeId);
>
> }
>
> }
>
>
>
> Hope this helps
>
>
>
> Chris
>
>
>
>
>
>
>
>
>
> Von: Мария Григорьева [mailto:[EMAIL PROTECTED]
> Gesendet: Montag, 4. August 2008 19:39
> An: [email protected]
> Betreff: how to pass params from flowscript to the widget
>
>
>
> Variable in the flowscript:
>
>
>
> var composition_id = experiment.get("id_compositions");
>
>
>
> And the widget:
>
>
>
> <fd:field id="density" required="true">
>
> <fd:label>Density</fd:label>
>
> <fd:datatype base="decimal"/>
>
> <fd:on-value-changed>
>
> <javascript>
>
> var value = this.value;
>
> </javascript>
>
> </fd:on-value-changed>
>
> </fd:field>
>
>
>
> I need to pass "composition_id" to the widget's on-value-changed.
>
>
>
--
View this message in context:
http://www.nabble.com/how-to-pass-params-from-flowscript-to-the-widget-tp18816044p18829596.html
Sent from the Cocoon - Users mailing list archive at Nabble.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]