I have a catalog form that allows the user to select a server. Once a server is selected, the form runs a series of reports to populate fields with the current values for the amount of memory, processing cores, and storage. Next to each of these fields is a spinner field that allows the user to select the desired amount of resources for each type. In other words, they can select more or less memory, more or fewer cores, etc... These spinners should be initialized to the current value upon server selection.
Here's my problem: ca_fdSetTextFieldValue will only set the value of the first spinner and all subsequent code is ignored. It's as if the javascript engine hits a terminating error and quits out silently.
Is there a more appropriate way to set the value of a spinner field?
Here's an example:
{
Display_Current_Value : function ()
{
var server_name = {value:ca_fdGetSelectedOptionValues(ca_fd.formId,'server_name')};
ca_reportQuery('Physical-Memory-BCBS',{"Server_ID_BCBS":server_name.value},ca_fd.js.onSuccessMemory,ca_fd.js.onFailMemory);
},
onSuccessMemory : function (result)
{
if (result.length == 1)
{
var memory = Number(result[0].physical_memory);
var cores = Number(result[0].cores);
ca_fdSetTextFieldValue(ca_fd.formId,'current_memory',memory); // Text field
ca_fdSetTextFieldValue(ca_fd.formId,'desired_memory',memory); // Spinner
ca_fdSetTextFieldValue(ca_fd.formId,'current_cores',cores); // Text field
ca_fdSetTextFieldValue(ca_fd.formId,'desired_cores',cores); // Spinner
}
},
onFailMemory : function ()
{
ca_fdSetTextFieldValue(ca_fd.formId,'current_memory','No Memory Populated');
ca_fdSetTextFieldValue(ca_fd.formId,'current_core_count','No Core Count Populated');
}
}
NOTE: In this example, the first text field value is set and the first spinner is initialized. None of the code below line 16 is processed. If I rearrange the code such that I swap lines 16 and 18, then the two text fields are populated and the first spinner is initialized but line 19 is never executed.