cancel
Showing results for 
Search instead for 
Did you mean: 

setting WizardManager.bean.actionProperties default value

chuck
Champ in-the-making
Champ in-the-making
Hi,
Sorry I know this is a very basic questions.
I have the following code in my JSP and want it to be true by default.

I know I need to set value="true" but I don't know where.


<h:selectBooleanCheckbox id="stayOff" value="#{WizardManager.bean.actionProperties.stayOff}" />

Thanks,
Chuck
4 REPLIES 4

gavinc
Champ in-the-making
Champ in-the-making
You need to set the 'stayOff' property in the Java class that represents the custom action to true.

chuck
Champ in-the-making
Champ in-the-making
Thanks Gavin, I have added this using the setupUIDefaults method in my ActionHandler class however I get:


Transaction didn't commit: A value for the mandatory parameter stayOff has not been set on the rule item dna-microarray-process

This does not happen if I do not have the setupUIDefaults method but then again I also get this if I am moving my file outbound (whereas I only have an inbound rule and the destination has to rule).

gavinc
Champ in-the-making
Champ in-the-making
Your method needs to look something similar to the following:

public void setupUIDefaults(Map<String, Serializable> actionProps)
{
   actionProps.put("stayOff", Boolean.TRUE);
}

I presume you have something like that. Then you also need to implement the prepareForSave method to actually pass the data into the rule, this will look something like:

public void prepareForSave(Map<String, Serializable> actionProps,
         Map<String, Serializable> repoProps)
{
   repoProps.put(YourAction.PARAM_STAYOFF,
         actionProps.get("stayOff"));
}

Then similarly you will need a prepareForEdit() method that sets up the property value in the actionProps Map ready for editing.

rtoepfer
Champ in-the-making
Champ in-the-making
How would this apply to a select drop down list?

I've created a custom transform class based on the image magick transform classes.  The Run Action wizard has an image-transformers property, but if I emulate this with a custom property and reference in my JSP I get an exception.



     <config evaluator="string-compare" condition="Action Wizards">  
     <cadTransformers>
         <transformer name="application/sat" />
         <transformer name="application/iges" />
         <transformer name="application/jt" />
         <transformer name="application/catpart" />
         <transformer name="application/step" />
         <transformer name="application/model" />
         <transformer name="application/dae" />
         <transformer name="model/vnd.parasolid.transmit.binary" />
         <transformer name="model/vnd.parasolid.transmit.text" />
         <transformer name="model/vnd.dwf" />
         <transformer name="model/vnd.dwg" />
         <transformer name="application/flt" />
         <transformer name="application/vda" />
         <transformer name="model/vrml" />
         <transformer name="application/x3d" />
      </cadTransformers>




<h:selectOneMenu value="#{WizardManager.bean.actionProperties.cadTransformer}">
<f:selectItems value="#{WizardManager.bean.cadTransformers}" />
</h:selectOneMenu>