Delete selected checkbox ticked rows - database

I am new on jsp. I am providing the checkboxes in front of every row that are being fetched from DB. Now I want to delete the rows whose checkboxes have been checked.
Please suggest how to achieve this task on submit of form.
I can make the delete query at my end but issue is with check boxes ticked or not ticket approach.
Do we have any way as request.getParameter("delete_checkbox").value or something like this?

This is what you need :
http://theopentutorials.com/examples/java-ee/servlet/getting-checkbox-values-from-html-form-in-servlet/
As shown in the tutorial in value attribute pass the Id of your records.
Parse them to Long in servlet and make a server hit to delete.

Related

Add or delete rows to Oracle Apex DB with cancel option

I would like to request help for design something in Oracle Apex.
Our Apex users can add or delete new row to tables in a page. Also after they making addition they got cancel button to the whole page.
The cancel button suppose to bring everything to it's previous state. E.g delete added rows, un-delete deleted rows, undo change of rows..
My solution now is adding another column (Hidden) to the database, which handles the row state, but it's not clean, and not working perfectly.
I'll be happy for new ideas, whether is DB related or Apex related, Thanks.
It is common practice to use APEX collections for this sort of thing. Before first showing the page, populate APEX collections with a copy of the existing data from the real tables. Let the user add, delete and update rows in the APEX collections. The Save button would then invoke a process to make the corresponding changes to the real tables, and Cancel would just leave without making any changes,

How to do a checklist/to-do list in Cakephp?

I am trying to create a checklist/to-do list app in Cakephp.
In the mySQL database I have a column called 'done' which is either true or false.
I have all my tasks in a table.
How do I change the value of that field when I either tick a checkbox or click on the task in the table row?
I want to be able to change this field without having press submit on a form or reload the page.
Is this possible in Cakephp?

Add a user clickable check box in SSRS report

I am creating a report that for the most part is populated automatically by using variables, parameters with my datasource and dataset. I am trying to add in another column that will have a checkbox, where when the user pulls a report he or she can manually go in and click a check box for various rows. The clicked check box is done by the user and there is no need to send or retrieve data with this check box. Is there a simple solution to where I can add a checkbox for the user to check (and uncheck) various boxes?
SSRS does not deliver this kind of functionality. You would need to have a flag for every displayed row somewhere in your database and add two images to your report, a checked and one unchecked "checkbox" image, show those images on each row (source over expression) based on the flag of the row. Add an action to the image, that executes a storedProc and flags or unflags the row (pass an unambiguous id as parameter).
This is rather dirty, but would work.

Opening Button to open form based on combo box selection

I currently have a MS Access database of members.
I have a form that has a combo box which is populated with just the first and last names of members. (using a test database for now)
What im struggling with is how do i create a button that opens another form i have created but using the selection in the dropdown box to populate the fields in the newly opened form.
When a user from the dropdown box is selected an open is clicked i want it to open the profile form populated with their details.
pictures and access files can be found on my ftp server:
ftp://ftp.legends-gym.co.uk
User: ftpuser#legends-gym.co.uk
Pass: ftpuser
Regards
I can't access ftp site from work so can't see what you've got thus far however, the key bits you want to look at here are:
Add a button to the form and the On Click Event to open your profile form. Something along the lines of docmd.openform "frmProfile", acNormal
You need something to pass the member you've selected in the combo box to the profile form. One way might be to use OpenArgs so have a look at that
You then could use the passed variable in OpenArgs to select the data you want to fill out your profile form.
EDIT...
OK, I've had a look at the file now. Here is what you need to do to fix your problems (and a couple of extra bits which aren't causing an issue but will improve the look and feel).
On the Format of the Home form and the Member Search form, set Navigation Buttons and Record Selector to false. - This removes the unnecessary elements for a "single" form, you're not looking at records.
On the member search form, remove the binding to the members table. - You don't need to bind this form, as the recordsource of the combo is pulling the data required separately. if you look at your form before you change it, you'll notice you've got 1 of 10 records...
Also, remove the filter criteria and set filter on load to No - You were filtering the wrong form.
On the combo box, remove the after update event. - I'm not sure what that was trying to do but its completely unnecessary.
On the command button, add an onclick event which has the following code DoCmd.OpenForm "Profile", acNormal, , "ID = " & Me.Combo361 & ""
Save everything and enjoy. :)
You weren't far wrong with the filter, but it's actually a WHERE clause when opening another form - sorry, my bad misdirection. What you were doing was filtering the original form - ie the member search form. Also, you don't need to put ' quotes around the ID, it's a number not a string.
If you have problems I can probably host this fixed version somewhere for you to download.

Oracle ADF: How to filter out rows in RichTable?

I have following requirement.
Display data in a table
Clicking on checkbox filter out currently displayed rows by some condition
Clicking on checkbox once again return data appearance to it's previous state
To achieve this I've ovverided method rowQualifies in my ViewObject which is simple SQL based view object to apply my custom filter logic.
When user clicks on checkbox I refresh view object data to apply filter
viewObject.setDoFiltering(true);
viewObject.setQueryMode(ViewObject.QUERY_MODE_SCAN_VIEW_ROWS);
viewObject.executeQuery();
It works perfectly, data set updates without interacting with database and my custom filter logic applies as well.
But when I need to cancel filter it wouldn't work because iterator doesn't contain anymore previous rows, and I can only load them from database but it means that I can lose my changes already made to view object rows.
So, when I do
viewObject.setDoFiltering(false);
viewObject.setQueryMode(ViewObject.QUERY_MODE_SCAN_VIEW_ROWS);
viewObject.executeQuery();
It will return me those rows that were displayed previous time.
If I do
viewObject.setDoFiltering(true);
viewObject.setQueryMode(ViewObject.QUERY_MODE_SCAN_DATABASE_TABLES);
viewObject.executeQuery();
It will return me all rows, but I will lost my changes already made to view object rows.
My questions is how to avoid it? Maybe there is another way of doing this? Maybe it is possible to do something with RichTable to tell it how to filter rows in memory.
Any advices are warmly appricated!
I believe this can be done using ViewCriteria, to filter means to apply a ViewCriteria, and then disable it to view all your data

Resources