You need to sign in to do that
Don't have an account?
gv007
java script remoting not working what is wrong with this code
I have a commandbutton in a VF page when I clicked in the rendering event form is loaded dueing that time ,below code need to be excutes.
I have some type of code pulling data from two diffrent object.First one not working .Second one is working.In the background in the controller I am seeing in the list I am getting the records two.Any help appriciated
<div class="dc1" id="d01" style="width: 397px;">
<apex:pageBlock id="pb1">
<apex:outputPanel id="op1" rendered="{!strWar != null && strWar != ''}">
<script type="text/javascript">
var j$ = jQuery.noConflict();
j$(document).ready(function() {
var autoCompleteTextBoxId = "input[id$='txtOrderSearch']";
var queryTerm;
j$(autoCompleteTextBoxId).autocomplete( {
minLength: 0,
source: function(request, response) {
queryTerm = request.term;
var sObjects;
var searchText = j$(autoCompleteTextBoxId).val();
var strSel = '{!strWar}';
var strStart = '{!strSDate}';
var strEnd = '{!strEDate}';
Contollerclass.Method(str, strSel, strStart, strEnd, function(result, event) {
if (event.type == 'exception') {
alert(event.message);
} else {
sObjects = result;
response(sObjects);
setDnDJquery();
}
});
},
})
.data("autocomplete")._renderItem = function(ul, item) {
AddOrder(item);
ul = null;
return j$(null)
};
});
function AddOrder(item) {
var table = document.getElementById('pbtOrder');
var rowCount = table.rows.length;
var row = table.insertRow(rowCount);
row.className = 'dataRow';
var cell1 = row.insertCell(0);
cell1.className = 'dataCell';
var eleDiv = document.createElement("div");
eleDiv.className = "divOrder";
//eleDiv.tagName = "DIV";
cell1.appendChild(eleDiv);
var eleSpan1 = document.createElement("span");
if (item.Order_c != undefined)
eleSpan1.innerHTML = item.Order__c;
}
</script>
<apex:inputText id="txtSearch" styleClass="Search" value="{!strOrderSearch}" />
<div id="divOLTable" style="overflow-y: auto;">
<apex:pageBlockTable id="pbt" value="{!lstOrders}" var="objOrder" headerClass="pbTaH">
<apex:column >
<div class="divOrder">
<input id="MY_ID" type="hidden" value="{!objOrder.Id}" />
<input id="MY_TYPE" type="hidden" value="ORDER" />
<apex:outputText value="{!objOrder.Order__c}" />
</div>
</apex:column>
</apex:outputPanel>
</apex:pageBlock>
<input id="MY_TYPE" type="hidden" value="ORDER" />
</div>
I have some type of code pulling data from two diffrent object.First one not working .Second one is working.In the background in the controller I am seeing in the list I am getting the records two.Any help appriciated
<div class="dc1" id="d01" style="width: 397px;">
<apex:pageBlock id="pb1">
<apex:outputPanel id="op1" rendered="{!strWar != null && strWar != ''}">
<script type="text/javascript">
var j$ = jQuery.noConflict();
j$(document).ready(function() {
var autoCompleteTextBoxId = "input[id$='txtOrderSearch']";
var queryTerm;
j$(autoCompleteTextBoxId).autocomplete( {
minLength: 0,
source: function(request, response) {
queryTerm = request.term;
var sObjects;
var searchText = j$(autoCompleteTextBoxId).val();
var strSel = '{!strWar}';
var strStart = '{!strSDate}';
var strEnd = '{!strEDate}';
Contollerclass.Method(str, strSel, strStart, strEnd, function(result, event) {
if (event.type == 'exception') {
alert(event.message);
} else {
sObjects = result;
response(sObjects);
setDnDJquery();
}
});
},
})
.data("autocomplete")._renderItem = function(ul, item) {
AddOrder(item);
ul = null;
return j$(null)
};
});
function AddOrder(item) {
var table = document.getElementById('pbtOrder');
var rowCount = table.rows.length;
var row = table.insertRow(rowCount);
row.className = 'dataRow';
var cell1 = row.insertCell(0);
cell1.className = 'dataCell';
var eleDiv = document.createElement("div");
eleDiv.className = "divOrder";
//eleDiv.tagName = "DIV";
cell1.appendChild(eleDiv);
var eleSpan1 = document.createElement("span");
if (item.Order_c != undefined)
eleSpan1.innerHTML = item.Order__c;
}
</script>
<apex:inputText id="txtSearch" styleClass="Search" value="{!strOrderSearch}" />
<div id="divOLTable" style="overflow-y: auto;">
<apex:pageBlockTable id="pbt" value="{!lstOrders}" var="objOrder" headerClass="pbTaH">
<apex:column >
<div class="divOrder">
<input id="MY_ID" type="hidden" value="{!objOrder.Id}" />
<input id="MY_TYPE" type="hidden" value="ORDER" />
<apex:outputText value="{!objOrder.Order__c}" />
</div>
</apex:column>
</apex:outputPanel>
</apex:pageBlock>
<input id="MY_TYPE" type="hidden" value="ORDER" />
</div>