java - dropdown select as ID and pass to action class but in search query i have given if null then search all content . how can i search by dropdown ID? -
function searchcontentdisplay(key) { var paramtypeid=$("#paramlist").val(); var paramvalue = document.getelementbyid("paramval").value; alert(paramvalue+paramtypeid); $("#ajax_loader").show('slow'); $.ajax({ url : "serachglobalparam", type : "post", data : 'globalparamdto.paramtypeid='+paramtypeid+'&globalparamdto.paramvalue='+paramvalue, async : true, cache : false, mimetype:"multipart/form-data", beforesend: function(){ $("#ajax_loader").show('slow'); }, complete: function(){ $("#ajax_loader").hide('slow'); }, success : function (data) { $("#searchglobalparam").html(data); } }); }
i want search content on select dropdown , id pass ajax. if dont select value dropdown search content list .the query working fine when on mysql have taken null select empty dropdown , serach content when pass selected dropdown on ajax work id .if select nothing 0 pass on ajax , travel action class 0 in query have given if null serach content .it seems problem between null , 0.
i have set if paramtypeid == 0 paramtypeid= null null travel action class not execute while.next statement dont know why not working.try { pstmt = conn.preparestatement(slcmqueryconstant.search_global_param);
pstmt.setstring(1,globalparamdto.getparamtypeid()); system.out.println(globalparamdto.getparamtypeid()); pstmt.setstring(2, globalparamdto.getparamvalue()); rs = pstmt.executequery(); while (rs.next()) { globalparamdto globalparamdto= new globalparamdto(); globalparamdto.setparamvalue(rs.getstring("value")); globalparamdto.setparamtypename(rs.getstring("param_type_name")); paramlist.add(globalparamdto); } } catch (sqlexception e) { e.printstacktrace();
Comments
Post a Comment