You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Vijay Prajapati <vi...@gmail.com> on 2007/05/24 08:27:07 UTC

Problem regarding tag

Hi All,
Can you please send sample code to print matrix of 10 element from one
list through iterator tag in Struts 2.0.6?
I am here giving sample output..

    1   2   3  ----------- in 1st row of HTML table
    4   5   6  ----------- in 2nd row of same HTML table
    7   8   9  ----------- in 3rd row of same HTML table
    10          ----------- in 4th row of same HTML table

I want to show this in HTML through <iterator> tag in Struts 2.0.6.

Thank you,
Vijay

RE: Problem regarding tag

Posted by Al Sutton <al...@alsutton.com>.
Ever get the feeling someones homework is due in or a deadline is looming? 

-----Original Message from Vijay Prajapati-----

.
.
.
.
> Please reply me ASAP



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Problem regarding tag

Posted by Vijay Prajapati <vi...@gmail.com>.
Dave,
I have 10 element in list() and i want to retrieve and to show them through
<iterator> tag on JSP. But not in one row but in given below style.
 I am here giving sample output..

    1   2   3  ----------- in 1st row of HTML table
    4   5   6  ----------- in 2nd row of same HTML table
    7   8   9  ----------- in 3rd row of same HTML table
    10          ----------- in 4th row of same HTML table

There  might be more element so based on that row will be increased.
So do you have any code or idea to solve this problem?
Please reply me ASAP

On 5/24/07, Dave Newton <ne...@yahoo.com> wrote:
>
> --- Vijay Prajapati <vi...@gmail.com> wrote:
> > I want to print pattern which i have drawn in my
> > first mail through <iterator> tag.
> >   As per your link it will shows 1,2,3,4,5 in row
> > but i want to draw it in row and column wise.
>
> So how might you go about solving that?
>
> You have #stat.index. You have the <s:if.../> tag.
>
> There must be some way of combining the two to
> implement behavior based on some test of #stat.index.
>
> d.
>
>
>
>
> ____________________________________________________________________________________Need
> a vacation? Get great deals
> to amazing places on Yahoo! Travel.
> http://travel.yahoo.com/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

Re: Problem regarding tag

Posted by Vijay Prajapati <vi...@gmail.com>.
Dave
   I have done it.
   Thank you.

Vijay


On 5/24/07, Dave Newton <ne...@yahoo.com> wrote:
>
> --- Vijay Prajapati <vi...@gmail.com> wrote:
> > You can solve this problem without <s:subset>.
>
> Oh, thanks; I thought I had to solve this with
> <s:subset.../> I sure am sorry it's taken me so long;
> I'm a little slow sometimes.
>
> > If you have any simple solution then let me know
> ASAP
>
> *sigh*
>
> Is this for your job?
>
> d.
>
>
>
>
> ____________________________________________________________________________________Pinpoint
> customers who are looking for what you sell.
> http://searchmarketing.yahoo.com/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

Re: Problem regarding tag

Posted by Dave Newton <ne...@yahoo.com>.
--- Vijay Prajapati <vi...@gmail.com> wrote:
> You can solve this problem without <s:subset>.

Oh, thanks; I thought I had to solve this with
<s:subset.../> I sure am sorry it's taken me so long;
I'm a little slow sometimes.

> If you have any simple solution then let me know
ASAP

*sigh*

Is this for your job?

d.



       
____________________________________________________________________________________Pinpoint customers who are looking for what you sell. 
http://searchmarketing.yahoo.com/

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Problem regarding tag

Posted by Vijay Prajapati <vi...@gmail.com>.
Dave
    You can solve this problem without <s:subset>.
    If you have any simple solution then let me know ASAP

Thank you,
Vijay Prajapati


On 5/24/07, Dave Newton <ne...@yahoo.com> wrote:
>
> --- Vijay Prajapati <vi...@gmail.com> wrote:
> >> If there are n elements in collection then there
> >> would be many rows and in each rows 5 elements will
>
> >> be display.
>
> So... do you know of any way in Java to do something
> every five times through a loop?
>
> (I haven't used <s:subset.../> so I don't know if it's
> a better way to solve this problem as opposed to just
> doing the simple test by hand.)
>
> d.
>
>
>
>
> ____________________________________________________________________________________Building
> a website is a piece of cake. Yahoo! Small Business gives you all the tools
> to get online.
> http://smallbusiness.yahoo.com/webhosting
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

Re: Problem regarding tag

Posted by Dave Newton <ne...@yahoo.com>.
--- Vijay Prajapati <vi...@gmail.com> wrote:
>> If there are n elements in collection then there 
>> would be many rows and in each rows 5 elements will

>> be display.

So... do you know of any way in Java to do something
every five times through a loop?

(I haven't used <s:subset.../> so I don't know if it's
a better way to solve this problem as opposed to just
doing the simple test by hand.)

d.



       
____________________________________________________________________________________Building a website is a piece of cake. Yahoo! Small Business gives you all the tools to get online.
http://smallbusiness.yahoo.com/webhosting 

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Problem regarding tag

Posted by Vijay Prajapati <vi...@gmail.com>.
update "#appStatus.index" instead of "#appStatus.incex"
On 5/24/07, Vijay Prajapati <vi...@gmail.com> wrote:
>
> Dave,
>
>  I am here giving my code on JSP. So please try to correct it.
> I have 7 elements in collection and i have to show 5 elements in one row
> and rest of the elements in second row. If there are n elements in
> collection then there would be many rows and in each rows 5 elements will be
> display.
>
> <table width="100%" border="0" align="center" cellpadding="0" cellspacing=
> "1" >
>    <s:iterator id="appId" status="appStatus" value= "applications">
>     <tr>
>        <s:subset source="applications" count="5" start= "#appStatus.index"
> >
>       <s:iterator>
>          <td width="20%" height="80" align="center" valign="middle">
>            < s:url id="applicationmonitor" action ="
> ViewApplicationAction.action">
>               < s:param name="applicationName" value= "%{application}"/>
>               <s:param name ="systemName" value="%{system}" />
>            </s:url> < p> <s:a href= "%{applicationmonitor}" cssClass=
> "homelink" ><img src="images/newwind_img.gif" width="51" height="51"
> border="0"><br>
>         <s:if test="!systemName.equals('All')" ><s:property value="application"
> /></s:if>
>        < s:else><s:property value ="system"/>-<s:property value=
> "application"/></ s:else>
>        </s:a>
>       </p>
>   </td>
> </s:iterator>
> </s:subset >
> </tr>
> < tr>
> <td colspan="8" align="center" valign="middle" class="error" >&nbsp;<
> s:actionmessage/></ td>
> </tr>
> </ s:iterator>
> </table >
>
>
>
> On 5/24/07, Dave Newton <ne...@yahoo.com> wrote:
> >
> > --- Vijay Prajapati <vi...@gmail.com> wrote:
> > > If you have any solution then help me out.
> >
> > Seriously, I think I helped you already.
> >
> > Maybe if you explain where you're having issues coming
> > up with the solution we can work our way through it.
> >
> > d.
> >
> >
> >
> >
> > ____________________________________________________________________________________
> >
> > 8:00? 8:25? 8:40? Find a flick in no time
> > with the Yahoo! Search movie showtime shortcut.
> > http://tools.search.yahoo.com/shortcuts/#news
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> >
> >
>

Re: Problem regarding tag

Posted by Vijay Prajapati <vi...@gmail.com>.
Dave,

 I am here giving my code on JSP. So please try to correct it.
I have 7 elements in collection and i have to show 5 elements in one row and
rest of the elements in second row. If there are n elements in collection
then there would be many rows and in each rows 5 elements will be display.

<table width="100%" border="0" align="center" cellpadding="0" cellspacing=
"1">
   <s:iterator id="appId" status="appStatus" value="applications">
    <tr>
       <s:subset source="applications" count="5" start="#appStatus.incex">
      <s:iterator>
         <td width="20%" height="80" align="center" valign="middle">
           <s:url id="applicationmonitor" action="
ViewApplicationAction.action">
              <s:param name="applicationName" value="%{application}"/>
              <s:param name="systemName" value="%{system}"/>
           </s:url> <p> <s:a href="%{applicationmonitor}" cssClass=
"homelink"><img src="images/newwind_img.gif" width="51" height="51" border=
"0"><br>
        <s:if test="!systemName.equals('All')"><s:property value=
"application"/></s:if>
       <s:else><s:property value="system"/>-<s:property value="application"
/></s:else>
       </s:a>
      </p>
  </td>
</s:iterator>
</s:subset>
</tr>
<tr>
<td colspan="8" align="center" valign="middle" class="error">&nbsp;<
s:actionmessage/></td>
</tr>
</s:iterator>
</table>



On 5/24/07, Dave Newton <ne...@yahoo.com> wrote:
>
> --- Vijay Prajapati <vi...@gmail.com> wrote:
> > If you have any solution then help me out.
>
> Seriously, I think I helped you already.
>
> Maybe if you explain where you're having issues coming
> up with the solution we can work our way through it.
>
> d.
>
>
>
>
>
> ____________________________________________________________________________________
> 8:00? 8:25? 8:40? Find a flick in no time
> with the Yahoo! Search movie showtime shortcut.
> http://tools.search.yahoo.com/shortcuts/#news
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

Re: Problem regarding tag

Posted by Dave Newton <ne...@yahoo.com>.
--- Vijay Prajapati <vi...@gmail.com> wrote:
> If you have any solution then help me out.

Seriously, I think I helped you already.

Maybe if you explain where you're having issues coming
up with the solution we can work our way through it.

d.



 
____________________________________________________________________________________
8:00? 8:25? 8:40? Find a flick in no time 
with the Yahoo! Search movie showtime shortcut.
http://tools.search.yahoo.com/shortcuts/#news

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Problem regarding tag

Posted by Vijay Prajapati <vi...@gmail.com>.
Al,
    I am getting values through List from Struts Action and based on that i
