Portlet Factory, Version 6.1.2
Creating a Lookup Table
To define a lookup where the values come from a builder that does not itself create a lookup, you can specify an additional builder to call. The example below uses a Service Consumer builder. In this case suppose you want to create a Lookup Table from the Service Consumer. You can do so if you add the ServiceInfo child element to the LookupTable element, and specify an additional builder that supports getting the lookup data. Then the Lookup Table builder specified in the data definition can reference the data returned by that other builder.
The end result is that the data definition file will cause any number of fields (in every model that references the data def) to be automatically populated with a drop-down lookup, where the values are dynamically retrieved by calling a service. For example, the following XML can be used to invoke a Service Consumer builder to dynamically get lookup values, and then reference the results value in the Lookup Table builder:
<LookupTable> <Name>companyLookup</Name> <BuilderID>com.bowstreet.builders.webapp.LookupTableBuilder</BuilderID> <Inputs> <Input name = "DataType">XmlData</Input> <Input name = "VariableType">ValueTagLabelTag</Input> <Input name = "GetDataFrom">BuilderInput</Input> <Input name = "TablePosition">InFront</Input> <Input name = "Name">companyLookup</Input> <Input name = "XmlData">${MethodCall/companiesGetCompanyList}</Input> <Input name = "ValueElementName">Value</Input> <Input name = "LabelElementName">Name</Input> </Inputs> <ServiceInfo> <BuilderID>com.bowstreet.builders.webapp.ServiceConsumer2Builder</BuilderID> <Inputs> <Input name = "UseAllOperations">true</Input> <Input name = "OverrideInputs">false</Input> <Input name = "Name">companies</Input> <Input name = "ProviderModel">services/CompanyListService</Input> <Input name = "OperationName">getCompanyList</Input> </Inputs> </ServiceInfo> </LookupTable>Parent topic: Working with data definitions
Library | Support |