On Jan 11, 7:06*pm, "css-discuss.org" <janis.ro...@gmail.com>
Okay, I added the 2nd event listener function, first is for
filterSubmit and 2nd is for filterSearch.
Two separate filters. I modified the config function to incorporate
both events but there is a syntax error or a data error.
Can you please advise? Thanks.
var filterClickHandler = function(){
YAHOO.log("filter clicked");
var xmlStartDate = YAHOO.util.Dom.get("xmlStartDate").value;
var xmlEndDate = YAHOO.util.Dom.get("xmlEndDate").value;
var plant = YAHOO.util.Dom.get("userPlant").value;
loadSecondaryFilters(xmlStartDate, xmlEndDate, plant);
var configURL = getConfigURL(xmlStartDate, xmlEndDate);
loadDataTable(configURL);
};
YAHOO.util.Event.addListener("filterSubmit", "click",
filterClickHandler);
var filterClickHandler2 = function(){ //1_11_2012 jr added function
// YAHOO.log("orderNumber filter clicked");
var orderNumber = YAHOO.util.Dom.get("orderNumber").value;
var submitType=1;
var configURL = getConfigURL(submitType);
loadDataTable(configURL);
};
YAHOO.util.Event.addListener("filterSearch", "click",
filterClickHandler2);
function getConfigURL(submitType,xmlStartDate, xmlEndDate) {
var plant = YAHOO.util.Dom.get("userPlant").value;
if(submitType===undefined) { //clickHandler
var configURL = "/XMII/Illuminator?Transaction=" +
RN.config.GLOBAL_DIR + "/Message%20Queue/
GetMessageQueue&Server=XacuteConnector&Mode=Query& RowCount=99999&OutputParameter=outputXML&Content-
Type=text/xml&key=message";
configURL += "&ST=" + xmlStartDate;
configURL += "&ET=" + xmlEndDate;
configURL += "&plant=" + plant;
}else if(xmlStartDate===undefined &&
xmlEndDate===undefined) { //clickHandler2
var configURL = "/XMII/Illuminator?Transaction=" +
rn.config.GLOBAL_DIR + "/Message%20Queue/
GetMessageQueue&Server=XacuteConnector&Mode=Query& RowCount=99999&OutputParameter=outputXML&Content-
Type=text/xml&key=orderNumber";
configURL += "&plant=" + plant;
}
if(hasValue("orderNumber")){
configURL +="&orderNumber="
+YAHOO.util.Dom.get("orderNumber").value;
}
if(hasValue("empNo")) {
configURL += "&empNo=" +YAHOO.util.Dom.get("empNo").value;
}
if(hasValue("processDD")) {
configURL += "&processcd=" + YAHOO.util.Dom.get("processDD").value;
}
if(hasValue("systemDD")) {
configURL += "&systemcd=" + YAHOO.util.Dom.get("systemDD").value;
}
if(hasValue("functionDD")) {
configURL += "&functioncd=" +
YAHOO.util.Dom.get("functionDD").value;
}
if(hasValue("pageDD")) {
configURL += "&page=" + YAHOO.util.Dom.get("pageDD").value;
}
if(hasValue("moduleDD")) {
configURL += "&module=" + YAHOO.util.Dom.get("moduleDD").value;
}
if(hasValue("statusDD")) {
configURL += "&status=" + YAHOO.util.Dom.get("statusDD").value;
}
return configURL;
}
|