• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Data grid

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.





:
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
gona jyoti
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello

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


Thanks
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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>
reply
    Bookmark Topic Watch Topic
  • New Topic