Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Blur problem on dynamicform

    Greetings,

    I'm using 7.0rc. I have a dynamic form with a search field. When the user clicks off of the field, if it's empty, I want to disable the add button. This works if I put an alert() in before the setEnabled(false) statement. Without the alert(), nothing happens. Any ideas?

    Code:
    isc.DynamicForm.create({
        fields:[
            {prompt:"Search for companies to add to your portfolio by entering a ticker symbol, full or partial company name, NAIC code, or group name.",
           	hint:"Click here to add companies to your portfolio.", 
            showHintInField:true, 
            ID:"folioQuickSearchField",
            name:"folioQuickSearchField",
            showPickerIcon:false,
            selectionType: "single",
            showFocused:false,
            selectOnFocus:false,
            optionDataSource: "PortfolioCompanySearchDS", editorType: "comboBox",
            showTitle:false, width:420, pickListHeaderHeight:1,
            pickListFields: [
    		 {name: 'company_code_dis', showTitle:false, width:55},
    		 {name: 'stmt', showTitle:false, width:35},
    		 {name: 'company_name', ID:'company_name', showTitle:false, width:260},
                     {name: 'ticker', showTitle:false, width:50},
                     {name: 'company_code', showIf:"false"},
                     {name: 'subscribed', showIf:"false"},
                     {name: 'ins_type', showIf:"false"}
                     ],            
              	getPickListFilterCriteria : function () {
                       var value = this.getDisplayValue();
                       if (value == '') {
    			value=' ';
                       }
                 	return {value:value};
                    },
        		focus: function (form, item) {
       			if (item.getValue() != null) {
        				findAddbtn.setEnabled(true);
        			}
        		},
       		change: function (form, item, value, oldValue) {
        			if (item.getValue() != null) {
       				findAddbtn.setEnabled(true);
        			}
        		},
        		blur: function (form, item) {
         			alert();
        			if (item.getValue() == null) {
    				findAddbtn.setEnabled(false);
        			}
         		}
     	        },
               	{startRow:false, disabled:true, ID:"findAddbtn", editorType:"button", width:100, title:"Add Company", click:"processForm('addCompany');folioQuickSearchForm.setValue(folioQuickSearchField,'');this.setEnabled(false)"}            
    	    ],
    	    ID:"folioQuickSearchForm",
    	    width:390,
    	    autoDraw:false
    	})

    #2
    alert() has very strange effects. Use the logging subsystem (isc.Log class) to troubleshoot.

    Once you've switched to using logging, please clarify what the problem is - are you seeing that the value is non-null, is your setEnabled() call actually executing but not having an effect, or some other problem?

    Comment


      #3
      Yeah sorry, I always forget to look at the console. And inexplicably, it's now working. Thanks anyhow.

      Comment

      Working...
      X