You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Diego Yasuhiko Kurisaki <di...@gmail.com> on 2007/05/07 21:01:26 UTC

[S2] needs refresh to work properly

Hi i've written the following in a JSP.

<s:iterator id="ca" value="clients">
         <tr>
            <td>${ca.name}</td>
            <td>${ca.description}</td>
            <td>remove</td>
            <td>edit</td>
         </tr>
</s:iterator>

I have a method in my action called getClients.

When i first load the page, the iterator tag generates the exact number of
rows of the list that is returned by the getClients method.
But the EL ${ca.name} and ${ca.description} doesn't return any value until a
refresh.

I've tried then putting a breakpoint inside the getName and getDescription
methods, it seens that the methods are being called just after the first
refresh.

Looks like i'm doing something very wrong, am i not supposed to use EL
inside <s:iterator>? What should i use then?
-- 
[]'s Diego Yasuhiko Kurisaki

Re: [S2] needs refresh to work properly

Posted by Adam Ruggles <a....@gmail.com>.
do this

<s:iterator value="clients">
    <tr>
       <td><s:property value="name"/></td>
       <td><s:property value="description"/></td>
        <td>remove</td>
        <td>edit</td>
    </tr>
</s:iterator>

This is assuming you have a "public getClients()" method that returns an 
array/list of objects that have "public getName()" and "public 
getDescription" methods.

Diego Yasuhiko Kurisaki wrote:
> Well, using the property tag i got no output at all.
>
> <s:property value="ca.name" />
>
> I'll try to use the webwork stuff.
>
> Is this really how it works?
>
> On 5/7/07, Adam Ruggles <a....@gmail.com> wrote:
>>
>> have you tried using the property tag instead? <s:property
>> value="ca.name" />
>>
>> Diego Yasuhiko Kurisaki wrote:
>> > Hi i've written the following in a JSP.
>> >
>> > <s:iterator id="ca" value="clients">
>> >         <tr>
>> >            <td>${ca.name}</td>
>> >            <td>${ca.description}</td>
>> >            <td>remove</td>
>> >            <td>edit</td>
>> >         </tr>
>> > </s:iterator>
>> >
>> > I have a method in my action called getClients.
>> >
>> > When i first load the page, the iterator tag generates the exact
>> > number of
>> > rows of the list that is returned by the getClients method.
>> > But the EL ${ca.name} and ${ca.description} doesn't return any value
>> > until a
>> > refresh.
>> >
>> > I've tried then putting a breakpoint inside the getName and
>> > getDescription
>> > methods, it seens that the methods are being called just after the 
>> first
>> > refresh.
>> >
>> > Looks like i'm doing something very wrong, am i not supposed to use EL
>> > inside <s:iterator>? What should i use then?
>>
>> ---------------------------------------------------------------------
>> 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: [S2] needs refresh to work properly

Posted by Diego Yasuhiko Kurisaki <di...@gmail.com>.
Well i spent a hour to realize that when i used the property tag and go no
output, i was mistyping the name :/

it worked using just the name of the method that i want.

<s:property value="name"/>

Thanks

On 5/7/07, Diego Yasuhiko Kurisaki <di...@gmail.com> wrote:
>
> Well, using the property tag i got no output at all.
>
> <s:property value="ca.name" />
>
> I'll try to use the webwork stuff.
>
> Is this really how it works?
>
> On 5/7/07, Adam Ruggles <a....@gmail.com> wrote:
> >
> > have you tried using the property tag instead? <s:property
> > value="ca.name" />
> >
> > Diego Yasuhiko Kurisaki wrote:
> > > Hi i've written the following in a JSP.
> > >
> > > <s:iterator id="ca" value="clients">
> > >         <tr>
> > >            <td>${ca.name}</td>
> > >            <td>${ca.description }</td>
> > >            <td>remove</td>
> > >            <td>edit</td>
> > >         </tr>
> > > </s:iterator>
> > >
> > > I have a method in my action called getClients.
> > >
> > > When i first load the page, the iterator tag generates the exact
> > > number of
> > > rows of the list that is returned by the getClients method.
> > > But the EL ${ca.name } and ${ca.description} doesn't return any value
> > > until a
> > > refresh.
> > >
> > > I've tried then putting a breakpoint inside the getName and
> > > getDescription
> > > methods, it seens that the methods are being called just after the
> > first
> > > refresh.
> > >
> > > Looks like i'm doing something very wrong, am i not supposed to use EL
> > > inside <s:iterator>? What should i use then?
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> >
> >
>
>
> --
> []'s Diego Yasuhiko Kurisaki




-- 
[]'s Diego Yasuhiko Kurisaki

Re: [S2] needs refresh to work properly

Posted by Diego Yasuhiko Kurisaki <di...@gmail.com>.
Well, using the property tag i got no output at all.

<s:property value="ca.name" />

I'll try to use the webwork stuff.

Is this really how it works?

