The CreatorCon Call for Content is officially open! Get started here.

how to add tree_picker attribute in ui_reference field in ui page

ratishkmr89
Kilo Explorer

Hi,

I am trying to add a hierarchy view in ui page ui_reference field of cmdb location table but not able to add attribute tree_picker . Couldn't find any reference for adding tree picker attribute in <g:ui_reference name="QUERY:city=San Diego" id="${jvar_service_name}" table="cmn_location"/>.

7 REPLIES 7

+1 I'm trying to do this as well. Any word on this?


andreymalyuk
Kilo Contributor

Found a way to get tree-picker to work in UI page. Tree picker is activated only if url parameter "sysparm_target" is exactly the full name of the field e.g. sysparm_target=your_table_name.location.


Here is an example using "location" field:


1. Set tree_picker attribute to true for location filed.


2. Set name attribute in ui_reference tag as shown:   <g:ui_reference name="your_table_name.location" table="cmn_location" show_lookup="true"/>.


3. Client side - get the value from html node with id="your_table_name.location", do not forget to escape the dot if using JQuery e.g. "#your_table_name\\.location"


4. Server side value should be available as request.getParameter("your_table_name.location"), but I haven't verified that yet;


If I do what you do, the value changes on the actual form and not on the UI Page... The reference field on the UI Page stays empty, while the location field on the form changes... So that's not ideal either.