g:ui_reference dynamically updating

poyntzj
Kilo Sage

I have a UI page and I want to update a g:ui_reference to be dynamic

So I have tried

<input name="jvar_query" id="jvar_query", value="active=true" />

<label for="fromdate" style="display:inline">
Dates to process or will default to the last week):$[AMP]nbsp;$[AMP]nbsp;
</label>
<input id="fromdate" type="date" onchange="setFilter()" name="fromdate"
style="line-height:20px" />

<g:ui_reference name="a_table" id="a_table" table="a_table"
completer="AJAXTableCompleter" columns="state;name" query="${jvar_query}" />


The function setFilter() in the client script works in that when using the magnifiying glass, the records are correct.

The query on the reference is wrong, if I set the value of query="active=true", it is fine

 

I just need to be able to make it dynamic for what I am after right now so making it read a variable seems the most logical way as it is easy enough from the setFilter() to update the value of jvar_query (hence why it is not hidden so I can see it change)

 

Any thoughts ?

1 REPLY 1

poyntzj
Kilo Sage

I already have the following in the client script

var table = gel('lookup.a_table')
//some code
table.setAttribute('onclick', "mousePositionSave(event); reflistOpen( 'a_table', 'not', 'a_table', '', 'false','QUERY:active=true','sys_idIN" + arrProcessed records + "', '')");

It is just the AjaxTableCompleter that is failing to work correctly the magnifying glass is working fine