Need another set pf experienced eyes
Need another set pf experienced eyes

This is my screen, everything renders fine, pop ups all work but he save button when clicked simply never goes into the code url:"/cma/contents/screening/restrictedEntityGroup_data_create" code. I copied this code from another screen
that does work with slighlty different call to server code. This screen just skips the code after save clicked(and yes it exists). I never get it to go into my breakpoints on server side code. I changed it to another server side code and that does work and it didnt hit that either. So something is wrong with this screen somehow. I am not seeing why it never goes into that server side code.
Is there something wrong with my popup that could be causing this, or am I doing something with the save button I shouldnt?
<?xml version="1.0" encoding="UTF-8" ?>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="page" uri="http://www.opensymphony.com/sitemesh/page"%>
<!DOCTYPE HTML>
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head>
<title>Restricted Entity Groups</title>
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Expires" CONTENT="-1">
<link rel="stylesheet" href="https://cdn.datatables.net/searchbuilder/1.0.1/css/searchBuilder.dataTables.min.css">
<link rel="stylesheet" href="https://cdn.datatables.net/1.10.23/css/dataTables.bootstrap4.min.css">
<link rel="stylesheet" href="https://cdn.datatables.net/buttons/1.6.5/css/buttons.dataTables.min.css">
<link rel="stylesheet" href="https://cdn.datatables.net/v/bs4-4.1.1/dt-1.10.18/datatables.min.css">
<script src="https://code.jquery.com/jquery-3.5.1.js"></script>
<script src="https://cdn.datatables.net/1.10.23/js/jquery.dataTables.min.js"></script>
<script src="https://cdn.datatables.net/v/bs4-4.1.1/dt-1.10.18/datatables.min.js"></script>
<script src="https://cdn.datatables.net/buttons/1.6.5/js/dataTables.buttons.min.js"></script>
<script src="https://cdn.datatables.net/buttons/1.6.5/js/buttons.flash.min.js"></script>
<script src="https://cdn.datatables.net/searchbuilder/1.0.1/js/dataTables.searchBuilder.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.1.3/jszip.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.53/pdfmake.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.53/vfs_fonts.js"></script>
<script src="https://cdn.datatables.net/buttons/1.6.5/js/buttons.html5.min.js"></script>
<script src="https://cdn.datatables.net/buttons/1.6.5/js/buttons.print.min.js"></script>
<link type="text/css" rel="stylesheet" href="../../css/default.css" />
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.min.js"></script>
<script src="https://code.jquery.com/jquery-migrate-3.0.0.js"></script>
<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
<link rel="stylesheet" href="https://code.jquery.com/ui/1.11.1/themes/smoothness/jquery-ui.css" />
<link type="text/css" href="//gyrocode.github.io/jquery-datatables-checkboxes/1.2.12/css/dataTables.checkboxes.css" rel="stylesheet" />
<script type="text/javascript" src="//gyrocode.github.io/jquery-datatables-checkboxes/1.2.12/js/dataTables.checkboxes.min.js"></script>
<style>
.toolmenu-widget
{font-family: Verdana, Arial, sans-serif; font-size: .8em; background-color: #F5F6F8; text-align: left; margin: 0; padding: 0; margin-bottom: 0px; border-bottom: 2px solid gray; position: absolute; top: 60px; left: 0px; width: 100%; min-width: 800px; height: 60px;}
</style>
<script>
$(document).ready(function() {
var dataTableId = '#standard_datatable';
// Data Table
var rows_selected ;
var table = $(dataTableId).DataTable({
dom: 'Bfrtip',
buttons: [{
//Add new config button~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
text: 'Add Restricted Entity Group' ,
action: function ( e, dt, node, config ) {
// Reset form
$('#form-edit').get(0).reset();
// Show dialog
$('#modal-edit').modal('show');
// Handle modal shown event
$('#modal-edit').on('shown.bs.modal', function (e){
// Get row data
var data = table.row( $(this).parents('tr') ).data()[ 1 ];
// Set initial data
$('#edit-name').val(data[1]).focus();
});
// Handle form submission event
$('#form-edit').on('submit', function (e){
e.preventDefault();
// Hide dialog
$('#modal-edit').modal('hide');
// Update table data
data = $('#edit-name').val();
var result = $.ajax({
type: 'POST',
url:"/cma/contents/screening/restrictedEntityGroup_data_create" ,
data: {'groupName' : data},
context: this
});
});
}
},
'copy', 'excel', 'pdf', 'searchBuilder'
],
ajaxSource : "/cma/contents/screening/restrictedEntityGroupDetails_data?groupName=<%= (String)request.getAttribute("groupName")%>",
'columnDefs': [
{
'targets': 0,
'checkboxes': {
'selectRow': true
},
'createdCell': function (td, cellData, rowData, row, col){
if(rowData[0] === '1')
{this.api().cell(td).checkboxes.select();
}
}
},
],
//'select': { 'style': 'multi'},
//'order': [ [ 2, 'asc' ], [ 3, 'asc' ]]
});
//hide the guid columns
table.column( 1).visible( false );
});
</script>
</head>
<body>
<div class="toolmenu-widget">
<div class="breadCrumb" id="breadcrumb">
<ul>
<li>
<a href="${pageContext.request.contextPath}/">Home</a>
</li>
<li>
<a href="${pageContext.request.contextPath}/contents/screening/restrictedEntityGroups">Restricted Entity Groups</a>
</li>
<li>
Restricted Entity Group: <I><%= (String)request.getAttribute("groupName")%></I>
</li>
</ul>
</div>
</div>
<div class="standard-table" >
<table class="display" id="standard_datatable" width="100%">
<thead>
<tr>
<th title=""></th>
<th title=""></th>
<th title="">Restricted Entity List Name</th>
<th title="">Jurisdiction</th>
<th title="">Group Membership Status</th>
<th title="">List Status</th>
<th title="">Expiration Date</th>
<th title="">Added to Group By</th>
<th title="">Added to Group Date</th>
<th title="">Removed from Group By</th>
<th title="">Removed from Group Date</th>
<th title=""></th>
</tr>
</thead>
</table>
</div>
<!-- Dialog "Delete Record" -->
<div id="save_div" class="modal" role="dialog" title="Delete Restricted Entity Group" tabindex="-1">
<form id="save_form" method="post">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="ui-helper-clearfix ui-widget-header"><p class="ui-dialog-title" >Save selected records?</p></div>
<div class="modal-footer" >
<button type="submit" class="btn btn-primary">Save</button>
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</form>
</div>
</body>
</html>
Answers
Nothing immediately obvious stands out as being a problem in the above - can you link to a test case showing the issue please?
Allan
So through process of elimination I found whats causing it. It has something to do with trying to pass check box data to server code. I rebuilt screen with one that works. When I add this one line of code it goes back to not working. No errors in consul or anything. Is this not the right way to get the selected rows? I want user to click save and pass in the selected rows to server side code.
rows_selected = table.rows('.selected').data();
That line of code doesn't appear to be in what you pasted above?
What you are using the Select extension, you are normally best using
table.rows({selected: true}).data()
. See the documentation here.Allan
Well, as it turns out I was in fact getting an error in consul, it flashes then goes away. So strange. This is the error I captured. This ONLY occurs if try an access checked values and pass on too server side code. Am I doing something wrong with searchbuilder or using wrong version of js file?
Uncaught TypeError: Cannot set property 'searchBuilder' of undefined
at dataTables.searchBuilder.min.js:139
at add (jquery-3.5.1.js:8932)
at buildParams (jquery-3.5.1.js:8919)
at buildParams (jquery-3.5.1.js:8913)
at Object.<anonymous> (jquery-3.5.1.js:8900)
at Function.each (jquery-3.5.1.js:381)
at buildParams (jquery-3.5.1.js:8891)
at buildParams (jquery-3.5.1.js:8913)
at buildParams (jquery-3.5.1.js:8913)
at buildParams (jquery-3.5.1.js:8913)
That sounds like the SearchBuilder files aren't being loaded. To progress this, it would help if we could see the issue - a test case that replicates the issue will ensure you'll get a quick and accurate response. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.
Cheers,
Colin