Adding table

Hi I have to add table columns in my jsp page which i am fetching from databaseshowing data in jsp page through logic:iterate tag.strtut tag.so any ideaThnx in advance
[195 byte] By [smita_smitaa] at [2007-10-3 1:31:27]
# 1

Hi Smita,

See following sample code for logic:iterate tag .....

<logic:notEmpty name="InchargeListForm" property="arrayInchargeList" >

<table width="100%" border="1" cellpadding="1" >

<tr>

<td>InchargeCode</td>

<td>InchargeName</td>

</tr>

<logic:iterate id="InchargeVO" name="InchargeListForm" property="arrayInchargeList" scope="request" >

<tr>

<td><bean:write name="InchargeVO" property="inchargeCode"/></td>

<td><bean:write name="InchargeVO" property="inchargeName"/></td>

</tr>

</logic:iterate>

</table>

</logic:notEmpty>

In the above sample I have an ArrayList defines as arrayInchargeList in my form. In my ActionServlet I add InchargeVO[Value object].

Lemme know if this what you wanted to know

OR

Do you need to extract the column name from a table? In that case u need to use meta data.

-Rohit

RohitKumara at 2007-7-14 18:29:21 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2

Hey smita ..do u forget to award the duke dollars for ur questions or u dontwanna give it anyways?

If thats the case then stop assigning duke dollars in future post.

Anyways duke dollars there or not..people still do reply.

By the way u never replied on my earlier reply too ..

http://forum.java.sun.com/thread.jspa?threadID=754972&messageID=4313844#4313844

Guys u shud see this post on Jguru site too ..lol

http://www.jguru.com/forums/view.jsp?EID=1306466

RohitKumara at 2007-7-14 18:29:21 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3
Hi boss.I am in us.just checking your replies .let me check and I will give you duke even though you dont care for that.so thxns and regardsnow i got the meaning of your smile on other site.
smita_smitaa at 2007-7-14 18:29:21 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 4
I think i could not explain the problem.Whatever values i am getting I have to add this in final row
smita_smitaa at 2007-7-14 18:29:21 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 5
means for example if i am getting 2,3,4,5 then I have to add this as 14
smita_smitaa at 2007-7-14 18:29:21 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 6
hi rohit wanna contact you how?
smita_smitaa at 2007-7-14 18:29:21 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 7

Hi Smita,

Nice to know that ur in US. I am in Japan[Tokyo] right now.

I guess now why there is a time lag in our replies.

FYI ...My email :rohitk2000@gmail.com

Ok.. within the <logic:iterate .. tag you need to add bean:define tag as below :

><logic:notEmpty name="InchargeListForm" property="arrayInchargeList" >

<table width="100%" border="1" cellpadding="1" >

<tr>

<td>InchargeCode</td>

<td>InchargeName</td>

</tr>

<%

int cnt = 0;

%>

<logic:iterate id="InchargeVO" name="InchargeListForm" property="arrayInchargeList" scope="request" >

<bean:define id='inchargeCode' name="InchargeVO" property="inchargeCode" />

<%

cnt = cnt+Integer.parseInt(inchargeCode);

%>

<tr>

<td><bean:write name="InchargeVO" property="inchargeCode"/></td>

<td><bean:write name="InchargeVO" property="inchargeName"/></td>

</tr>

</logic:iterate>

</table>

</logic:notEmpty>

TOTAL :<%=cnt%>

Lemme know if this solves your question.

Aletrnatively you may use <c:set .. tag in JSTL

Regards

Rohit

>

RohitKumara at 2007-7-14 18:29:21 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 8
everything is complete now.pnly paging thing is need to be done..using logic:iterate.adding table we are doing in sql only.
smita_smitaa at 2007-7-14 18:29:21 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 9
additing table in sql appears an incorrect coding style to me. As far as pagination is concerned .. honestly its too complex to be explained in a forum, there r plenty things which needs to be taken care of.All the best.
RohitKumara at 2007-7-14 18:29:21 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 10
tahnxs rohit.will mail uwithin wek.in offcie mail is restricted.
smita_smitaa at 2007-7-14 18:29:21 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 11
Thanx for the 5 duke dollars smita.. email me anytime ...Are you any Indian by the way like me? and where r u working in US?
RohitKumara at 2007-7-14 18:29:21 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 12
man I am 100 percent indian.working i can not say in this forumwill mail you on weekend
smita_smitaa at 2007-7-14 18:29:21 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...