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.

Reply via email to