have to show values on JSPs. and i think Struts can do it.
If you have any solution then help me out.


On 5/24/07, Al Sutton <al...@alsutton.com> wrote:
>
> Vijay,
>
> You've been given a good hint about Struts can offer to help. If you feel
> you need to improve the formatting maybe you should look for a JSP
> formatting tag library and ask the question on their list.
>
> Regards,
>
> Al.
>
> -----Original Message-----
> From: Vijay Prajapati [mailto:vijay.struts@gmail.com]
> Sent: 24 May 2007 13:48
> To: Struts Users Mailing List
> Subject: Re: Problem regarding <iterator> tag
>
> Dave
>    I want to print pattern which i have drawn in my first mail through
> <iterator> tag.
> As per your link it will shows 1,2,3,4,5 in row but i want to draw it in
> row and column wise.
>
> Vijay
>
>
> On 5/24/07, Dave Newton <ne...@yahoo.com> wrote:
> >
> > --- Vijay Prajapati <vi...@gmail.com> wrote:
> > > Can you please send sample code to print matrix of 10 element from
> > > one
> >
> > Look at the <s:iterator.../> "status" attribute.
> >
> > http://struts.apache.org/2.x/docs/iterator.html
> >
> > See the last example regarding "#stat.index".
> >
> > d.
> >
> >
> >
> >
> > ______________________________________________________________________
> > ______________Get the Yahoo! toolbar and be alerted to new email
> > wherever you're surfing.
> > http://new.toolbar.yahoo.com/toolbar/features/mail/index.php
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

RE: Problem regarding tag

Posted by Al Sutton <al...@alsutton.com>.
Vijay,

You've been given a good hint about Struts can offer to help. If you feel
you need to improve the formatting maybe you should look for a JSP
formatting tag library and ask the question on their list.

Regards,

Al.

-----Original Message-----
From: Vijay Prajapati [mailto:vijay.struts@gmail.com] 
Sent: 24 May 2007 13:48
To: Struts Users Mailing List
Subject: Re: Problem regarding <iterator> tag

Dave
    I want to print pattern which i have drawn in my first mail through
<iterator> tag.
  As per your link it will shows 1,2,3,4,5 in row but i want to draw it in
row and column wise.

Vijay


On 5/24/07, Dave Newton <ne...@yahoo.com> wrote:
>
> --- Vijay Prajapati <vi...@gmail.com> wrote:
> > Can you please send sample code to print matrix of 10 element from 
> > one
>
> Look at the <s:iterator.../> "status" attribute.
>
> http://struts.apache.org/2.x/docs/iterator.html
>
> See the last example regarding "#stat.index".
>
> d.
>
>
>
>
> ______________________________________________________________________
> ______________Get the Yahoo! toolbar and be alerted to new email 
> wherever you're surfing.
> http://new.toolbar.yahoo.com/toolbar/features/mail/index.php
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Problem regarding tag

Posted by Dave Newton <ne...@yahoo.com>.
--- Vijay Prajapati <vi...@gmail.com> wrote:
> I want to print pattern which i have drawn in my
> first mail through <iterator> tag.
>   As per your link it will shows 1,2,3,4,5 in row
> but i want to draw it in row and column wise.

So how might you go about solving that?

You have #stat.index. You have the <s:if.../> tag. 

There must be some way of combining the two to
implement behavior based on some test of #stat.index.

d.



       
____________________________________________________________________________________Need a vacation? Get great deals
to amazing places on Yahoo! Travel.
http://travel.yahoo.com/

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Problem regarding tag

Posted by Vijay Prajapati <vi...@gmail.com>.
Dave
    I want to print pattern which i have drawn in my first mail through
<iterator> tag.
  As per your link it will shows 1,2,3,4,5 in row but i want to draw it in
row and column wise.

Vijay


On 5/24/07, Dave Newton <ne...@yahoo.com> wrote:
>
> --- Vijay Prajapati <vi...@gmail.com> wrote:
> > Can you please send sample code to print matrix of
> > 10 element from one
>
> Look at the <s:iterator.../> "status" attribute.
>
> http://struts.apache.org/2.x/docs/iterator.html
>
> See the last example regarding "#stat.index".
>
> d.
>
>
>
>
> ____________________________________________________________________________________Get
> the Yahoo! toolbar and be alerted to new email wherever you're surfing.
> http://new.toolbar.yahoo.com/toolbar/features/mail/index.php
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

Re: Problem regarding tag

Posted by Dave Newton <ne...@yahoo.com>.
--- Vijay Prajapati <vi...@gmail.com> wrote:
> Can you please send sample code to print matrix of
> 10 element from one

Look at the <s:iterator.../> "status" attribute.

http://struts.apache.org/2.x/docs/iterator.html

See the last example regarding "#stat.index".

d.



       
____________________________________________________________________________________Get the Yahoo! toolbar and be alerted to new email wherever you're surfing.
http://new.toolbar.yahoo.com/toolbar/features/mail/index.php

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org