Initialize a Repeater Using Database connector
Forgive me if this has been covered previously, but my searches have not netted anything on the forums or the docs sites.
We have a need to create a form containing dynamically created links populated using a query such as a stored procedure. Ideally, using a schema based repeater with a DocURI action would be simple, but we cannot use the 'Link' type within that as far as I know.
Is it possible to populate items within a repeater control via business rules based on a query? For instance, the business rule would get the data set and then construct the repeater control (much like a docURI action would populate the schema based controls)?
Thank you,
-
You are right, Doc URI is the best way to populate repeats using database connector. It would be quite a lot of work if you wish to do it using business rules, but it is possible.
If I understand what you need correctly, then theoretically you should be able to do it like this:
-
In your repeater control, use a message control for displaying the link.
HTML like: <a href="http://www.w3schools.com">Visit W3Schools.com!</a> can be used as the message control value, which will create a link. -
Use the business rule to get the data set.
-
Then refer this rule example about how to initialize the values of your repeating message controls, to display the links.
Note that Doc URIs automatically generate the required repeating controls based on the data set retrieved. But this won't happen when using business rules. And since there is no way to add/remove the repeating items using business rules, you will need to have a default number of repeating items already present on your form, and then based on the data set retrieved, you can hide the items that are not required.
0 -
Please sign in to leave a comment.
Comments
1 comment