On 5/7/07, Adam Ruggles <a....@gmail.com> wrote:
>
> have you tried using the property tag instead? <s:property
> value="ca.name" />
>
> Diego Yasuhiko Kurisaki wrote:
> > Hi i've written the following in a JSP.
> >
> > <s:iterator id="ca" value="clients">
> >         <tr>
> >            <td>${ca.name}</td>
> >            <td>${ca.description}</td>
> >            <td>remove</td>
> >            <td>edit</td>
> >         </tr>
> > </s:iterator>
> >
> > I have a method in my action called getClients.
> >
> > When i first load the page, the iterator tag generates the exact
> > number of
> > rows of the list that is returned by the getClients method.
> > But the EL ${ca.name} and ${ca.description} doesn't return any value
> > until a
> > refresh.
> >
> > I've tried then putting a breakpoint inside the getName and
> > getDescription
> > methods, it seens that the methods are being called just after the first
> > refresh.
> >
> > Looks like i'm doing something very wrong, am i not supposed to use EL
> > inside <s:iterator>? What should i use then?
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


-- 
[]'s Diego Yasuhiko Kurisaki

Re: [S2] needs refresh to work properly

Posted by Adam Ruggles <a....@gmail.com>.
have you tried using the property tag instead? <s:property 
value="ca.name" />

Diego Yasuhiko Kurisaki wrote:
> Hi i've written the following in a JSP.
>
> <s:iterator id="ca" value="clients">
>         <tr>
>            <td>${ca.name}</td>
>            <td>${ca.description}</td>
>            <td>remove</td>
>            <td>edit</td>
>         </tr>
> </s:iterator>
>
> I have a method in my action called getClients.
>
> When i first load the page, the iterator tag generates the exact 
> number of
> rows of the list that is returned by the getClients method.
> But the EL ${ca.name} and ${ca.description} doesn't return any value 
> until a
> refresh.
>
> I've tried then putting a breakpoint inside the getName and 
> getDescription
> methods, it seens that the methods are being called just after the first
> refresh.
>
> Looks like i'm doing something very wrong, am i not supposed to use EL
> inside <s:iterator>? What should i use then?

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


Re: [S2] needs refresh to work properly

Posted by Vijay Prajapati <vi...@gmail.com>.
Laurie,
     I have done it. Thank you very much. I would like to appreciate your
efforts done for me.
I would like to work with you to solve problems. If possible then we would
meet u through net.

Vijay

On 5/25/07, Laurie Harper <la...@holoweb.net> wrote:
>
> Perhaps something like the following, making use of the status info [1]
> exposed by s:iterator:
>
>   <table><tr>
>   <s:iterator id="item" value="yourList" status="s">
>     <td><s:property value="#item.someProperty"/></td>
>     <s:if test="#s.index % 3 == 0">
>       </tr><tr>
>     </s:if>
>   </s:iterator>
>   </tr></table>
>
> L.
>
> [1]
>
> http://struts.apache.org/2.x/struts2-core/apidocs/org/apache/struts2/views/jsp/IteratorStatus.html
>
> Vijay Prajapati wrote:
> > Dave,
> >
> > 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
> >
> >
> > Thank you,
> > Vijay
> >
> > On 5/23/07, Dave Newton <ne...@yahoo.com> wrote:
> >>
> >> --- Vijay Prajapati <vi...@gmail.com> wrote:
> >> > Is there Nested Iterator tag in Struts 2.0.6?
> >>
> >> I don't believe that one is necessary; you should be
> >> able to arbitrarily nest <s:iterate.../> tags (I have
> >> several cases where I do that with no issues).
> >>
> >> One thing to note is that if you need to access an
> >> outer-iterator value you'd need to declare an id
> >> attribute in the outer iterator and refer to it using
> >> the "#" OGNL syntax within the inner iterator.
> >>
> >> Er... that made sense in my head :/
> >>
> >> d.
> >>
> >>
> >>
> >>
> >>
> ____________________________________________________________________________________Get
> >>
> >> the free Yahoo! toolbar and rest assured with the added security of
> >> spyware
> >> protection.
> >> http://new.toolbar.yahoo.com/toolbar/features/norton/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: [S2] needs refresh to work properly

Posted by Dale Newfield <Da...@Newfield.org>.
Laurie Harper wrote:
> Perhaps something like the following, making use of the status info [1] 
> exposed by s:iterator:
> 
>   <table><tr>
>   <s:iterator id="item" value="yourList" status="s">
>     <td><s:property value="#item.someProperty"/></td>
>     <s:if test="#s.index % 3 == 0">
>       </tr><tr>
>     </s:if>
>   </s:iterator>
>   </tr></table>

With a tweak that prevents that if from firing if there are a multiple 
of 3 entries in yourList:

test="#s.index % 3 == 0 && !#s.last"

-Dale

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


Re: [S2] needs refresh to work properly

Posted by Dave Newton <ne...@yahoo.com>.
--- Laurie Harper <la...@holoweb.net> wrote:
> Perhaps something like the following, making use of
> the status info [1] exposed by s:iterator:

>:|

