Friday, April 15, 2011

Adding a Reference Field to a UI Page

The following code is required to add a reference field to a UI Page. Note this does have type ahead on it as well.

This example references the sys_user table and only returns accounts which are active and not locked out.

To use this code add it to the html section of the ui_page.

<j:set var="jvar_user_query" value="QUERY:active=true^locked_out=false" />

<input id="user_query" type="hidden" value="${jvar_user_query}" />



<g:ui_reference name="${jvar_user_query}" table="sys_user" />



This enables the use of a reference field when custom forms are required.

No comments: