jsp with servlet - sql

I have a jsp which retrieves data dynamically from db and shown in table format. Each row has a update button along with radio button. Whenever i click update on any row it proceed to next update page with only first row value.
Please help me how i could get the remaining rows for updating.
Thank you in advance

Suggestion:
define the corresponding id for the update button and the radio button of every row. I suggest you can define a hidden-text as it.
define a JavaScript function to resolve the logic:
a) get the hidden-text value(id of the row record) about the selected update button or radio.
b) create the target URL with id of the row record.
c) submit id as URL parameter.
define a JavaScript function to refresh the corresponding row with the respond data. of course, you should define a java server interface to get the data of the row id.

Related

How To Fill Textbox With Datase Using Filter Button

Program ScreenShot
Hi I am creating a program and would like to ask for help.
I would like to fill the data on the four textboxes shown when I press the "ADD" Button (the input would be coming from the dataset), but first, the user must input a value on the other textbox at the top (the Item Code to be exact), basically to filter it first.
Would like to know the code on/or how to do it. TIA
Add a search button. Once clicked, execute a query for the Item Code in DB to fetch the related record.
If record exist, Show Update button. Show the data in the textboxes. For this bind the textboxes with the datasource (i.e. DBSet used to fetch record from DB).
If record does not exist, Show Add button. Once data is entered into the textboxes, construct an insert query with the textboxes data and execute the insert query in DB.
Show the update or insert success/failure message to user.

WebDriver - locate dynamic column

I am using webdriver to test our application that contain table where the user can change the order of columns in a table,and also can remove/add columns (This is beside new column added by developers).
What is the right way to find the column I need?
One way is to go over the table header to find the column I am looking for so I have the column index and than I can access the right cell.
Is there other way ?
What about put unique id/class name for every element in table ?
Thanks
You can do two things for this situation:
Get handle to table element, and then navigate accordingly to get the columns or rows. Once you have this, then you can do all operations on them like click() etc.
Other way is, see the pattern of their ids/css because, most of the table that I have deal with will be having ids like this:
grid_name_1
grid_name_2
grid_name_3
Then you can have do this way:
String baseLocator = "grid_name_" + clickedRowIndex;
driver.findElement(By.id(baseLocator)).click(); //for click operation
Lets say user wants to click on the 3rd row, then clickedRowIndex will be 3 which selects the 3rd table row.

Update same row with multiple Update statement at the same time

I am trying to update a single MS SQL server table row with multiple ajax call; each call tries to update different records of the same row.
I get the updated values some times and some times all the records I am trying to update becomes null. I have checked the ajax calls and the values are being sent ok.
Can anybody give me any idea what wrong I am doing or what should I check to get the issue ?
To give you better idea about the scenario :
I have two panels with some inputs. There is a review button - when clicked two ajax calls for each of the panel are made sending the input values for corresponding panels. Both ajax call are suppose to update the same row in a table - but different records.
In the same review button click a page is loaded in a iframe to show the values just updated.

Struts 1 - How to pick up a table row values to process in another JSP page

I'm facing this trouble: I have a <table> filled (<logic:iterate>) with some data coming from an Action, the last value (of each table row) is a link that would drives me to another JSP page with the data of the row where the link was clicked to edit the corresponding values.
The fact is that I don't have any idea how to grab the values from that row and pass they to the other JSP page once the link is clicked.
Any ideas / example / implementation?!?!
The code that creates the link (in your table rendering JSP) can embed the ID of the object for that row in the link as query parameter such as ?objectId=13AB73C. (For security reasons it's even better to embed a unique hash of the ID rather than an actual database id). That id can then be obtained from the request parameters.
Once you have the id of the object for the row, you can load the data from the database for your editing page.

Drop Down in every rows of a Rally Table

May I know if it's possible to have a drop down box in every row in the Rally Table?
It is. Check out this example here (scroll down to Displaying Components in Cells):
http://developer.rallydev.com/help/tables
If you'd like to also make an update to the data when the value of the dropdown changes you'll want to wire up a listener to the onChange event and then use RallyDataSource's update method to change the data in Rally.