This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Svelte and Sapper in Action and have Mark Volkmann on-line!
See this thread for details.
Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!

Glyndwr Bartlett

Ranch Hand
+ Follow
since Jul 30, 2018
I am not a programmer. I am learning as I go in order to create an award application for Scouts.
Australia
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
4
Received in last 30 days
0
Total given
24
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Glyndwr Bartlett

Hi Carey,

Because in my current DataTables there is one "Search:" field, not one for each column. I think there is a way to implement search on each column so I will investigate that.

Thank you so much for your help and asking the right questions :-)

Kind regards,

Glyn
Hi Carey,

Yes, DataTables sends the search request on each key-up in the "Search:" field.

"LIKE 'glyn%' will not work when searching for "glyn bartlett".

I have now tried the multiple OR statements (one for each column) with searchValue = searchValue.replace(" ", "%");. However, that works until "glyn " and then stops at "glyn b". This also needs to work if someone enters "bartlett glyn". These all work on the client-side version where the search is handled by DataTables. The issue is that I need to be able to replicate how DataTables does that search with my java code and/or MySQL.

I am concatenating my stored procedure depending on the values received. The two ways I have tried are:



This works on "g", "gl", "gly", "glyn", "glyn " and stops working on "glyn b".

and:



This does not work until "glyn" is entered.

Note: I need the OR MATCH in the second code because "sd_start_date" is in a different table.

Kind regards,

Glyn
I am using DataTables and have converted an existing client-side to server-side (Java, MySQL). I have one last issue which is with the search functionality. With the client-side if I enter "Glyn Bartlett 20/12/2000" then I get all instances of this string (i.e., First Name: Glyn, Surname: Bartlett, DOB: 20/12/2000) and on each key-up the list is progressively filtered (i.e., all rows with a "g" are displayed then all rows with a "gl", etc). I have followed the examples which use OR statements to compare the string for each column that can be searched. As a result after the first space (e.g., "Glyn ") this no longer works.

I then found MySQL Full-Text Searches. However, that will only match on a full word (e.g., if "glyn" is entered then no rows are returned until the full word is entered - I suppose that is why they call it "Full-Text").

What is the most efficient way to implement this search in server-side processing considering:

I have eight columns that can be searched
Each key-up triggers the server-side call
I want to progressively filter on each key-up
I want it to work on dates entered as dd/mm/yyyy and stored as yyyy-mm-dd
Kind regards,

Glyn
Hi Paul and Zachary,

I am most certainly using prepared statements. I will add more displays to see exactly where it is going wrong when I pass a special character to it.

Kind regards,

Glyn
5 days ago
In my server-side Java I want to escape all special characters so I can include the string in a MySQL search.



Kind regards,

Glyn
5 days ago
I am trying to convert a working DataTables to server-side. I will probably have a few issues and need a patient forum that is willing to help a person who does not program for a living and has a lot of holes in their understanding. My first issue occurs when I add:



To my existing code I get the error:

   DataTables warning: table id=youthMemberTable - Invalid JSON response. For more information about this error, please see http://datatables.net/tn/1

And on the console log:




The "YouthMemberAdminListView.java" is not reached (I have a System.out.println on entry that is not displayed).

According to "http://datatables.net/tn/1"; this is fairly easy to diagnose. Sorry, I am not finding it so easy.

The DataTables code is:


Hi Bear,

"It does work on a Windows touch screen (Chrome, Explorer, Edge, Firefox)." So yes I have tested it elsewhere. I have not found this behaviour anywhere else. I have not tested it on Linux yet. :-)

Kind regards,

Glyn
I am creating a bootstrap button dynamically. When I select it on an iPad the colour changes however it does not trigger the form submission. It does work on a Windows touch screen (Chrome, Explorer, Edge, Firefox).

The code is:

CSS:



js:



html:

     
Hi Paul,

OK, a slight misunderstanding, resulting from my poorly written question. This is not in production yet, I just want to make sure that it will not go wrong in production (I am trying to be preemptive). Secondly, this is an Event with a program each day (this code allows the owner to move the programs from one day to another). The person who created the Event is the only who can update the daily programs. So, therefore, I take it that the three will always sets of statements will always be executed in the correct order, as no one else will be performing this task at the same time?

Kind regards,

Glyn
Hi Paul,

Sorry; however, your reply does not make sense to me. I read it that they will be executed one by one in the correct order; however, they may be executed simultaneously. How can both occur?

I can not find any information on how to wrap the three updates in a transaction. The only thing I found was to place "START TRANSACTION;" before the the three updates and then "COMMIT;" after them. However, that gives an error "START can not be resolved to a type".

This is my full code:



Kind regards,

Glyn
I am swapping two dates so I want to ensure that the prepared statement updates occur in the correct order (i.e., multi-threading and system performance do not affect the order). This is hard to test (i.e., it is obvious if it goes wrong in the test environment; however, sometime it does not go wrong until it is in the production environment which has a different performance) so I ask my learned colleagues will the following always occur in the correct order:





I am also very open to a better way of coding this.

Kind regards,

Glyn
I also would find this interesting. I am currently reading up on Handlebars. So far I do not see how that is any better than html strings. What am I missing?

Kind regards,

Glyn
Hi Stephan and Bear,

You are both absolutely right and I appreciate your input. I have started reading up on this (Handlebars especially). In the mean time I need to get the current code to work.

Bear - "unless another element is layered over it capturing the mouse clicks." Brilliant! I have the following css:



This is so I can set a dropped item as dragable so it can be removed as per:



So the solution is more css:



What I can not figure out is why the overlay is reaching down one row and to the right?

Kind regards,

Glyn


I am inserting a table row after the current row by clicking on a button. The row is inserted as required; however, the input fields, after the first, and button at the end of the row are not working. The input fields can not be clicked on to add data; however, I can tab into them to add data. The button at the end of the row does not register a click. You can tab to the button and hit enter and it works (tabbing to it and clicking does not).

The existing row is:



The function to add a new row is:



This is what it looks like with the new row added: