SearchBuilder server-side support ( Java)
SearchBuilder server-side support ( Java)
KarthikGuttapudi
Posts: 5Questions: 1Answers: 0
Hi All,
We are using server-side processing (Java), and cannot find how to get the SearchBuilder request details. Currently we are using "data" function to modify the data sent to server-side code (Java), can we get the SearchBuilder request in the "data" function so that we can send it to server-side.
"ajax": {
"url": ....,,
"contentType": "application/json",
"type": "POST",
"headers": .....,
"dataType": "json",
"data": function ( d ) {
let request = requestData;
request.dataTablerequest = d;
return JSON.stringify( request );
},
Answers
The client should be sending the data to the server automatically, see this example demonstrating that. Here, the backend is JS, so that wouldn't be of any use to you, but you should be getting the data still. Can you see if that helps, please, and if not, can you link to your page so we can take a look,
Colin
Thank you for the reply Colin. Yes I looked at that example earlier, in the example I see that the search builder criteria is sent in the request. In my case whenever I add a condition (using SearchBuilder) the ajax call (to server) get triggered but I do not see the search builder criteria getting sent in the request body. Will setup a test page, I am not sure how to setup the server-side though as I cannot expose my server code/API in the test page.
I fear we won't be able to help you with the Java aspect of this. If the information is being sent to the server, then how to get it in the Java program - I'm afraid we don't know as we don't provide or support Java libraries. You must be getting other information from the request such as the ordering information though - presumably you'd be able to use the same sort of method.
Allan
Hi Allan, may be I was not clear, I do not see the SearchBuilder criteria being sent in the request by DataTables.
One thing to note is that you need to have enabled
serverSide
for that data to be sent, as it's part of the server-side protocol,Colin
Yes Colin, I am using the serverSide but still the search builder criteria is getting sent in request. Found a way, I had to manually send the search builder details like this, to send them in the request to the server
but then you said:
I'm not clear on which it is since they appear to be opposite statements? Is it is only being sent if you use the
getDetails
function manully?Allan
Hi Allan, my bad, it is a typo, issue is solved now after doing it like mentioned above. Yes criteria is only getting sent If I use the getDetails manually
Hello Karthik Guttapudi, I saw your previous conversation, and I need assistance implementing server side processing in Java. Could you provide any of the resources you utilized or explain how you accomplished it in Java?