Param (element child of defaultset)

From JRapid

Jump to: navigation, search

Defaultsets can specify fixed values for the entity's properties or either receive parameters for dynamic initialization of properties.


<defaultset name=NAME>
       entity = ENTITY
       value = VALUE
       name = PARAM_NAME
   <default name = NAME value = PARAM_NAME />


  • Passing a param to a defaultset:
<entity label="Discard" name="Discard" transient="transient">
   <defaultset name="defaultForOpportunity">
            <param entity="Opportunity" name="opportunityParam"/>
            <default name="opportunity" value="opportunityParam"/>
            <default name="comments" value="'Write a comment here...'"/>

Generated java code:

public Discard findDefaultForOpportunity(String opportunityParamId) throws ELException {
        // step 1: find params
      Opportunity opportunityParam = Opportunity.DAO().findById(opportunityParamId);

      Discard obj = new Discard();
      obj.setOpportunity((Opportunity)el.evaluate("${opportunityParam}", Opportunity.class,
      evr, fm));

      obj.setComments((String)el.evaluate("${'Write a comment here...'}", String.class, evr,

See also

Personal tools