The fastest easiest way to get it right.

inputs

NAME

x6.json.inputs

FUNCTION

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__.

INPUTS

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 is required when you are sending Direct-Database-Access calls.

SOURCE

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'));
                }
            }
    });
}

User Comments

There are no user comments yet on this page.


Add A Comment

Comments will not appear until after they are moderated. Comments are usually moderated within a few hours on weekdays, but may take longer on weekends and holidays.

Name or nickname: (This will appear with your comment)


Email (this will never be displayed)


Enter your comment here. Use [b] and [/b] for bold, [i] and [/i] for italic, and [pre] and [/pre] for code samples. All literal HTML and PHP that you enter will be escaped out and displayed as you enter it.


Home |  Documentation |  Download |  Credits |  Contact |  Login
Andromeda © Copyright 2004-2010, Licensed under the GPL Version 2