d.



       
____________________________________________________________________________________Take the Internet to Go: Yahoo!Go puts the Internet in your pocket: mail, news, photos & more. 
http://mobile.yahoo.com/go?refer=1GNXIC

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


Re: [S2] needs refresh to work properly

Posted by Laurie Harper <la...@holoweb.net>.
Perhaps something like the following, making use of the status info [1] 
exposed by s:iterator:

   <table><tr>
   <s:iterator id="item" value="yourList" status="s">
     <td><s:property value="#item.someProperty"/></td>
     <s:if test="#s.index % 3 == 0">
       </tr><tr>
     </s:if>
   </s:iterator>
   </tr></table>

L.

[1] 
http://struts.apache.org/2.x/struts2-core/apidocs/org/apache/struts2/views/jsp/IteratorStatus.html

Vijay Prajapati wrote:
> Dave,
> 
> 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
> 
> 
> Thank you,
> Vijay
> 
> On 5/23/07, Dave Newton <ne...@yahoo.com> wrote:
>>
>> --- Vijay Prajapati <vi...@gmail.com> wrote:
>> > Is there Nested Iterator tag in Struts 2.0.6?
>>
>> I don't believe that one is necessary; you should be
>> able to arbitrarily nest <s:iterate.../> tags (I have
>> several cases where I do that with no issues).
>>
>> One thing to note is that if you need to access an
>> outer-iterator value you'd need to declare an id
>> attribute in the outer iterator and refer to it using
>> the "#" OGNL syntax within the inner iterator.
>>
>> Er... that made sense in my head :/
>>
>> d.
>>
>>
>>
>>
>> ____________________________________________________________________________________Get 
>>
>> the free Yahoo! toolbar and rest assured with the added security of 
>> spyware
>> protection.
>> http://new.toolbar.yahoo.com/toolbar/features/norton/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: [S2] needs refresh to work properly

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

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


Thank you,
Vijay

On 5/23/07, Dave Newton <ne...@yahoo.com> wrote:
>
> --- Vijay Prajapati <vi...@gmail.com> wrote:
> > Is there Nested Iterator tag in Struts 2.0.6?
>
> I don't believe that one is necessary; you should be
> able to arbitrarily nest <s:iterate.../> tags (I have
> several cases where I do that with no issues).
>
> One thing to note is that if you need to access an
> outer-iterator value you'd need to declare an id
> attribute in the outer iterator and refer to it using
> the "#" OGNL syntax within the inner iterator.
>
> Er... that made sense in my head :/
>
> d.
>
>
>
>
> ____________________________________________________________________________________Get
> the free Yahoo! toolbar and rest assured with the added security of spyware
> protection.
> http://new.toolbar.yahoo.com/toolbar/features/norton/index.php
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

Re: [S2] needs refresh to work properly

Posted by Dave Newton <ne...@yahoo.com>.
--- Vijay Prajapati <vi...@gmail.com> wrote:
> Is there Nested Iterator tag in Struts 2.0.6?

I don't believe that one is necessary; you should be
able to arbitrarily nest <s:iterate.../> tags (I have
several cases where I do that with no issues).

One thing to note is that if you need to access an
outer-iterator value you'd need to declare an id
attribute in the outer iterator and refer to it using
the "#" OGNL syntax within the inner iterator.

Er... that made sense in my head :/

d.



       
____________________________________________________________________________________Get the free Yahoo! toolbar and rest assured with the added security of spyware protection.
http://new.toolbar.yahoo.com/toolbar/features/norton/index.php

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


Re: [S2] needs refresh to work properly

Posted by Vijay Prajapati <vi...@gmail.com>.
Hi,
   Is there Nested Iterator tag in Struts2.0.6?
I want to show matrix of list value  through Iterator tag in HTML Table. So
is it possible?
I am here giving example which shows values in table form  from list.
   List imageList= new ArrayList(10);
images should show like below in HTML table.
      imageList.get(0)   imageList.get(1)   imageList.get(2)
      imageList.get(3)   imageList.get(4)   imageList.get(5)
      imageList.get(6)   imageList.get(7)   imageList.get(8)
      imageList.get(9)

Please Help me if any one has solutions for it.

Vijay
On 5/8/07, Diego Yasuhiko Kurisaki <di...@gmail.com> wrote:
>
> Hi i've written the following in a JSP.
>
> <s:iterator id="ca" value="clients">
>         <tr>
>            <td>${ca.name}</td>
>            <td>${ca.description}</td>
>            <td>remove</td>
>            <td>edit</td>
>         </tr>
> </s:iterator>
>
> I have a method in my action called getClients.
>
> When i first load the page, the iterator tag generates the exact number of
> rows of the list that is returned by the getClients method.
> But the EL ${ca.name} and ${ca.description} doesn't return any value until
> a
> refresh.
>
> I've tried then putting a breakpoint inside the getName and getDescription
> methods, it seens that the methods are being called just after the first
> refresh.
>
> Looks like i'm doing something very wrong, am i not supposed to use EL
> inside <s:iterator>? What should i use then?
> --
> []'s Diego Yasuhiko Kurisaki
>