Category:Defaultset

From JRapid

Jump to: navigation, search

Defaultsets assign a set of default values for entity's properties. They can be also called "entities initializers". These default values can be fixed values like the default value of a property or dynamic values (the values are taken from a defaultset param.

Defaulsets can be specified in related-entiy actions and embedded listings.

For each defaulset a new generated service method is created. See the defaultset param example.

Example:

  • Defaulsets in embeddedlistings:

You can add a defaultset to an embedded listing to initialize the properties of the instances you add from that listing.

In this example a new Opportunity is added from the embedded listing of opportunities for company "Proda".

In the following image you will notice that the "company" property of the added Opportunity is "Proda". That is because a defaulset was specified for the "opportunities" embedded listing and it defines a parametrized value for that property. See the code below.

Defaulset is specified in the Opportunity entity

If no defaultset is specified for the opportunities embedded listing then the "company" property will be empty.

No defaulset is specified, "company" property is empty

The code for the defaulset:

<entity name="Company" label="Company">
        ...
        <tab label="Opportunities" name="opportunities">
            <embeddedlisting defaultset="defaultForCompany" defaultsetparams="."
 entity="Opportunity" label="Opportunities" listing="forCompany" name="opportunities"
 subset="forCompanies" subsetparams="."/>
        </tab>
        ...
</entity>
<entity label="Opportunity" menu="Opportunities" name="Opportunity">
        ...
        <listing displayproperties="start,amount,state.state" name="forCompany"
 subset="forCompanies"/>
        <defaultset name="defaultForCompany">
            <param entity="Company" name="companyParam"/>
            <default name="company" value="companyParam"/>
        </defaultset>
        <property comboproperty="name" entity="Company" fixed="fixed" label="Company"
 name="company" required="required" widget="combo"/>
        ...
</entity>
  • Defaultsets in related-entity actions example:

See the "discardOpportunity" action example in the page.

Usage:

<defaultset 
            name = NAME
            unique = UNIQUE
            (restrict?, defaultset param*)
/>
  1. name: name by which the defaultset can be referenced.
  2. unique: Indicates that this defaultset is unique, meaning that the default values are only set the first time and from then on the form is completed with the previously inserted values. This attribute should be used with children of type key.
  3. param: the params for the defaulset. "." or an FPath expression to access the form's values.

See also:

Pages in category "Defaultset"

The following 2 pages are in this category, out of 2 total.

D

N

Personal tools