Hi, im trying to let a user input an Address that is broken down into parts like address,city,state,zip and so on
but from some reason my ajax call wont bring in the second parameter i try to pass to i, here is the java function
The html is a basic text box
<divclass=“four columns”id=“navigation”><divid=“instrux-body”><labelfor=“txtSearch”>Search Wells by Lease Name:</label><inputtype=“text”id=“txtSearch”/><labelfor=“txtTest”>Field Name</label><inputtype=“text”id=“txtTest”/><inputtype=“button”id=“btnSearch”onclick=“searchWellByLeaseName()”value=“Search”/></div></div>
Is there something i have overlooked any help is appreciated
function searchWellByLeaseName() {// Remove previous search results display, if any$(’#well-search-results’).remove();
// Get the OpenLayers map objectvar olMap = Map1.getOpenLayersMap();
// Get the query the user entered in the search textboxvar searchText = txtSearch.value;var fieldText = txtTest.value;// Do nothing if the query was blank or contained only whitespaceif (searchText === null || searchText.match(/^ *$/) !== null ){return false;}
// Call the SearchText server action with the search query and current map sizevar params = { searchMode: ‘lease_name’, searchParam: searchText, fieldParam:fieldText, mapWidth: Map1.div.clientWidth, mapHeight: Map1.div.clientHeight };Map1.ajaxCallAction(“Home.mvc”, ‘SearchWells’, params , function (result) {// The callback contains a JSON string representing either the extent to zoom into, or a collection of features matching the query.var returnResult = result.get_responseData();if (returnResult != “”) {var searchResultFeatures = JSON.parse(returnResult);
// If there was exactly one result, the return contains an extent that we should zoom into.if (searchResultFeatures.length === 1) {var featureExtent = searchResultFeatures[0].wkt;olMap.zoomToExtent(OpenLayers.Geometry.fromWKT(featureExtent).getBounds(), true);}// If there is more than one result, display a list allowing the user to select which one they want to zoom to.else if (searchResultFeatures.length > 1) {
var resultsMarkup = ‘<divid=“well-search-results”><ul>’;jQuery.each(searchResultFeatures, function (index, object) {var id = object.id;var kid;var leaseName;jQuery.each(object.values, function (index, object) {if (object.Key == ‘KID’) kid = object.Value;if (object.Key == “LEASE_NAME”) leaseName = object.Value;});resultsMarkup += ‘<li><ahref="#"data-featureid="’ + id + ‘"title=“KID: ’ + kid + '”>’ + leaseName + ‘</a></li>’;});resultsMarkup += ‘</ul>’;
$(’#instrux-body’).append(resultsMarkup);$(’#well-search-results’).css({top: ($(’#txtSearch’).position().top + $(’#txtSearch’).outerHeight(true)) + ‘px’,left: $(’#txtSearch’).position().left + ‘px’,“min-width”: $(’#txtSearch’).outerWidth(true) + ‘px’,});$(’#well-search-results ul’).sortList();
}}// If there are no results, display a message to that effectelse {var resultsMarkup = ‘<divid=“well-search-results”><ul><liclass=“no-result”>No results found.</li></ul></div>’;$(’#instrux-body’).append(resultsMarkup);$(’#well-search-results’).css({top: ($(’#txtSearch’).position().top + $(’#txtSearch’).outerHeight(true)) + ‘px’,left: $(’#txtSearch’).position().left + ‘px’,“min-width”: $(’#txtSearch’).outerWidth(true) + ‘px’,});}});
// Redraw the WellOverlay layerMap1.redrawLayer(“WellOverlay”);}