x6.json.inputs
The Javascript method x6.json.inputs adds inputs to
a JSON call previously initiated with x6.json.init.
This method accepts an object as its parameter, and
will add every input that is a child (at any level)
of that object.
This method uses the "id" property of the input to
name the parameter, not the "name" property. Andromeda
makes no use of the "name" property.
This method is equivalent to use x6.json.addParm
for each of the desired inputs.
Checkboxes receive special treatment. If the box is
checked a value of 'Y' is sent, and if the box is not
checked a value of 'N' is sent.
The name of each parameter is normally the Id of the
input. If the inputs were generated by Andromeda
on an Extended-Desktop page, they will have the names
'x4inp_
object - optional, the object to recurse. You must
pass the object itself, not its Id. If no object is
passed the Extended-Desktop top-level object x4Top
is used, which means you get every input on the page,
whether or not it is visible or
direct - a special flag that says to name the parameters
'x4c_
this.inputs= function(obj,direct) {
if(direct==null) direct=false;
if(obj==null) {
obj = $a.byId('x4Top');
}
if(typeof(obj)=='string') {
var jqObjects = $(obj);
}
else {
var jqObjects = $(obj).find(":input");
}
jqObjects.each( function() {
if(direct)
var id = 'x4c_'+x6.p(this,'xColumnId');
else
var id = this.id;
if(this.type=='checkbox') {
if(this.checked) {
x6.json.addParm(id,'Y');
}
else {
x6.json.addParm(id,'N');
}
}
else {
if($(this).prop('value')!='') {
x6.json.addParm(id,$(this).prop('value'));
}
}
});
}