Portlet Factory, Version 6.1.2
Using input mappings for builder calls in a repeated region
Typically, when you use a Button, Image Button, Form Submit Action, or Link builder call within a repeated region, you want to execute some action and pass data specific to the row as arguments to that action. For example, if you had a portfolio structure that contained company names and their corresponding stock symbols, you could create a repeated region that displayed the list of company names, with each name being the displayed text of a Link builder call. The intended behavior is that when a user clicks on a link to a stock quote URL, the appropriate stock symbol gets passed as an argument.
To pass arguments to an action from a repeated region:
- Set up your repeated region and any other builder calls in that region, so that it displays the contents of the region as you intend.
- In the Button, Image Button, or Link builder call, pass row-specific data, using the repeated region loop variable (accessible through the reference chooser) to access the desired element in the row.
For example, if the Repeated Region iterates over each <company> element in the structure below:
<portfolio> <company> <name>Acme Supply Co.</name> <symbol>ACME</symbol> </company> ... </portfolio>and you declared CurrentCompany as the Loop variable, the appropriate values for the Input Mappings input are similar to the following one:
- Name
- Value
- quote
- ${Variables/CurrentCompany/symbol}
When the user clicks on the company name in the repeated region, the action is passed the corresponding stock symbol as the value for its quote argument.
You can use the reference chooser to select the appropriate loop variable and then use XPath-like notation to specify the value of an element in the loop variable to pass to the action.
Note: If the selected action is a method in the model, the builder call editor pre-populates the argument name field. If you are passing arguments to a URL the order you specify the arguments is not important, but you do need to name the arguments exactly as the URL expects them. And make sure that the evaluate action occurs as the page is rendered.
- About using the Evaluate Arguments input
If the argument you specify to an action builder takes an argument, the Evaluate Argument input is displayed in the builder call editor. This input allows you to specify when the argument is to be evaluated.
- Passing arguments to actions
The Input Mappings group allows you to specify argument names and values to pass to an action.
- Passing values from the model to actions
When specifying argument values, you can enter a string or use the reference chooser to select the value from a variable or method in your model.
- Repeated Region builder
Use the Repeated Region builder to repeat part of an HTML page.
Library | Support |