Edit multiple rows in Table Struts2 - struts2

I am displaying a list of data returned from database to JSP.
Now, this list has fields that are editable. And user can select more than 1 row to edit.
My requirement is to display the list, override the list(which has dropdown and checkbox fields that can be overridden by user) and then all of it to be saved to database.
I used displayTag to display the data, but now User editing few fields and populating that table to Action class part I am not able to get.
Can you give some suggestions?
May be other than displaytag also?

Related

Is there a way to enable row editing on only new added rows within a Kendo grid?

So I have a standard Kendo grid in MVC with 2 non-editable columns. What I would like to achieve is to enable editing of all columns only within the newly added rows.
Example: There's 4 rows already in the grid, first 2 columns non-editable. User clicks "Add new", a new record appears in the grid with everything editable.
Try adding an editable function handler to your column definition, something like this:
{
field: "salary",
editable: function (dataItem) {
return dataItem.isNew();
}
}
Please note: you will need to have specified an id column in your model definition for this to work, for details see isNew documentation:
Checks if the Model is new or not. The id field is used to determine if a model instance is new or existing one. If the value of the field specified is equal to the default value (specified through the fields configuration) the model is considered as new.

Dynamic display of labels using thymeleaf

I am using Thymeleaf and have a requirement of displaying labels dynamically based on database hit.
Suppose we have a column "Race" in our database and table name is "Table1" and the corresponding entity name is "Table1". When user access the html page (home.html) which will hit the table and return the values of field "Race". So if table has 2 values then 2 labels would get display on the page with the values on them and if there are 3 values then 3 labels respectively. I need a Thymeleaf or js code to implement this.
Please help and thanks in advance.
First of all you need proper controller:
#RequestMapping("/home")
public String showHome(Model model) {
List<Table1> list = //Invoke method to get proper rows from db for example use Spring CRUD Repository
model.addAttribute("list", list);
return "home"
}
Inside of your HTML put:
<label th:each="entity: ${list}" th:text="${entity.race}"></label>

Editable DropDownList in MVC

I have a list of items. I have to provide users an opportunity to edit those values. As I cannot efficiently handle it using textbox(generated dynamically), I was thinking to have dropdownlist which are editable.
Any suggestions?

how to populate values in listbox based on value entered in textbox in BIRT?

I want to populate values in a list box based on a value entered in textbox. It cant be aceived through cascading paramters as all parameters in Cascading parameters are List Boxes. But my requirement is to populate values inside a ListBox based on the value entered inside a textbox. Please help.
Cascading parameter is the only way to define a dependency between two parameters. As you can see, the birt web viewer displays a textbox just below each combobox, and a radio button to select if we fill each list parameter from the combobox or the textbox:
I know some users had exactly the same requirement, and have successfully modified "ComboBoxParametersFragments.jsp" to display only the textbox when it is needed. For example we can use a specific prefix in the parameter name, or a user property, so that we can decide in the JSP if we hide the combobox or not.

how do i store the struts2 tag checkboxlist elements in the database?

If i wanted to store the struts2 tag checkboxlist elements in the database ,How do i save it in the database .I mean how do i work with the checkboxlist tag ,
like how do i declare it in the table .How do i use it ?
Thanks
Here are several different examples showing how to use the checkboxlist in your Action class and view.
Once the checkbox is submitted to your action, you'll have a List populated with the checked String values. You can then save those Strings in your database in an appropriate field type (i.e. for MySQL that could be CHAR or VARCHAR).

Resources