Pass value from combobox to the altJSONSQLProvider TO update datagrid.

Hello ,

I want the datagrid to reflect values based on the value i select in the Combobox.  How to pass value from the combobox to the

altJSONSQLProvider  parameter and reload the datagrid ?

My combobox defines below method on change.

onchange="zenPage.rowSelected(zenThis.getValue());"

<altJSONSQLProvider id="PatchClassJsonId" OnGetSQL="GetSQL" >
<parameter paramName="1" value="C"/>
</altJSONSQLProvider>

<dataGrid 

,......

</dataGrid>

Method GetSQL(ByRef pParm As %String, ByRef pSQL As %String, pCriteria As %ZEN.proxyObject, ByRef pPagingInfo As %String) As %Status
{
Set pParm= "zenPage.getComponentById('DataComboId').getValue()"

Set pSQL = "SELECT ID,PatchClassName,Environment,ModuleName,ModuleClass,TargetConfig,BusinessRule,MessageSchemaCategory FROM ProjectInventory.TablePatchClass where PatchClassName %STARTSWITH ? " 
    Quit $$$OK
}
 

//// FYI. I did use the filtersearch as below at some point and it works first time, but when i change the value of combobox second or third time, the datagrid becomes empty.

ClientMethod rowSelected(vPatchClassName) [ Language = javascript ]
{
 zen('PatchClassGridId').setProperty('filterKey',vPatchClassName);
zen('PatchClassGridId').renderContents();
}

Thank you in advance.

  • 0
  • 0
  • 30
  • 1
  • 0

Comments

Hello all,

I used the ChangeQueryOnServer as a reference and my code is working good. This is from the ZenTest example in SAMPLES namespace.

Regards,

Jimmy