aspose file tools*
The moose likes Struts and the fly likes Data grid Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Data grid" Watch "Data grid" New topic
Author

Data grid

gona jyoti
Greenhorn

Joined: Sep 08, 2006
Posts: 8
Hi All

I am to use datagrid in struts for adding records and editing records and storing that records in database..can anybody help me out.





:
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
A Datagrid is one of the standard components of JavaServer Faces (JSF), but it is not part of the Struts framework. In Struts, you have to create your own tables of data using standard HTML and Struts tags such as <logic:iterate>. Also, Struts does not have any special features for adding/updating/deleting data in a relational database. You must either adopt another framework such as Hibernate or the new Java EE Persistence framework, or use the standard JDBC API to do this.

You might look to other projects such as The Display tag library for automated features to build grids or tables of data on your pages.


Merrill
Consultant, Sima Solutions
gona jyoti
Greenhorn

Joined: Sep 08, 2006
Posts: 8
Thank you

Display data grid is used for dispay purpose but i want to add data to the grid and by clicking submit button it goes to the database.i want to add not only one record but n number records to push into database.please help me it urgent
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
Which framework are you using? JSF or Struts? As I mentioned in my last post, there is no "display data grid" in Struts.
[ September 18, 2006: Message edited by: Merrill Higginson ]
gona jyoti
Greenhorn

Joined: Sep 08, 2006
Posts: 8
Hello

Iam Using struts Framework..using struts we cant create a data grid for adding
record into it.


Thanks
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
What I was trying to point out is that there is no automatic way to display a data grid. You can certainly create a table of data with struts. The code would look something like this:

<table>
<tr>
<td>First name</td>
<td>Last Name</td>
<td>phone number</td>
</tr>
<logic:iterate id="bean" name="listOfBeans" >
<tr>
<td><bean:write name="bean" property="firstName" /></td>
<td><bean:write name="bean" property="lastName" /></td>
<td><bean:write name="bean" property="phone" /></td>
</tr>
</logic:iterate>
</table>
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Data grid