dojox/form/ListInput.js

  • Provides:

    • dojox.form.ListInput
  • Requires:

    • dijit.form._FormWidget in common in project dijit
    • dijit.form.ValidationTextBox in common in project dijit
    • dijit.InlineEditBox in common in project dijit
  • dojox.form.ListInput

    • type
      Function
    • chains:
      • dijit.form._FormValueWidget: (prototype)
      • dijit.form._FormValueWidget: (call)
    • summary
      An automatic list maker
    • description
      you can add value to list with add method.
      you can only remove by clicking close button
    • source: [view]
        this._items = [];

        

        
        if(!dojo.isArray(this.delimiter)){
         this.delimiter=[this.delimiter];
        }
        var r="("+this.delimiter.join("|")+")?";
        this.regExp="^"+this.regExp+r+"$";
  • dojox.form.ListInput.inputClass

    • type
      String
    • summary
      Class which will be used to create the input box. You can implements yours.
      It must be a widget, focusNode or domNode must have "onkeydown" event
      It must have .attr("value") to get value
      It also must impement an (or more) handler for the "onChange" method
  • dojox.form.ListInput.inputHandler

    • type
      String
    • summary
      || Array
      The widget will connect on all handler to check input value
      You can use comma separated list
  • dojox.form.ListInput.inputProperties

    • type
      Object
    • summary
  • dojox.form.ListInput.submitOnlyValidValue

    • type
      Boolean
    • summary
      If true, only valid value will be submited with form
  • dojox.form.ListInput.useOnBlur

    • type
      Boolean
    • summary
      If true, onBlur event do a validate (like pressing ENTER)
  • dojox.form.ListInput.readOnlyInput

    • type
      Boolean
    • summary
      if false, the list will be editable
      Can only be set when instanciate
  • dojox.form.ListInput.maxItems

    • type
      Int
    • summary
      Specify max item the list can have
      null = infiny
  • dojox.form.ListInput.showCloseButtonWhenValid

    • type
      Boolean
    • summary
      if true, a close button will be added on valid item
  • dojox.form.ListInput.showCloseButtonWhenInvalid

    • type
      Boolean
    • summary
      if true, a close button will be added on invalid item
  • dojox.form.ListInput.regExp

    • tags: extension protected
    • type
      String
    • summary
      regular expression string used to validate the input
      Do not specify both regExp and regExpGen
  • dojox.form.ListInput.delimiter

    • type
      String
    • summary
      || Array
      delimiter for the string. Every match will be splitted
      The string can contain only one delimiter
  • dojox.form.ListInput.constraints

    • type
      Object
    • summary
  • dojox.form.ListInput.baseClass

    • summary
  • dojox.form.ListInput.type

    • summary
  • dojox.form.ListInput.value

    • summary
  • dojox.form.ListInput.templateString

    • summary
  • dojox.form.ListInput.useAnim

    • type
      Boolean
    • summary
      If true, then item will use an anime to show hide itself
  • dojox.form.ListInput.duration

    • type
      Integer
    • summary
      Animation duration
  • dojox.form.ListInput.easingIn

    • type
      function
    • summary
      function used to easing on fadeIn end
  • dojox.form.ListInput.easingOut

    • type
      function
    • summary
      function used to easing on fadeOut end
  • dojox.form.ListInput.readOnlyItem

    • type
      Boolean
    • summary
      If true, items can be edited
      Can only be set when instanciate
  • dojox.form.ListInput.useArrowForEdit

    • type
      Boolean
    • summary
      If true, arraow left and right can be used for editing
      Can only be set when instanciate
  • dojox.form.ListInput._items

    • type
      Array
    • summary
      Array of widget.
      Contain all reference to _ListInputInputItem
  • dojox.form.ListInput._lastAddedItem

    • type
      Widget
    • summary
      Contain a reference to the last created item
  • dojox.form.ListInput._currentItem

    • type
      Widget
    • summary
      Widget currently in edition
  • dojox.form.ListInput._input

    • type
      Widget
    • summary
      Widget use for input box
  • dojox.form.ListInput._count

    • type
      Int
    • summary
      Count items
  • dojox.form.ListInput.postCreate

    • type
      Function
    • source: [view]
        this.inherited(arguments);
        this._createInputBox();
    • summary
      If closeButton is used, add a class
  • dojox.form.ListInput._setReadOnlyInputAttr

    • type
      Function
    • parameters:
      • value: (typeof Boolean)
    • source: [view]
        if(!this._started){ return this._createInputBox(); }
        this.readOnlyInput = value;
        this._createInputBox();
    • summary
      Change status and if needed, create the inputbox
    • tags:
  • dojox.form.ListInput._setReadOnlyItemAttr

    • type
      Function
    • parameters:
      • value: (typeof Boolean)
    • source: [view]
        if(!this._started){ return; }
        for(var i in this._items){
         this._items[i].set("readOnlyItem", value);
        }
    • summary
      set read only items
    • tags:
  • dojox.form.ListInput._createInputBox

    • type
      Function
    • source: [view]
        dojo.toggleClass(this._inputNode, "dijitHidden", this.readOnlyInput);
        if(this.readOnlyInput){ return; }
        if(this._input){ return; }

          
        if(this.inputHandler === null){
         console.warn("you must add some handler to connect to input field");
         return false;
        }
        if(dojo.isString(this.inputHandler)){
         this.inputHandler = this.inputHandler.split(",");
        }
        if(dojo.isString(this.inputProperties)){
         this.inputProperties = dojo.fromJson(this.inputProperties);
        }

        


        var input = dojo.getObject(this.inputClass, false);

        
        this.inputProperties.regExp = this.regExpGen(this.constraints);

        
        this._input = new input(this.inputProperties);
        this._input.startup();
        this._inputNode.appendChild(this._input.domNode);
        dojo.forEach(this.inputHandler, function(handler){
         this.connect(this._input,dojo.string.trim(handler),"_onHandler");
        },this);

       
        this.connect(this._input, "onKeyDown", "_inputOnKeyDown");
        this.connect(this._input, "onBlur", "_inputOnBlur");
    • summary
      Create the input box
    • tags:
  • dojox.form.ListInput.compare

    • type
      Function
    • parameters:
      • val1: (typeof Array)
      • val2: (typeof Array)
    • source: [view]
        val1 = val1.join(",");
        val2 = val2.join(",");
        if(val1 > val2){
         return 1;
        }else if(val1 < val2){
         return -1;
        }else{
         return 0;
        }
    • summary
      Compare 2 values (as returned by attr('value') for this widget).
    • tags:
  • dojox.form.ListInput.add

    • type
      Function
    • parameters:
      • values: (typeof String || Array)
    • source: [view]
        if(this._count>=this.maxItems && this.maxItems !== null){return;}
        this._lastValueReported = this._getValues();

        
        if(!dojo.isArray(values)){
         values = [values];
        }

        
        for(var i in values){
         var value=values[i];
         if(value === "" || typeof value != "string"){
          continue;
         }
         this._count++;
         var re = new RegExp(this.regExpGen(this.constraints));


         this._lastAddedItem = new dojox.form._ListInputInputItem({
          "index" : this._items.length,
          readOnlyItem : this.readOnlyItem,
          value : value,
          regExp: this.regExpGen(this.constraints)
         });
         this._lastAddedItem.startup();

         
         this._testItem(this._lastAddedItem,value);

         
         this._lastAddedItem.onClose = dojo.hitch(this,"_onItemClose",this._lastAddedItem);
         this._lastAddedItem.onChange = dojo.hitch(this,"_onItemChange",this._lastAddedItem);
         this._lastAddedItem.onEdit = dojo.hitch(this,"_onItemEdit",this._lastAddedItem);
         this._lastAddedItem.onKeyDown = dojo.hitch(this,"_onItemKeyDown",this._lastAddedItem);


         if(this.useAnim){
          dojo.style(this._lastAddedItem.domNode, {opacity:0, display:""});
         }


         this._placeItem(this._lastAddedItem.domNode);

         
         if(this.useAnim){
          var anim = dojo.fadeIn({
           node : this._lastAddedItem.domNode,
           duration : this.duration,
           easing : this.easingIn
          }).play();
         }

         
         this._items[this._lastAddedItem.index] = this._lastAddedItem;

         
         if(this._onChangeActive && this.intermediateChanges){ this.onChange(value); }

         
         if(this._count>=this.maxItems && this.maxItems !== null){
          break;
         }
        }

        
        this._updateValues();
        if(this._lastValueReported.length==0){
         this._lastValueReported = this.value;
        }

        
        if(!this.readOnlyInput){
         this._input.set("value", "");
        }

        
        if(this._onChangeActive){ this.onChange(this.value); }

        
        this._setReadOnlyWhenMaxItemsReached();
    • summary
      Create new list element
  • dojox.form.ListInput._setReadOnlyWhenMaxItemsReached

    • type
      Function
    • source: [view]
        this.set("readOnlyInput",(this._count>=this.maxItems && this.maxItems !== null));
    • summary
      set input to readonly when max is reached
    • tags:
  • dojox.form.ListInput._setSelectNode

    • type
      Function
    • source: [view]
        this._selectNode.options.length = 0;

        
        var values=this.submitOnlyValidValue?this.get("MatchedValue"):this.value;

        
        if(!dojo.isArray(values)){
         return;
        }
        dojo.forEach(values,function(item){
         this._selectNode.options[this._selectNode.options.length]=new Option(item,item,true,true);
        },this);
    • summary
      put all item in the select (for a submit)
    • tags:
  • dojox.form.ListInput._placeItem

    • type
      Function
    • parameters:
      • node: (typeof domNode)
    • source: [view]
        dojo.place(node,this._inputNode,"before");
    • summary
      Place item in the list
    • tags:
  • dojox.form.ListInput._getCursorPos

    • type
      Function
    • parameters:
      • node: (typeof domNode)
    • source: [view]
        if(typeof node.selectionStart != 'undefined'){
         return node.selectionStart;
        }

        
        // IE Support
        try{ node.focus(); }catch(e){}
        var range = node.createTextRange();
        range.moveToBookmark(dojo.doc.selection.createRange().getBookmark());
        range.moveEnd('character', node.value.length);
        try{
         return node.value.length - range.text.length;
        }finally{ range=null; }
    • summary
      get current cursor pos
    • tags:
  • dojox.form.ListInput._onItemClose

    • type
      Function
    • parameters:
      • item: (typeof dijit._Widget)
    • source: [view]
        if(this.disabled){ return; }

        
        if(this.useAnim){
         var anim = dojo.fadeOut({
          node : item.domNode,
          duration : this.duration,
          easing : this.easingOut,
          onEnd : dojo.hitch(this, "_destroyItem", item)
         }).play();
        }else{
         this._destroyItem(item);
        }
    • summary
      Destroy a list element when close button is clicked
    • tags:
  • dojox.form.ListInput._onItemKeyDown

    • type
      Function
    • parameters:
      • item: (typeof dijit._Widget)
      • e: (typeof Event)
    • source: [view]
        if(this.readOnlyItem || !this.useArrowForEdit){ return; }

        
        if(e.keyCode == dojo.keys.LEFT_ARROW && this._getCursorPos(e.target)==0){
         this._editBefore(item);
        }else if(e.keyCode == dojo.keys.RIGHT_ARROW && this._getCursorPos(e.target)==e.target.value.length){
         this._editAfter(item);
        }
    • summary
      Call when item get a keypress
    • tags:
  • dojox.form.ListInput._editBefore

    • type
      Function
    • parameters:
      • item: (typeof widget)
    • source: [view]
        this._currentItem = this._getPreviousItem(item);
        if(this._currentItem !== null){
         this._currentItem.edit();
        }
    • summary
      move trough items
    • tags:
  • dojox.form.ListInput._editAfter

    • type
      Function
    • parameters:
      • item: (typeof widget)
    • source: [view]
        this._currentItem = this._getNextItem(item);
        if(this._currentItem !== null){
         this._currentItem.edit();
        }

        
        if(!this.readOnlyInput){
         if(this._currentItem === null){
          //no more item ?
          //so edit input (if available)
          this._focusInput();
         }
        }
    • summary
      move trough items
    • tags:
  • dojox.form.ListInput._onItemChange

    • type
      Function
    • parameters:
      • item: (typeof dijit._Widget)
      • value: (typeof String)
    • source: [view]
        value = value || item.get("value");

        
        //revalidate content
        this._testItem(item,value);

        
        //update value
        this._updateValues();
    • summary
      Call when item value change
    • tags:
  • dojox.form.ListInput._onItemEdit

    • type
      Function
    • parameters:
      • item: (typeof dijit._Widget)
    • source: [view]
        dojo.removeClass(item.domNode,["dijitError", this.baseClass + "Match", this.baseClass + "Mismatch"]);
    • summary
      Call when item is edited
    • tags:
  • dojox.form.ListInput._testItem

    • type
      Function
    • parameters:
      • item: (typeof Object)
      • value: (typeof String)
    • source: [view]
        var re = new RegExp(this.regExpGen(this.constraints));
        var match = value.match(re);

        
        dojo.removeClass(item.domNode, this.baseClass + (!match ? "Match" : "Mismatch"));
        dojo.addClass(item.domNode, this.baseClass + (match ? "Match" : "Mismatch"));
        dojo.toggleClass(item.domNode, "dijitError", !match);

        
        if((this.showCloseButtonWhenValid && match) ||
         (this.showCloseButtonWhenInvalid && !match)){
         dojo.addClass(item.domNode,this.baseClass+"Closable");
        }else {
         dojo.removeClass(item.domNode,this.baseClass+"Closable");
        }
    • summary
      Change class of item (match, mismatch)
    • tags:
  • dojox.form.ListInput._getValueAttr

    • type
      Function
    • source: [view]
        return this.value;
    • summary
      get all value in then list and return an array
    • tags:
  • dojox.form.ListInput._setValueAttr

    • type
      Function
    • parameters:
      • newValue: (typeof Array || String)
    • source: [view]
        this._destroyAllItems();

        
        this.add(this._parseValue(newValue));
    • summary
      Hook so attr('value', value) works.
    • description
      Sets the value of the widget.
      If the value has changed, then fire onChange event, unless priorityChange
      is specified as null (or false?)
  • dojox.form.ListInput._parseValue

    • type
      Function
    • parameters:
      • newValue: (typeof String)
    • source: [view]
        if(typeof newValue == "string"){
         if(dojo.isString(this.delimiter)){
          this.delimiter = [this.delimiter];
         }
         var re = new RegExp("^.*("+this.delimiter.join("|")+").*");
         if(newValue.match(re)){
          re = new RegExp(this.delimiter.join("|"));
          return newValue.split(re);
         }
        }
        return newValue;
    • summary
      search for delemiters and split if needed
    • tags:
  • dojox.form.ListInput.regExpGen

    • type
      Function
    • parameters:
      • constraints: (typeof dijit.form.ValidationTextBox.__Constraints)
    • source: [view]
        return this.regExp; // String
    • summary
      Overridable function used to generate regExp when dependent on constraints.
      Do not specify both regExp and regExpGen.
    • tags:
    • returns
      String
  • dojox.form.ListInput._setDisabledAttr

    • type
      Function
    • parameters:
      • value: (typeof Boolean)
    • source: [view]
        if(!this.readOnlyItem){
         for(var i in this._items){
          this._items[i].set("disabled", value);
         }
        }

        
        if(!this.readOnlyInput){
         this._input.set("disabled", value);
        }
        this.inherited(arguments);
    • summary
      also enable/disable editable items
    • tags:
  • dojox.form.ListInput._onHandler

    • type
      Function
    • parameters:
      • value: (typeof String)
    • source: [view]
        var parsedValue = this._parseValue(value);
        if(dojo.isArray(parsedValue)){
         this.add(parsedValue);
        }
    • summary
      When handlers of input are fired, this method check input value and (if needed) modify it
    • tags:
  • dojox.form.ListInput._onClick

    • type
      Function
    • parameters:
      • e: (typeof event)
    • source: [view]
        this._focusInput();
    • summary
      give focus to inputbox
    • tags:
  • dojox.form.ListInput._focusInput

    • type
      Function
    • source: [view]
        if(!this.readOnlyInput && this._input.focus){
         this._input.focus();
        }
    • summary
      give focus to input
    • tags:
  • dojox.form.ListInput._inputOnKeyDown

    • type
      Function
    • parameters:
      • e: (typeof event)
    • source: [view]
        this._currentItem = null;
        var val = this._input.get("value");

        
        if(e.keyCode == dojo.keys.BACKSPACE && val == "" && this.get("lastItem")){
         this._destroyItem(this.get("lastItem"));
        }else if(e.keyCode == dojo.keys.ENTER && val != ""){
         this.add(val);
        }else if(e.keyCode == dojo.keys.LEFT_ARROW && this._getCursorPos(this._input.focusNode) == 0 &&
         !this.readOnlyItem && this.useArrowForEdit){
          this._editBefore();
        }
    • summary
      Used to add keybord interactivity
    • tags:
  • dojox.form.ListInput._inputOnBlur

    • type
      Function
    • source: [view]
        var val = this._input.get('value');
        if(this.useOnBlur && val != ""){
         this.add(val);
        }
    • summary
      Remove focus class and act like pressing ENTER key
    • tags:
  • dojox.form.ListInput._getMatchedValueAttr

    • type
      Function
    • source: [view]
        return this._getValues(dojo.hitch(this,this._matchValidator));
    • summary
      get value that match regexp in then list and return an array
    • tags:
  • dojox.form.ListInput._getMismatchedValueAttr

    • type
      Function
    • source: [view]
        return this._getValues(dojo.hitch(this,this._mismatchValidator));
    • summary
      get value that mismatch regexp in then list and return an array
    • tags:
  • dojox.form.ListInput._getValues

    • type
      Function
    • parameters:
      • validator: (typeof function)
    • source: [view]
        var value = [];
        validator = validator||this._nullValidator;
        for(var i in this._items){
         var item = this._items[i];
         if(item === null){
          continue;
         }
         var itemValue = item.get("value");
         if(validator(itemValue)){
          value.push(itemValue);
         }
        }
        return value;
    • summary
      return values with comparator constraint
    • tags:
  • dojox.form.ListInput._nullValidator

    • type
      Function
    • parameters:
      • itemValue: (typeof String)
    • source: [view]
        return true;
    • summary
      return true or false
    • tags:
  • dojox.form.ListInput._matchValidator

    • type
      Function
    • parameters:
      • itemValue: (typeof String)
    • source: [view]
        var re = new RegExp(this.regExpGen(this.constraints));
        return itemValue.match(re);
    • summary
      return true or false
    • tags:
  • dojox.form.ListInput._mismatchValidator

    • type
      Function
    • parameters:
      • itemValue: (typeof String)
    • source: [view]
        var re = new RegExp(this.regExpGen(this.constraints));
        return !(itemValue.match(re));
    • summary
      return true or false
    • tags:
  • dojox.form.ListInput._getLastItemAttr

    • type
      Function
    • source: [view]
        return this._getSomeItem();
    • summary
      return the last item in list
    • tags:
  • dojox.form.ListInput._getSomeItem

    • type
      Function
    • parameters:
      • item: (typeof dijit._Widget)
      • position: (typeof String)
    • source: [view]
        item=item||false;
        position=position||"last";

        
        var lastItem = null;
        var stop=-1;
        for(var i in this._items){
         if(this._items[i] === null){ continue; }

         
         if(position=="before" && this._items[i] === item){
          break;
         }

         
         lastItem = this._items[i];

         
         if(position=="first" ||stop==0){
          stop=1;
          break;
         }
         if(position=="after" && this._items[i] === item){
          stop=0;
         }
        }
        if(position=="after" && stop==0){
         lastItem = null;
        }
        return lastItem;
    • summary
      return the item before the one in params
    • tags:
  • dojox.form.ListInput._getPreviousItem

    • type
      Function
    • parameters:
      • item: (typeof dijit._Widget)
    • source: [view]
        return this._getSomeItem(item,"before");
    • summary
      return the item before the one in params
    • tags:
  • dojox.form.ListInput._getNextItem

    • type
      Function
    • parameters:
      • item: (typeof dijit._Widget)
    • source: [view]
        return this._getSomeItem(item,"after");
    • summary
      return the item before the one in params
    • tags:
  • dojox.form.ListInput._destroyItem

    • type
      Function
    • parameters:
      • item: (typeof dijit._Widget)
      • updateValue: (typeof Boolean)
    • source: [view]
        this._items[item.index] = null;
        item.destroy();
        this._count--;
        if(updateValue!==false){
         this._updateValues();
         this._setReadOnlyWhenMaxItemsReached();
        }
    • summary
      destroy an item
    • tags:
  • dojox.form.ListInput._updateValues

    • type
      Function
    • source: [view]
        this.value = this._getValues();
        this._setSelectNode();
    • summary
      update this.value and the select node
    • tags:
  • dojox.form.ListInput._destroyAllItems

    • type
      Function
    • source: [view]
        for(var i in this._items){
         if(this._items[i]==null){ continue; }
         this._destroyItem(this._items[i],false);
        }
        this._items = [];
        this._count = 0;
        this.value = null;
        this._setSelectNode();
        this._setReadOnlyWhenMaxItemsReached();
    • summary
      destroy all items
    • tags:
  • dojox.form.ListInput.destroy

    • type
      Function
    • source: [view]
        this._destroyAllItems();
        this._lastAddedItem = null;

        
        if(!this._input){
         this._input.destroy();
        }

        
        this.inherited(arguments);
    • summary
      Destroy all widget
  • dojox.form.ListInput.inputProperties.minWidth

    • summary
  • dojox.form.ListInput.inputProperties.regExp

    • summary
  • dojox.form.ListInput._lastValueReported

    • summary
  • dojox.form.ListInput._lastAddedItem.onClose

    • summary
  • dojox.form.ListInput._lastAddedItem.onChange

    • summary
  • dojox.form.ListInput._lastAddedItem.onEdit

    • summary
  • dojox.form.ListInput._lastAddedItem.onKeyDown

    • summary
  • dojox.form.ListInput._lastValueReported.length

    • summary
  • dojox.form.ListInput._selectNode.options.length

    • summary
  • dojox.form._ListInputInputItem

    • type
      Function
    • chains:
      • dijit._Widget: (prototype)
      • dijit._Widget: (call)
      • dijit._Templated: (call)
    • mixins:
      • dijit._Templated.prototype: (prototype)
    • summary
      Item created by ListInputInput when delimiter is found
    • description
      Simple <li> with close button added to ListInputInput when delimiter is found
  • dojox.form._ListInputInputItem.templateString

    • summary
  • dojox.form._ListInputInputItem.closeButtonNode

    • type
      domNode
    • summary
      ref to the close button node
  • dojox.form._ListInputInputItem.readOnlyItem

    • type
      Boolean
    • summary
      if true, item is editable
  • dojox.form._ListInputInputItem.baseClass

    • summary
  • dojox.form._ListInputInputItem.value

    • type
      String
    • summary
      value of item
  • dojox.form._ListInputInputItem.regExp

    • tags: extension protected
    • type
      String
    • summary
      regular expression string used to validate the input
      Do not specify both regExp and regExpGen
  • dojox.form._ListInputInputItem._editBox

    • type
      Widget
    • summary
      inline edit box
  • dojox.form._ListInputInputItem._handleKeyDown

    • type
      handle
    • summary
      handle for the keyDown connect
  • dojox.form._ListInputInputItem.attributeMap

    • type
      Object
    • summary
  • dojox.form._ListInputInputItem.postMixInProperties

    • type
      Function
    • source: [view]
        var _nlsResources = dojo.i18n.getLocalization("dijit", "common");
        dojo.mixin(this, _nlsResources);
        this.inherited(arguments);
    • summary
  • dojox.form._ListInputInputItem.postCreate

    • type
      Function
    • source: [view]
        this.inherited(arguments);

        
        this.closeButtonNode = dojo.create("span",{
         "class" : "dijitButtonNode dijitDialogCloseIcon",
         title : this.itemClose,
         onclick: dojo.hitch(this, "onClose"),
         onmouseenter: dojo.hitch(this, "_onCloseEnter"),
         onmouseleave: dojo.hitch(this, "_onCloseLeave")
        }, this.domNode);

        
        dojo.create("span",{
         "class" : "closeText",
         title : this.itemClose,
         innerHTML : "x"
        }, this.closeButtonNode);
    • summary
      Create the close button if needed
  • dojox.form._ListInputInputItem.startup

    • type
      Function
    • source: [view]
        this.inherited(arguments);
        this._createInlineEditBox();
    • summary
      add the edit box
  • dojox.form._ListInputInputItem._setReadOnlyItemAttr

    • type
      Function
    • parameters:
      • value: (typeof Boolean)
    • source: [view]
        this.readOnlyItem = value;
        if(!value){
         this._createInlineEditBox();
        }else if(this._editBox){
         this._editBox.set("disabled", true);
        }
    • summary
      change the readonly state
    • tags:
  • dojox.form._ListInputInputItem._createInlineEditBox

    • type
      Function
    • source: [view]
        if(this.readOnlyItem){ return; }
        if(!this._started){ return; }
        if(this._editBox){
         this._editBox.set("disabled",false);
         return;
        }
        this._editBox = new dijit.InlineEditBox({
         value:this.value,
         editor: "dijit.form.ValidationTextBox",
         editorParams:{
          regExp:this.regExp
         }
        },this.labelNode);
        this.connect(this._editBox,"edit","_onEdit");
        this.connect(this._editBox,"onChange","_onCloseEdit");
        this.connect(this._editBox,"onCancel","_onCloseEdit");
    • summary
      create the inline editbox if needed
    • tags:
  • dojox.form._ListInputInputItem.edit

    • type
      Function
    • source: [view]
        if(!this.readOnlyItem){
         this._editBox.edit();
        }
    • summary
      enter inline editbox in edit mode
  • dojox.form._ListInputInputItem._onCloseEdit

    • type
      Function
    • parameters:
      • value: (typeof String)
    • source: [view]
        dojo.removeClass(this.closeButtonNode,this.baseClass + "Edited");
        dojo.disconnect(this._handleKeyDown);
        this.onChange(value);
    • summary
      call when inline editor close himself
    • tags:
  • dojox.form._ListInputInputItem._onEdit

    • type
      Function
    • source: [view]
        dojo.addClass(this.closeButtonNode,this.baseClass + "Edited");
        this._handleKeyDown = dojo.connect(this._editBox.editWidget,"_onKeyPress",this,"onKeyDown");
        this.onEdit();
    • summary
      call when inline editor start editing
    • tags:
  • dojox.form._ListInputInputItem._setDisabledAttr

    • type
      Function
    • parameters:
      • value: (typeof Boolean)
    • source: [view]
        if(!this.readOnlyItem){
         this._editBox.set("disabled", value);
        }
    • summary
      disable inline edit box
    • tags:
  • dojox.form._ListInputInputItem._getValueAttr

    • type
      Function
    • source: [view]
        return (!this.readOnlyItem && this._started ? this._editBox.get("value") : this.value);
    • summary
      return value
    • tags:
  • dojox.form._ListInputInputItem.destroy

    • type
      Function
    • source: [view]
        if(this._editBox){
         this._editBox.destroy();
        }
        this.inherited(arguments);
    • summary
      Destroy the inline editbox
  • dojox.form._ListInputInputItem._onCloseEnter

    • type
      Function
    • source: [view]
        dojo.addClass(this.closeButtonNode, "dijitDialogCloseIcon-hover");
    • summary
      Called when user hovers over close icon
    • tags:
  • dojox.form._ListInputInputItem._onCloseLeave

    • type
      Function
    • source: [view]
        dojo.removeClass(this.closeButtonNode, "dijitDialogCloseIcon-hover");
    • summary
      Called when user stops hovering over close icon
    • tags:
  • dojox.form._ListInputInputItem.onClose

    • type
      Function
    • source: [view]
        // summary:
        //  callback when close button is clicked
    • summary
      callback when close button is clicked
  • dojox.form._ListInputInputItem.onEdit

    • type
      Function
    • source: [view]
        // summary:
        //  callback when widget come in edition
    • summary
      callback when widget come in edition
  • dojox.form._ListInputInputItem.onClick

    • type
      Function
    • source: [view]
        // summary:
        //  callback when widget is click
    • summary
      callback when widget is click
  • dojox.form._ListInputInputItem.onChange

    • type
      Function
    • parameters:
      • value: (typeof String)
    • source: [view]
        // summary:
        //  callback when widget change its content
    • summary
      callback when widget change its content
  • dojox.form._ListInputInputItem.onKeyDown

    • type
      Function
    • parameters:
      • value: (typeof String)
    • source: [view]
        // summary:
        //  callback when widget get a KeyDown
    • summary
      callback when widget get a KeyDown
  • dojox.form._ListInputInputItem.attributeMap.value.node

    • summary
  • dojox.form._ListInputInputItem.attributeMap.value.type

    • summary
  • dojox.form._ListInputInputItem.attributeMap.value

    • type
      Object
    • summary
  • dojox.form._ListInputInputBox

    • type
      Function
    • chains:
      • dijit.form.ValidationTextBox: (prototype)
      • dijit.form.ValidationTextBox: (call)
    • summary
      auto-sized text box
    • description
      Auto sized textbox based on dijit.form.TextBox
  • dojox.form._ListInputInputBox.minWidth

    • type
      Integer
    • summary
      Min width of the input box
  • dojox.form._ListInputInputBox.intermediateChanges

    • type
      Boolean
    • summary
      Fires onChange for each value change or only on demand
      Force to true in order to get onChanged called
  • dojox.form._ListInputInputBox.regExp

    • tags: extension protected
    • type
      String
    • summary
      regular expression string used to validate the input
      Do not specify both regExp and regExpGen
  • dojox.form._ListInputInputBox._sizer

    • type
      DomNode
    • summary
      Used to get size of textbox content
  • dojox.form._ListInputInputBox.onChange

    • type
      Function
    • parameters:
      • value: (typeof string)
    • source: [view]
        this.inherited(arguments);
        if(this._sizer === null){
         this._sizer = dojo.create("div",{
          style : {
           position : "absolute",
           left : "-10000px",
           top : "-10000px"
          }
         },dojo.body());
        }
        this._sizer.innerHTML = value;
        var w = dojo.contentBox(this._sizer).w + this.minWidth;
        dojo.contentBox(this.domNode,{ w : w });
    • summary
      compute content width
  • dojox.form._ListInputInputBox.destroy

    • type
      Function
    • source: [view]
        dojo.destroy(this._sizer);
        this.inherited(arguments);
    • summary
      destroy the widget
  • dojox.form._ListInputInputBox._sizer.innerHTML

    • summary
  • this

    • mixins:
      • _nlsResources: (normal)
    • summary
  • dojox.form

    • type
      Object
    • summary
  • dojox

    • type
      Object
    • summary