Announcement

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

    Search button in search form does not work

    Hi

    There are 3 SectionStacks in this form. 1st one is a search form 2nd one is a list grid and the 3rd one is a tab set with a dynamic form. there are 2 problems

    1) after searching
    for about 3 times the find button does not generate a rpc request.

    2) after updating list grid's selected data list grid does not show the updated values and it shows ( previous no of rows -1 )

    Can u figure out the problem here please

    Code:
    DataSource.create({
        ID:"CLM",
        fields:[
    
            {name:"clmId",  type:"sequence",  primaryKey:true,  hidden:true},
            {name:"railCars", title:"RailCar(s)", type:"textArea", length:500},
            {name:"eventDateFrom",title:"From event date",  useTextField:"true" ,type:"date",
            canFilter:true,  length:20},
    
            {name:"eventDateTo", title:"To event date", useTextField:"true" ,type:"date",
            canFilter:true,  length:20},
            {name:"systemDateTimeFrom",title:"System Date Time From",
             useTextField:"true" ,type:"date", canFilter:true,  length:20},
            {name:"systemDateTimeTo",title:"System Date Time To", useTextField:"true"
            ,type:"date", canFilter:true,  type:"date" },
            {name:"systemDateTime",title:"System Date Time ", type:"text"},
    
            {name:"eventDateTime",title:"Event Date Time", type:"text" },
    
         
            {name:"eventCodes", title:"Event Codes", canFilter: true, type: "comboBox"},
            {name:"sightingCode", title:"Sighting Code",   canFilter:true, type: "text"},
            {name:"eventCode", title:"Event Code", canFilter: true, type: "text"},
            {name:"loadStatus", title:"Load Status", canFilter: true,  type: "select", valueMap: ["E", "L"]}
           
    
        ]
    });
    
    
    isc.RPCManager.actionURL = "clmQueryOperations.jsp";
    
    isc.IButton.create({
        ID:"findButton",
        title:"Search",
        left:25,
        top:16,
        width:80,
        click:"boundList.fetchData(findForm.getValuesAsCriteria())"
        
    });
    
    
    
    
    
    
    
    
    isc.SearchForm.create({
        ID:"findForm",
        dataSource:"CLM",
        left:130,
        top:10,
        cellPadding:4,
        numCols:8,
        fields:[
    
    
           
            {name:"trainId"},
            {name:"destination"},
            {name: "sightingCode", title: "Sight Code", editorType: "select",
    	        optionDataSource: "CLM"}
         
    
        ]
    
    
    });
    
    
    
    
    
                  ListGrid.create({
                        ID:"boundList",
                        //autoDraw:false,
                        dataSource: CLM,
                        height:200,
    
                        fields:
                           [
                                {name:"equipmentInitial",width:70 ,wrap:true},
                                {name:"equipmentNumber",width:70 ,wrap:true},
                                {name:"loadStatus",width:100 ,wrap:true},
                                {name:"systemDateTime",width:130 ,wrap:true},
                                {name:"fleetFlag",width:115 ,wrap:true}
                           ],
    
    
     			wrapCells: true,
      			cellHeight:30,
      			headerHeight: 30,
                            canEdit:false,
    	                sortFieldNum: 2,
                         	sortDirection: "descending",
        			showSortArrow: "corner",
                            selectionChanged : function (record, state) {
                                if (this.selection.anySelected()) {
                                    deleteBtn.enable();
                                    saveBtn.setDisabled(this.selection.multipleSelected());
                                    editForm.editRecord(record);
                                    
                                    if (record.eventCode == "REL" ||  record.eventCode == "PUL"  ) {
                                   		reprocessBtn.enable();
                                                                  
                                    }else{
                                    
                                   		reprocessBtn.disable();
                                    
                                    }
                                    
                                    editForm.getField('equipmentInitial').setDisabled(true);
                                    editForm.getField('equipmentNumber').setDisabled(true);
                                    editForm.getField('systemDateTime').setDisabled(true);
    
                                } else {
                                    deleteBtn.disable();
                                    saveBtn.disable();
                                }
                            },
    
                              getCellCSSText: function (record, rowNum, colNum) {
    			     if (this.getFieldName(colNum) == "eventCode") {
    			                 if (record.eventCode == "REL" ||  record.eventCode == "PUL"  ) {
    			                    return "font-weight:bold; background-color:#C0C0C0;";
    					 } else {
    					    return this.baseStyle;
    					 }
    
    					 } else {
    	  		                   return this.baseStyle;
    					}
        			} 
           });
                        
    
       isc.VStack.create({
        ID:"frameLayout",
        width:"100%",
        height:"70%",         
    
     	members:
     	[
    		isc.DynamicForm.create({
        		ID:"editForm",
    		dataSource:"CLM",
        		fields:[
        		
        		    {name:"equipmentInitial"},
        		    {name:"equipmentNumber"},
        		    {name:"eventDateTime",type:"TextItem",
       			    blur: function () {
    			       editForm.validate();
    			}       
            
        		    },
        		    
        		    {name:"systemDateTime"},
       		    {name:"carrier",type:"TextItem",
        			    blur: function () {
    	    		           RPCManager.send(editForm.getValue('carrier') +'1',
    	    		           "editForm.popupValidationErrors(data)", { actionURL: "validation.jsp" });
    	    		           editForm.invalidateCache();
    		    }
    	      	},
            {name:"trainId"},
            {name:"destination"},
            {name: "sightingCode", title: "Sight Code", editorType: "select",
            optionDataSource: "CLM"},
            {name: "eventCode", title: "Event Code", editorType: "select",
            optionDataSource: "CLM"},
            {name:"loadStatus"},
            {name:"eventLocation"}
    	
            
            
          ],
    	numCols:8,
    	margin:10,
          
    	top:2,
    	autoFocus:false,
    	
    	popupValidationErrors : function (data) { 
    	       if (data != "" ) {
    		  isc.say(data); 
         		} 
    	}
        
    }),
    
    
     isc.HStack.create({
        ID:"1",
        
     members:[
     
     
    
    		isc.IButton.create({
    		    ID:"saveBtn",
    		    title:"Update",
    		    width:80,
    		    click : function () {
    		    
    		    editForm.saveData();
    		    
    		    
    		    }
    
    		}),
    
    		isc.IButton.create({
    		ID:"clearBtn",
    		    title:"Reset",
    		    width:80,
    		    click:"editForm.clearValues();editForm.editNewRecord();saveBtn.disable();reprocessBtn.disable();deleteBtn.disable();"
    
    		}),
    
    
    		isc.IButton.create({
    		    ID:"deleteBtn",
    		    title:"Delete",
    		    width:80,
    		    disabled: true,
    		    click:"boundList.removeSelectedData();boundList.deselectAllRecords();"
    
    		}),
    
    		isc.IButton.create({
    		    ID:"reprocessBtn",
    			title:"ReProcess",
    			disabled: true,
    			width:80,
    			click: function () {
    
    
    			RPCManager.send(editForm.getValue('sysDate') +'2' , "isc.say(data)", { actionURL: "validation.jsp" });
    
    			}
    
    		})
    
        ]
        
       })
       ]
        
        
        
    });
    
    
    
    
         ListGrid.create({
           ID:"reprocessList",
           autoDraw:false,
           dataSource: CLM,
           wrapCells: true,
           cellHeight:40,
           headerHeight: 30,
           fixedRecordHeights: false,
           height:170,
           width:"80%",
                        fields:
                           [
                               
                               
                               {name:"reProcessDate",width:100 ,wrap:true},
                               {name:"ruleDetails",width:360,height:30,wrap:true}
                                
                           ]
     		
        });
        
        
    
    
    
    
    
    
    isc.TabSet.create({
        ID:"clmDetailTabs",
        width:"100%",
        height:"95%",
        tabs:[
           
            {title:"Edit", pane:frameLayout, ID:"editTab", width:70},
            {title:"Rel Logic Rules", pane:reprocessList, ID:"reProcessTab", width:70}
            
        ],
    
        
    
        // Function to clear out selected items' details
        click : function () {
            var selectedTab = this.getSelectedTabNumber();
            if (selectedTab == 0) {
                // View tab: show empty message
                
            } else if (selectedTab == 1) {
                // Edit tab: show new record editor, or empty message
                RPCManager.send(editForm.getData() , "reprocessList.setData(data)", { actionURL: "validation.jsp" });
            }
        }
    
    });
    
    
    
    
    isc.HLayout.create({
        ID:"pageLayout",
        width:"100%",
        height:"100%",
        members:[
    
            isc.SectionStack.create({
                ID:"rightSideLayout",
                backgroundColor:"white",
                visibilityMode:"multiple",
                animateSections:true,
                sections:[
                    {title:"Find CLMs", autoShow:true, items:[
                        isc.Canvas.create({
                            ID:"findPane",
                            height:220,
                            overflow:"auto",
                            children:[findForm,findButton]
                        })
                    ]},
                    {title:"CLM Listing", autoShow:true, items:[boundList]},
                    {title:"CLM Listing Details", autoShow:true, items:[isc.Canvas.create({
                            ID:"detailPane",
                           width:"100%",
                            height:220,
                            overflow:"auto",
                            children:[clmDetailTabs]
                        })
                        
                        ]}
    	          ]
    	  })
        ]
    });
    
    isc.DataSource.get("CLM").filterData(null, "editForm.setData(data);findForm.setData(data)");
    
    
    
    
    
    
    </SCRIPT></BODY>

    #2
    From a quick inspection:

    1) it's normal for there to be no RPC request if criteria have either not changed or become more specific. See the docs for fetchData.

    2) you are calling setData() on the grid from tabSelected(), this may be the problem. Other than that, if you'd like more help, please create a standalone test case so other people can reproduce what you are seeing

    Comment

    Working...
    X