You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Sergio <ki...@hotmail.com> on 2010/01/07 00:28:42 UTC

struts2 and tables

Hi, people, how can i show a table into a jsp from the struts action? 
Are there a simple method for doing that? I've tried with java 
collections into the action and "property" tag into the jsp with no success.

thanks in advance

-- 
Sergio


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


Re: struts2 and tables

Posted by Chris Pratt <th...@gmail.com>.
If all you want to do is display data in a simple HTML table, this is
definitely the way to go.  If you need pagination or columnar sorting
support, I'd go with DisplayTag.
  (*Chris*)

On Thu, Jan 7, 2010 at 1:39 AM, xerax nono <xr...@gmail.com> wrote:

> you can use iterator over a collection.
> see in
>
> http://www.vaannila.com/struts-2/struts-2-example/struts-2-crud-example-1.html
>
> <s:iterator value="userList" status="userStatus">
> 44.            <tr
> 45.                class="<s:if test="#userStatus.odd == true ">odd</s:if>
> <
> s:else>even</s:else>">
> 46.                <td><s:property value="name" /></td>
> 47.                <td><s:property value="gender" /></td>
> 48.                <td><s:property value="country" /></td>
> 49.                <td><s:property value="aboutYou" /></td>
> 50.                <td><s:property value="mailingList" /></td>
> 51.                <td>
> 52.                <s:url id="editURL" action="editUser">
> 53.                    <s:param name="id" value="%{id}"></s:param>
> 54.                </s:url>
> 55.                <s:a href="%{editURL}">Edit</s:a>
> 56.                </td>
> 57.                <td>
> 58.                <s:url id="deleteURL" action="deleteUser">
> 59.                    <s:param name="id" value="%{id}"></s:param>
> 60.                </s:url>
> 61.                <s:a href="%{deleteURL}">Delete</s:a>
> 62.                </td>
>
>
> 2010/1/7 Frans Thamura <fr...@meruvian.org>
>
> > can share how the struts2 work with display tag
> >
> >
> > sorry never use this also, how the display tag work with List when we
> > submit the grid
> >
> > F
> >
> >
> >
> >
> > On Thu, Jan 7, 2010 at 7:00 AM, Chris Pratt <th...@gmail.com>
> > wrote:
> > > We use DisplayTag (http://www.displaytag.org), it works pretty well.
> > >  (*Chris*)
> > >
> > > On Wed, Jan 6, 2010 at 3:28 PM, Sergio
> > > <ki...@hotmail.com>wrote:
> > >
> > >> Hi, people, how can i show a table into a jsp from the struts action?
> > Are
> > >> there a simple method for doing that? I've tried with java collections
> > into
> > >> the action and "property" tag into the jsp with no success.
> > >>
> > >> thanks in advance
> > >>
> > >> --
> > >> Sergio
> > >>
> > >>
> > >> ---------------------------------------------------------------------
> > >> 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
> >
> >
>
>
> --
> Serafin Hernandez Blazquez
> 649 81 64 87
>

Re: struts2 and tables

Posted by Manimaran Ramaraj <ma...@aspiresys.com>.
Thanx for this post. This method is pretty simple and very useful.

~ Maran


xerax nono wrote:
> 
> you can use iterator over a collection.
> see in
> http://www.vaannila.com/struts-2/struts-2-example/struts-2-crud-example-1.html
> 
> <s:iterator value="userList" status="userStatus">
> 44.            <tr
> 45.                class="<s:if test="#userStatus.odd == true ">odd</s:if>
> <
> s:else>even</s:else>">
> 46.                <td><s:property value="name" /></td>
> 47.                <td><s:property value="gender" /></td>
> 48.                <td><s:property value="country" /></td>
> 49.                <td><s:property value="aboutYou" /></td>
> 50.                <td><s:property value="mailingList" /></td>
> 51.                <td>
> 52.                <s:url id="editURL" action="editUser">
> 53.                    <s:param name="id" value="%{id}"></s:param>
> 54.                </s:url>
> 55.                <s:a href="%{editURL}">Edit</s:a>
> 56.                </td>
> 57.                <td>
> 58.                <s:url id="deleteURL" action="deleteUser">
> 59.                    <s:param name="id" value="%{id}"></s:param>
> 60.                </s:url>
> 61.                <s:a href="%{deleteURL}">Delete</s:a>
> 62.                </td>
> 
> 
> 2010/1/7 Frans Thamura <fr...@meruvian.org>
> 
>> can share how the struts2 work with display tag
>>
>>
>> sorry never use this also, how the display tag work with List when we
>> submit the grid
>>
>> F
>>
>>
>>
>>
>> On Thu, Jan 7, 2010 at 7:00 AM, Chris Pratt <th...@gmail.com>
>> wrote:
>> > We use DisplayTag (http://www.displaytag.org), it works pretty well.
>> >  (*Chris*)
>> >
>> > On Wed, Jan 6, 2010 at 3:28 PM, Sergio
>> > <ki...@hotmail.com>wrote:
>> >
>> >> Hi, people, how can i show a table into a jsp from the struts action?
>> Are
>> >> there a simple method for doing that? I've tried with java collections
>> into
>> >> the action and "property" tag into the jsp with no success.
>> >>
>> >> thanks in advance
>> >>
>> >> --
>> >> Sergio
>> >>
>> >>
>> >> ---------------------------------------------------------------------
>> >> 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
>>
>>
> 
> 
> -- 
> Serafin Hernandez Blazquez
> 649 81 64 87
> 
> 

-- 
View this message in context: http://old.nabble.com/struts2-and-tables-tp27052707p27057791.html
Sent from the Struts - User mailing list archive at Nabble.com.


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


Re: struts2 and tables

Posted by xerax nono <xr...@gmail.com>.
you can use iterator over a collection.
see in
http://www.vaannila.com/struts-2/struts-2-example/struts-2-crud-example-1.html

<s:iterator value="userList" status="userStatus">
44.            <tr
45.                class="<s:if test="#userStatus.odd == true ">odd</s:if> <
s:else>even</s:else>">
46.                <td><s:property value="name" /></td>
47.                <td><s:property value="gender" /></td>
48.                <td><s:property value="country" /></td>
49.                <td><s:property value="aboutYou" /></td>
50.                <td><s:property value="mailingList" /></td>
51.                <td>
52.                <s:url id="editURL" action="editUser">
53.                    <s:param name="id" value="%{id}"></s:param>
54.                </s:url>
55.                <s:a href="%{editURL}">Edit</s:a>
56.                </td>
57.                <td>
58.                <s:url id="deleteURL" action="deleteUser">
59.                    <s:param name="id" value="%{id}"></s:param>
60.                </s:url>
61.                <s:a href="%{deleteURL}">Delete</s:a>
62.                </td>


2010/1/7 Frans Thamura <fr...@meruvian.org>

> can share how the struts2 work with display tag
>
>
> sorry never use this also, how the display tag work with List when we
> submit the grid
>
> F
>
>
>
>
> On Thu, Jan 7, 2010 at 7:00 AM, Chris Pratt <th...@gmail.com>
> wrote:
> > We use DisplayTag (http://www.displaytag.org), it works pretty well.
> >  (*Chris*)
> >
> > On Wed, Jan 6, 2010 at 3:28 PM, Sergio
> > <ki...@hotmail.com>wrote:
> >
> >> Hi, people, how can i show a table into a jsp from the struts action?
> Are
> >> there a simple method for doing that? I've tried with java collections
> into
> >> the action and "property" tag into the jsp with no success.
> >>
> >> thanks in advance
> >>
> >> --
> >> Sergio
> >>
> >>
> >> ---------------------------------------------------------------------
> >> 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
>
>


-- 
Serafin Hernandez Blazquez
649 81 64 87

Struts Classic and token not working on one server on Firefox

Posted by Greg Dunn <Gr...@nisc.coop>.
We're using the Token system in our application, which is installed at
several hundred sites, each with their own JBoss and Apache servers
which we administer.  It works perfectly at every site but one, where a
token mismatch comes up every time if the user is on Firefox.  There is
no problem using IE.

Has anyone seen this and can you point us in the direction of solving
the problem?

The code is basic, in the first action class we have:

saveToken(request);

which forwards to a JSP, and in the second we have:

if (!isTokenValid(request) ) {
    return (mapping.findForward("tokenFail"));
}
resetToken(request);


Thank you,

Greg

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


Re: struts2 and tables

Posted by Sergio <ki...@hotmail.com>.
Hans Solo escribió:
> <s:param name="politico"><s:property /></s:param>
>
> should work.
>
>
> 2010/1/8 Chris Pratt <th...@gmail.com>:
>   
>> I'm not positive but you might try:
>>
>> <s:param name="politico" value="${this}"/>
>>
>>  (*Chris*)
>>
>> On Thu, Jan 7, 2010 at 4:09 PM, Sergio
>> <ki...@hotmail.com>wrote:
>>
>>     
>>> Sergio escribió:
>>>
>>>  Chris Pratt escribió:
>>>       
>>>>> You can refer to the DisplayTag documentation about what collections they
>>>>> support, there are quite a few.  I usually use a java.util.List of
>>>>> JavaBean's And yes, you'll have to use JDBC, JPA, Ibatis, Hibernate... to
>>>>> get that data from the database into a structure that can be displayed.
>>>>>
>>>>> As for your other question, take a look at the last column in my example,
>>>>> that's exactly what it does.
>>>>>  (*Chris*)
>>>>>
>>>>> On Thu, Jan 7, 2010 at 1:05 AM, Sergio
>>>>> <ki...@hotmail.com>wrote:
>>>>>
>>>>>
>>>>>
>>>>>           
>>>>>> but i don't understand the data structure to hold the users. When you
>>>>>> get
>>>>>> the ResultSet from mysql, how do you put it into the list? Without using
>>>>>> hibernate or similar, i've tried with several collections, for example a
>>>>>> <String >, Map <String><String>. The first string holds the name or user
>>>>>> id,
>>>>>> and the map holds attribute-value pair. No success, i think that is a
>>>>>> bad
>>>>>> solution.
>>>>>>
>>>>>> and another question: i need the user id be passed to another action as
>>>>>> a
>>>>>> parameter. I've tried with a s:form and a hidden field, something like
>>>>>> <input type="hidden" value="<s:property>"> is the idea. It's about an
>>>>>> online
>>>>>> shop, and i'm having problems with:
>>>>>>
>>>>>> 1.- listing products from mysql
>>>>>> 2.- adding products to the cart (from a mysql products list
>>>>>>
>>>>>> i'm a little newbie with struts.....
>>>>>>
>>>>>> regards
>>>>>>
>>>>>> --
>>>>>> Sergio
>>>>>>
>>>>>>
>>>>>> ---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>>>>> For additional commands, e-mail: user-help@struts.apache.org
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>             
>>>>>
>>>>>           
>>>> wow, i think i got. I'll take a look.
>>>>
>>>> thank you very much
>>>>
>>>>  my point is that i have a property which is a String, and i need that
>>>>         
>>> string in two ways: as a literal string and as a parameter to another
>>> action. Using "s:property", something like this:
>>>
>>>    <table>
>>>    <s:iterator value="#session.carrito">
>>>        <tr>
>>>            <td><s:property />
>>>            </td>
>>>            <td><s:url id="idResta" value="/Del.action">
>>>                    <s:param name="politico" value="[0]"></s:param>
>>>                </s:url>
>>>                <sx:a accesskey="6" href="%{idResta}"
>>> targets="secondaryContent" >Fuera</sx:a>
>>>            </td>
>>>        </tr>
>>>    </s:iterator>
>>>    </table>
>>>
>>> sessio.carrito is a String ArrayList and iterator works. Each of that
>>> string must be passed to another action, say Action2, like a form with a
>>> hidden field. During Action2 (which delete "politico" from session.carrito)
>>> there's a *java.lang.ArrayIndexOutOfBoundsException: -1*
>>>
>>> I thought that "[0]" helds the actual value, same as "<s:property />". Into
>>> "param" tag i've tried also with value="{ #this }" but i got that java
>>> exception.
>>>
>>> Something like:
>>>
>>> <s:param name="politico" value="<s:property />"></s:param>
>>>
>>> is my literal desire :)
>>>
>>> My struts action has private String politico and getters y setters. I'm not
>>> really sure if  "politco" is viewed by Action2.
>>>
>>>
>>> regards
>>> **
>>>
>>> --
>>> Sergio
>>>
>>>
>>> ---------------------------------------------------------------------
>>> 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
>
>
>
>   
ok, thanks to all. Finally i get it :)

it was too easy, using java maps. To print a map from an action:

     <table>
     <s:iterator value="#session.carrito">
         <tr>
             <td><s:property value = "key"/>
             </td>
             <td><strong><s:property value = "value"/></strong> Uds.
             </td>
             <td><s:url id="idResta" value="/Del.action">
                     <s:param name="politico" value = "key"></s:param>
                 </s:url>
                 <sx:a loadingText="Cargando" indicator="indicador" 
accesskey="6" href="%{idResta}" targets="secondaryContent" >Fuera</sx:a>
             </td>
         </tr>
     </s:iterator>
     </table>


I was using ajax and i'd like to say thanks to struts2 developers, i 
think it's a great job. It's too easy to perform an ajax application 
with struts2. With a little number of tags you can achieve a very 
functional application. Thanks, too great job.

-- 
Sergio


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


Re: struts2 and tables

Posted by Hans Solo <ha...@googlemail.com>.
<s:param name="politico"><s:property /></s:param>

should work.


2010/1/8 Chris Pratt <th...@gmail.com>:
> I'm not positive but you might try:
>
> <s:param name="politico" value="${this}"/>
>
>  (*Chris*)
>
> On Thu, Jan 7, 2010 at 4:09 PM, Sergio
> <ki...@hotmail.com>wrote:
>
>> Sergio escribió:
>>
>>  Chris Pratt escribió:
>>>
>>>> You can refer to the DisplayTag documentation about what collections they
>>>> support, there are quite a few.  I usually use a java.util.List of
>>>> JavaBean's And yes, you'll have to use JDBC, JPA, Ibatis, Hibernate... to
>>>> get that data from the database into a structure that can be displayed.
>>>>
>>>> As for your other question, take a look at the last column in my example,
>>>> that's exactly what it does.
>>>>  (*Chris*)
>>>>
>>>> On Thu, Jan 7, 2010 at 1:05 AM, Sergio
>>>> <ki...@hotmail.com>wrote:
>>>>
>>>>
>>>>
>>>>> but i don't understand the data structure to hold the users. When you
>>>>> get
>>>>> the ResultSet from mysql, how do you put it into the list? Without using
>>>>> hibernate or similar, i've tried with several collections, for example a
>>>>> <String >, Map <String><String>. The first string holds the name or user
>>>>> id,
>>>>> and the map holds attribute-value pair. No success, i think that is a
>>>>> bad
>>>>> solution.
>>>>>
>>>>> and another question: i need the user id be passed to another action as
>>>>> a
>>>>> parameter. I've tried with a s:form and a hidden field, something like
>>>>> <input type="hidden" value="<s:property>"> is the idea. It's about an
>>>>> online
>>>>> shop, and i'm having problems with:
>>>>>
>>>>> 1.- listing products from mysql
>>>>> 2.- adding products to the cart (from a mysql products list
>>>>>
>>>>> i'm a little newbie with struts.....
>>>>>
>>>>> regards
>>>>>
>>>>> --
>>>>> Sergio
>>>>>
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>>>> For additional commands, e-mail: user-help@struts.apache.org
>>>>>
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>>
>>> wow, i think i got. I'll take a look.
>>>
>>> thank you very much
>>>
>>>  my point is that i have a property which is a String, and i need that
>> string in two ways: as a literal string and as a parameter to another
>> action. Using "s:property", something like this:
>>
>>    <table>
>>    <s:iterator value="#session.carrito">
>>        <tr>
>>            <td><s:property />
>>            </td>
>>            <td><s:url id="idResta" value="/Del.action">
>>                    <s:param name="politico" value="[0]"></s:param>
>>                </s:url>
>>                <sx:a accesskey="6" href="%{idResta}"
>> targets="secondaryContent" >Fuera</sx:a>
>>            </td>
>>        </tr>
>>    </s:iterator>
>>    </table>
>>
>> sessio.carrito is a String ArrayList and iterator works. Each of that
>> string must be passed to another action, say Action2, like a form with a
>> hidden field. During Action2 (which delete "politico" from session.carrito)
>> there's a *java.lang.ArrayIndexOutOfBoundsException: -1*
>>
>> I thought that "[0]" helds the actual value, same as "<s:property />". Into
>> "param" tag i've tried also with value="{ #this }" but i got that java
>> exception.
>>
>> Something like:
>>
>> <s:param name="politico" value="<s:property />"></s:param>
>>
>> is my literal desire :)
>>
>> My struts action has private String politico and getters y setters. I'm not
>> really sure if  "politco" is viewed by Action2.
>>
>>
>> regards
>> **
>>
>> --
>> Sergio
>>
>>
>> ---------------------------------------------------------------------
>> 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: struts2 and tables

Posted by Chris Pratt <th...@gmail.com>.
I'm not positive but you might try:

<s:param name="politico" value="${this}"/>

  (*Chris*)

On Thu, Jan 7, 2010 at 4:09 PM, Sergio
<ki...@hotmail.com>wrote:

> Sergio escribió:
>
>  Chris Pratt escribió:
>>
>>> You can refer to the DisplayTag documentation about what collections they
>>> support, there are quite a few.  I usually use a java.util.List of
>>> JavaBean's And yes, you'll have to use JDBC, JPA, Ibatis, Hibernate... to
>>> get that data from the database into a structure that can be displayed.
>>>
>>> As for your other question, take a look at the last column in my example,
>>> that's exactly what it does.
>>>  (*Chris*)
>>>
>>> On Thu, Jan 7, 2010 at 1:05 AM, Sergio
>>> <ki...@hotmail.com>wrote:
>>>
>>>
>>>
>>>> but i don't understand the data structure to hold the users. When you
>>>> get
>>>> the ResultSet from mysql, how do you put it into the list? Without using
>>>> hibernate or similar, i've tried with several collections, for example a
>>>> <String >, Map <String><String>. The first string holds the name or user
>>>> id,
>>>> and the map holds attribute-value pair. No success, i think that is a
>>>> bad
>>>> solution.
>>>>
>>>> and another question: i need the user id be passed to another action as
>>>> a
>>>> parameter. I've tried with a s:form and a hidden field, something like
>>>> <input type="hidden" value="<s:property>"> is the idea. It's about an
>>>> online
>>>> shop, and i'm having problems with:
>>>>
>>>> 1.- listing products from mysql
>>>> 2.- adding products to the cart (from a mysql products list
>>>>
>>>> i'm a little newbie with struts.....
>>>>
>>>> regards
>>>>
>>>> --
>>>> Sergio
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>>> For additional commands, e-mail: user-help@struts.apache.org
>>>>
>>>>
>>>>
>>>>
>>>
>>>
>>>
>> wow, i think i got. I'll take a look.
>>
>> thank you very much
>>
>>  my point is that i have a property which is a String, and i need that
> string in two ways: as a literal string and as a parameter to another
> action. Using "s:property", something like this:
>
>    <table>
>    <s:iterator value="#session.carrito">
>        <tr>
>            <td><s:property />
>            </td>
>            <td><s:url id="idResta" value="/Del.action">
>                    <s:param name="politico" value="[0]"></s:param>
>                </s:url>
>                <sx:a accesskey="6" href="%{idResta}"
> targets="secondaryContent" >Fuera</sx:a>
>            </td>
>        </tr>
>    </s:iterator>
>    </table>
>
> sessio.carrito is a String ArrayList and iterator works. Each of that
> string must be passed to another action, say Action2, like a form with a
> hidden field. During Action2 (which delete "politico" from session.carrito)
> there's a *java.lang.ArrayIndexOutOfBoundsException: -1*
>
> I thought that "[0]" helds the actual value, same as "<s:property />". Into
> "param" tag i've tried also with value="{ #this }" but i got that java
> exception.
>
> Something like:
>
> <s:param name="politico" value="<s:property />"></s:param>
>
> is my literal desire :)
>
> My struts action has private String politico and getters y setters. I'm not
> really sure if  "politco" is viewed by Action2.
>
>
> regards
> **
>
> --
> Sergio
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

Re: struts2 and tables

Posted by Sergio <ki...@hotmail.com>.
Sergio escribió:
> Chris Pratt escribió:
>> You can refer to the DisplayTag documentation about what collections 
>> they
>> support, there are quite a few.  I usually use a java.util.List of
>> JavaBean's And yes, you'll have to use JDBC, JPA, Ibatis, 
>> Hibernate... to
>> get that data from the database into a structure that can be displayed.
>>
>> As for your other question, take a look at the last column in my 
>> example,
>> that's exactly what it does.
>>   (*Chris*)
>>
>> On Thu, Jan 7, 2010 at 1:05 AM, Sergio
>> <ki...@hotmail.com>wrote:
>>
>>  
>>> but i don't understand the data structure to hold the users. When 
>>> you get
>>> the ResultSet from mysql, how do you put it into the list? Without 
>>> using
>>> hibernate or similar, i've tried with several collections, for 
>>> example a
>>> <String >, Map <String><String>. The first string holds the name or 
>>> user id,
>>> and the map holds attribute-value pair. No success, i think that is 
>>> a bad
>>> solution.
>>>
>>> and another question: i need the user id be passed to another action 
>>> as a
>>> parameter. I've tried with a s:form and a hidden field, something like
>>> <input type="hidden" value="<s:property>"> is the idea. It's about 
>>> an online
>>> shop, and i'm having problems with:
>>>
>>> 1.- listing products from mysql
>>> 2.- adding products to the cart (from a mysql products list
>>>
>>> i'm a little newbie with struts.....
>>>
>>> regards
>>>
>>> -- 
>>> Sergio
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>> For additional commands, e-mail: user-help@struts.apache.org
>>>
>>>
>>>     
>>
>>   
> wow, i think i got. I'll take a look.
>
> thank you very much
>
my point is that i have a property which is a String, and i need that 
string in two ways: as a literal string and as a parameter to another 
action. Using "s:property", something like this:

     <table>
     <s:iterator value="#session.carrito">
         <tr>
             <td><s:property />
             </td>
             <td><s:url id="idResta" value="/Del.action">
                     <s:param name="politico" value="[0]"></s:param>
                 </s:url>
                 <sx:a accesskey="6" href="%{idResta}" 
targets="secondaryContent" >Fuera</sx:a>
             </td>
         </tr>
     </s:iterator>
     </table>

sessio.carrito is a String ArrayList and iterator works. Each of that 
string must be passed to another action, say Action2, like a form with a 
hidden field. During Action2 (which delete "politico" from 
session.carrito) there's a *java.lang.ArrayIndexOutOfBoundsException: -1*

I thought that "[0]" helds the actual value, same as "<s:property />". 
Into "param" tag i've tried also with value="{ #this }" but i got that 
java exception.

Something like:

 <s:param name="politico" value="<s:property />"></s:param>

is my literal desire :)

My struts action has private String politico and getters y setters. I'm 
not really sure if  "politco" is viewed by Action2.

regards
**

-- 
Sergio


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


Re: struts2 and tables

Posted by Sergio <ki...@hotmail.com>.
Chris Pratt escribió:
> You can refer to the DisplayTag documentation about what collections they
> support, there are quite a few.  I usually use a java.util.List of
> JavaBean's And yes, you'll have to use JDBC, JPA, Ibatis, Hibernate... to
> get that data from the database into a structure that can be displayed.
>
> As for your other question, take a look at the last column in my example,
> that's exactly what it does.
>   (*Chris*)
>
> On Thu, Jan 7, 2010 at 1:05 AM, Sergio
> <ki...@hotmail.com>wrote:
>
>   
>> but i don't understand the data structure to hold the users. When you get
>> the ResultSet from mysql, how do you put it into the list? Without using
>> hibernate or similar, i've tried with several collections, for example a
>> <String >, Map <String><String>. The first string holds the name or user id,
>> and the map holds attribute-value pair. No success, i think that is a bad
>> solution.
>>
>> and another question: i need the user id be passed to another action as a
>> parameter. I've tried with a s:form and a hidden field, something like
>> <input type="hidden" value="<s:property>"> is the idea. It's about an online
>> shop, and i'm having problems with:
>>
>> 1.- listing products from mysql
>> 2.- adding products to the cart (from a mysql products list
>>
>> i'm a little newbie with struts.....
>>
>> regards
>>
>> --
>> Sergio
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
>>     
>
>   
wow, i think i got. I'll take a look.

thank you very much

-- 
Sergio


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


Re: struts2 and tables

Posted by Chris Pratt <th...@gmail.com>.
You can refer to the DisplayTag documentation about what collections they
support, there are quite a few.  I usually use a java.util.List of
JavaBean's And yes, you'll have to use JDBC, JPA, Ibatis, Hibernate... to
get that data from the database into a structure that can be displayed.

As for your other question, take a look at the last column in my example,
that's exactly what it does.
  (*Chris*)

On Thu, Jan 7, 2010 at 1:05 AM, Sergio
<ki...@hotmail.com>wrote:

> but i don't understand the data structure to hold the users. When you get
> the ResultSet from mysql, how do you put it into the list? Without using
> hibernate or similar, i've tried with several collections, for example a
> <String >, Map <String><String>. The first string holds the name or user id,
> and the map holds attribute-value pair. No success, i think that is a bad
> solution.
>
> and another question: i need the user id be passed to another action as a
> parameter. I've tried with a s:form and a hidden field, something like
> <input type="hidden" value="<s:property>"> is the idea. It's about an online
> shop, and i'm having problems with:
>
> 1.- listing products from mysql
> 2.- adding products to the cart (from a mysql products list
>
> i'm a little newbie with struts.....
>
> regards
>
> --
> Sergio
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

Re: struts2 and tables

Posted by Sergio <ki...@hotmail.com>.
Chris Pratt escribió:
> Maybe this will clear things up.  This is a working example from our site:
>
>   <s:url action="reset-password-csr" id="reset" escapeAmp="false"/>
>   <display:table uid="user" name="${users.list}" pagesize="20"
> requestURI="csr-search-results.html" class="tableWithHeaderBG"
> cellpadding="0" cellspacing="0" summary="This table lists Users
> resulting from a previous search" export="false">
>     <display:setProperty name="basic.msg.empty_list">No Users
> Found</display:setProperty>
>     <display:column title="Last Name" property="name.lastname"
> class="tdLeft" scope="row"/>
>     <display:column title="First Name" property="name.firstname"
> class="tdLeftNoPad"/>
>     <display:column title="User ID" property="userid" paramId="userid"
> value="%{'userid'}" paramProperty="userid" class="tdLeft"
> scope="row"/>
>     <display:column title="Email" property="email" paramId="email"
> paramProperty="email" class="tdLeftNoPad"/>
>     <display:column title="Security Question"
> property="securityChallenge" class="tdLeftNoPad"/>
>     <display:column title="Security Answer"
> property="securityResponse" class="tdLeftNoPad"/>
>     <display:column title="&nbsp;" href="${reset}" paramId="userid"
> paramProperty="userid" class="tdLeftNoPad">Reset
> Password</display:column>
>   </display:table>
>
>    (*Chris*)
>
>
> On Wed, Jan 6, 2010 at 5:00 PM, Chris Pratt <th...@gmail.com> wrote:
>
>   
>> In your action, add a getList() method that returns the list generated by
>> the action, then just pass name="${list}" to the display:table tag.  Or, you
>> could create the list and put it in the request or session scope and it
>> would work exactly the same.
>>
>> The trick with the interceptor is just to get it to ignore the special
>> tracking parameters that DisplayTag uses in the prev/next links.
>>
>>   (*Chris*)
>>
>>
>> On Wed, Jan 6, 2010 at 4:28 PM, Frans Thamura <fr...@meruvian.org> wrote:
>>
>>     
>>> wah can share how the interceptor work with display tag
>>>
>>> sorry if this is silly question, but honestly i still need the glue
>>>
>>> usually i create a private xxx List, and will be passed to the list
>>>
>>> how integrate the list $xxx with the display tag?
>>>
>>> thx
>>>
>>>
>>> On Thu, Jan 7, 2010 at 7:25 AM, Chris Pratt <th...@gmail.com>
>>> wrote:
>>>       
>>>> It's just a standard JSP Tag Library.  Because Struts 2 has the Request
>>>> Wrapper, you can use standard JSTL EL to get the list from your action
>>>>         
>>> and
>>>       
>>>> pass it to the DisplayTag Table, from then on it's just using the
>>>> capabilities of DisplayTag to put the data where you want it.  The one
>>>> caveat is that we've had to set the requestURI attribute to make sure
>>>>         
>>> that
>>>       
>>>> the prev/next links go to the right place and I added the excludeParams
>>>> parameter below to the params interceptor so that you don't get the ugly
>>>> warnings from struts.
>>>>
>>>>        <interceptor-ref name="params">
>>>>          <param name="excludeParams">d-\d*-[a-z]</param>
>>>>        </interceptor-ref>
>>>>
>>>> (*Chris*)
>>>>
>>>> On Wed, Jan 6, 2010 at 4:12 PM, Frans Thamura <fr...@meruvian.org>
>>>>         
>>> wrote:
>>>       
>>>>> can share how the struts2 work with display tag
>>>>>
>>>>>
>>>>> sorry never use this also, how the display tag work with List when we
>>>>> submit the grid
>>>>>
>>>>> F
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> On Thu, Jan 7, 2010 at 7:00 AM, Chris Pratt <th...@gmail.com>
>>>>> wrote:
>>>>>           
>>>>>> We use DisplayTag (http://www.displaytag.org), it works pretty well.
>>>>>>  (*Chris*)
>>>>>>
>>>>>> On Wed, Jan 6, 2010 at 3:28 PM, Sergio
>>>>>> <ki...@hotmail.com>wrote:
>>>>>>
>>>>>>             
>>>>>>> Hi, people, how can i show a table into a jsp from the struts
>>>>>>>               
>>> action?
>>>       
>>>>> Are
>>>>>           
>>>>>>> there a simple method for doing that? I've tried with java
>>>>>>>               
>>> collections
>>>       
>>>>> into
>>>>>           
>>>>>>> the action and "property" tag into the jsp with no success.
>>>>>>>
>>>>>>> thanks in advance
>>>>>>>
>>>>>>> --
>>>>>>> Sergio
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>               
>>> ---------------------------------------------------------------------
>>>       
>>>>>>> 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
>>>>>
>>>>>
>>>>>           
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>> For additional commands, e-mail: user-help@struts.apache.org
>>>
>>>
>>>       
>
>   
but i don't understand the data structure to hold the users. When you 
get the ResultSet from mysql, how do you put it into the list? Without 
using hibernate or similar, i've tried with several collections, for 
example a <String >, Map <String><String>. The first string holds the 
name or user id, and the map holds attribute-value pair. No success, i 
think that is a bad solution.

and another question: i need the user id be passed to another action as 
a parameter. I've tried with a s:form and a hidden field, something like 
<input type="hidden" value="<s:property>"> is the idea. It's about an 
online shop, and i'm having problems with:

1.- listing products from mysql
2.- adding products to the cart (from a mysql products list

i'm a little newbie with struts.....

regards

-- 
Sergio


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


Re: struts2 and tables

Posted by Brian Thompson <el...@gmail.com>.
Something like this should do the trick:

<display:column title="<input .../>" escapeXml="false"/>

-Brian

On Wed, Jan 27, 2010 at 8:13 AM, Saeed Iqbal <sa...@gmail.com> wrote:

> For header this is an interesting situation i have not come across
> yet. I cannot say anything.
>
> On Wednesday, January 27, 2010, Arpan <ar...@gmail.com> wrote:
> > Hi Saeed,
> >
> > Replacing that with checkbox element will give me checkbox for every row
> for
> > that column.
> > But still my column header or title  will not have any checkbox.
> >
> > On Wed, Jan 27, 2010 at 5:58 PM, Saeed Iqbal <sa...@gmail.com> wrote:
> >
> >> Replace the <s:property value="%{getText('titles.edit'
> >> )}" />
> >>
> >>
> >> <display:column href="adminaddoreditarticle"  title="Edit" paramId="id"
> >> paramProperty="id" headerClass="listHeader">
> >>        <s:property value="%{getText('titles.edit'
> >> )}" />
> >>    </display:column>
> >>
> >>
> >> On Wed, Jan 27, 2010 at 5:23 PM, Arpan <ar...@gmail.com> wrote:
> >>
> >> > Hi Saeed,
> >> >
> >> > Thanks for the reply. But how can you display your checkbox inside
> that
> >> > "column Title"?
> >> >
> >> > On Wed, Jan 27, 2010 at 4:45 PM, Saeed Iqbal <sa...@gmail.com>
> wrote:
> >> >
> >> > > For display you can close your display tag open and end your tag
> >> > > separately.
> >> > > In between you can place your checkbox.
> >> > > For example:
> >> > > <display:column href="adminaddoreditarticle"  title="Edit"
> paramId="id"
> >> > > paramProperty="id" headerClass="listHeader">
> >> > >        <s:property value="%{getText('titles.edit')}" />
> >> > >    </display:column>
> >> > >
> >> > > For checking all (javascript) include an id with each checkbox and
> have
> >> > > onclick with the top one to be able to code in javascript to check
> all
> >> > > others.
> >> > >
> >> > > On Wed, Jan 27, 2010 at 4:11 PM, Arpan <ar...@gmail.com>
> wrote:
> >> > >
> >> > > > My scenario is that I need a column only for checkboxes. In the
> title
> >> > > there
> >> > > > will be a checkbox and a link "Delete". How can I show these using
> >> > > display
> >> > > > tag.
> >> > > > When the user will select the top checkbox, all other checkboxes
> in
> >> > that
> >> > > > column should be selected or unselected accordingly.
> >> > > >
> >> > > >
> >> > > > On Thu, Jan 7, 2010 at 6:35 AM, Chris Pratt <
> thechrispratt@gmail.com
> >> >
> >> > > > wrote:
> >> > > >
> >> > > > > Maybe this will clear things up.  This is a working example from
> >> our
> >> > > > site:
> >> > > > >
> >> > > > >  <s:url action="reset-password-csr" id="reset"
> escapeAmp="false"/>
> >> > > > >  <display:table uid="user" name="${users.list}" pagesize="20"
> >> > > > > requestURI="csr-search-results.html" class="tableWithHeaderBG"
> >> > > > > cellpadding="0" cellspacing="0" summary="This table lists Users
> >> > > > > resulting from a previous search" export="false">
> >> > > > >    <display:setProperty name="basic.msg.empty_list">No Users
> >> > > > > Found</display:setProperty>
> >> > > > >    <display:column title="Last Name" property="name.lastname"
> >> > > > > class="tdLeft" scope="row"/>
> >> > > > >    <display:column title="First Name" property="name.firstname"
> >> > > > > class="tdLeftNoPad"/>
> >> > > > >    <display:column title="User ID" property="userid"
> >> paramId="userid"
> >> > > > > value="%{'userid'}" paramProperty="userid" class="tdLeft"
> >> > > > > scope="row"/>
> >> > > > >    <display:column title="Email" property="email"
> paramId="email"
> >> > > > > paramProperty="email" class="tdLeftNoPad"/>
> >> > > > >    <display:column title="Security Questio
>
> --
> Saeed Iqbal
> Independant Consultant
> J2EE - Application Architect / Developer
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

Re: struts2 and tables

Posted by Saeed Iqbal <sa...@gmail.com>.
For header this is an interesting situation i have not come across
yet. I cannot say anything.

On Wednesday, January 27, 2010, Arpan <ar...@gmail.com> wrote:
> Hi Saeed,
>
> Replacing that with checkbox element will give me checkbox for every row for
> that column.
> But still my column header or title  will not have any checkbox.
>
> On Wed, Jan 27, 2010 at 5:58 PM, Saeed Iqbal <sa...@gmail.com> wrote:
>
>> Replace the <s:property value="%{getText('titles.edit'
>> )}" />
>>
>>
>> <display:column href="adminaddoreditarticle"  title="Edit" paramId="id"
>> paramProperty="id" headerClass="listHeader">
>>        <s:property value="%{getText('titles.edit'
>> )}" />
>>    </display:column>
>>
>>
>> On Wed, Jan 27, 2010 at 5:23 PM, Arpan <ar...@gmail.com> wrote:
>>
>> > Hi Saeed,
>> >
>> > Thanks for the reply. But how can you display your checkbox inside that
>> > "column Title"?
>> >
>> > On Wed, Jan 27, 2010 at 4:45 PM, Saeed Iqbal <sa...@gmail.com> wrote:
>> >
>> > > For display you can close your display tag open and end your tag
>> > > separately.
>> > > In between you can place your checkbox.
>> > > For example:
>> > > <display:column href="adminaddoreditarticle"  title="Edit" paramId="id"
>> > > paramProperty="id" headerClass="listHeader">
>> > >        <s:property value="%{getText('titles.edit')}" />
>> > >    </display:column>
>> > >
>> > > For checking all (javascript) include an id with each checkbox and have
>> > > onclick with the top one to be able to code in javascript to check all
>> > > others.
>> > >
>> > > On Wed, Jan 27, 2010 at 4:11 PM, Arpan <ar...@gmail.com> wrote:
>> > >
>> > > > My scenario is that I need a column only for checkboxes. In the title
>> > > there
>> > > > will be a checkbox and a link "Delete". How can I show these using
>> > > display
>> > > > tag.
>> > > > When the user will select the top checkbox, all other checkboxes in
>> > that
>> > > > column should be selected or unselected accordingly.
>> > > >
>> > > >
>> > > > On Thu, Jan 7, 2010 at 6:35 AM, Chris Pratt <thechrispratt@gmail.com
>> >
>> > > > wrote:
>> > > >
>> > > > > Maybe this will clear things up.  This is a working example from
>> our
>> > > > site:
>> > > > >
>> > > > >  <s:url action="reset-password-csr" id="reset" escapeAmp="false"/>
>> > > > >  <display:table uid="user" name="${users.list}" pagesize="20"
>> > > > > requestURI="csr-search-results.html" class="tableWithHeaderBG"
>> > > > > cellpadding="0" cellspacing="0" summary="This table lists Users
>> > > > > resulting from a previous search" export="false">
>> > > > >    <display:setProperty name="basic.msg.empty_list">No Users
>> > > > > Found</display:setProperty>
>> > > > >    <display:column title="Last Name" property="name.lastname"
>> > > > > class="tdLeft" scope="row"/>
>> > > > >    <display:column title="First Name" property="name.firstname"
>> > > > > class="tdLeftNoPad"/>
>> > > > >    <display:column title="User ID" property="userid"
>> paramId="userid"
>> > > > > value="%{'userid'}" paramProperty="userid" class="tdLeft"
>> > > > > scope="row"/>
>> > > > >    <display:column title="Email" property="email" paramId="email"
>> > > > > paramProperty="email" class="tdLeftNoPad"/>
>> > > > >    <display:column title="Security Questio

-- 
Saeed Iqbal
Independant Consultant
J2EE - Application Architect / Developer

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


Re: struts2 and tables

Posted by Arpan <ar...@gmail.com>.
Hi Saeed,

Replacing that with checkbox element will give me checkbox for every row for
that column.
But still my column header or title  will not have any checkbox.

On Wed, Jan 27, 2010 at 5:58 PM, Saeed Iqbal <sa...@gmail.com> wrote:

> Replace the <s:property value="%{getText('titles.edit'
> )}" />
>
>
> <display:column href="adminaddoreditarticle"  title="Edit" paramId="id"
> paramProperty="id" headerClass="listHeader">
>        <s:property value="%{getText('titles.edit'
> )}" />
>    </display:column>
>
>
> On Wed, Jan 27, 2010 at 5:23 PM, Arpan <ar...@gmail.com> wrote:
>
> > Hi Saeed,
> >
> > Thanks for the reply. But how can you display your checkbox inside that
> > "column Title"?
> >
> > On Wed, Jan 27, 2010 at 4:45 PM, Saeed Iqbal <sa...@gmail.com> wrote:
> >
> > > For display you can close your display tag open and end your tag
> > > separately.
> > > In between you can place your checkbox.
> > > For example:
> > > <display:column href="adminaddoreditarticle"  title="Edit" paramId="id"
> > > paramProperty="id" headerClass="listHeader">
> > >        <s:property value="%{getText('titles.edit')}" />
> > >    </display:column>
> > >
> > > For checking all (javascript) include an id with each checkbox and have
> > > onclick with the top one to be able to code in javascript to check all
> > > others.
> > >
> > > On Wed, Jan 27, 2010 at 4:11 PM, Arpan <ar...@gmail.com> wrote:
> > >
> > > > My scenario is that I need a column only for checkboxes. In the title
> > > there
> > > > will be a checkbox and a link "Delete". How can I show these using
> > > display
> > > > tag.
> > > > When the user will select the top checkbox, all other checkboxes in
> > that
> > > > column should be selected or unselected accordingly.
> > > >
> > > >
> > > > On Thu, Jan 7, 2010 at 6:35 AM, Chris Pratt <thechrispratt@gmail.com
> >
> > > > wrote:
> > > >
> > > > > Maybe this will clear things up.  This is a working example from
> our
> > > > site:
> > > > >
> > > > >  <s:url action="reset-password-csr" id="reset" escapeAmp="false"/>
> > > > >  <display:table uid="user" name="${users.list}" pagesize="20"
> > > > > requestURI="csr-search-results.html" class="tableWithHeaderBG"
> > > > > cellpadding="0" cellspacing="0" summary="This table lists Users
> > > > > resulting from a previous search" export="false">
> > > > >    <display:setProperty name="basic.msg.empty_list">No Users
> > > > > Found</display:setProperty>
> > > > >    <display:column title="Last Name" property="name.lastname"
> > > > > class="tdLeft" scope="row"/>
> > > > >    <display:column title="First Name" property="name.firstname"
> > > > > class="tdLeftNoPad"/>
> > > > >    <display:column title="User ID" property="userid"
> paramId="userid"
> > > > > value="%{'userid'}" paramProperty="userid" class="tdLeft"
> > > > > scope="row"/>
> > > > >    <display:column title="Email" property="email" paramId="email"
> > > > > paramProperty="email" class="tdLeftNoPad"/>
> > > > >    <display:column title="Security Question"
> > > > > property="securityChallenge" class="tdLeftNoPad"/>
> > > > >    <display:column title="Security Answer"
> > > > > property="securityResponse" class="tdLeftNoPad"/>
> > > > >    <display:column title="&nbsp;" href="${reset}" paramId="userid"
> > > > > paramProperty="userid" class="tdLeftNoPad">Reset
> > > > > Password</display:column>
> > > > >  </display:table>
> > > > >
> > > > >   (*Chris*)
> > > > >
> > > > >
> > > > > On Wed, Jan 6, 2010 at 5:00 PM, Chris Pratt <
> thechrispratt@gmail.com
> > >
> > > > > wrote:
> > > > >
> > > > > > In your action, add a getList() method that returns the list
> > > generated
> > > > by
> > > > > > the action, then just pass name="${list}" to the display:table
> tag.
> > > >  Or,
> > > > > you
> > > > > > could create the list and put it in the request or session scope
> > and
> > > it
> > > > > > would work exactly the same.
> > > > > >
> > > > > > The trick with the interceptor is just to get it to ignore the
> > > special
> > > > > > tracking parameters that DisplayTag uses in the prev/next links.
> > > > > >
> > > > > >   (*Chris*)
> > > > > >
> > > > > >
> > > > > > On Wed, Jan 6, 2010 at 4:28 PM, Frans Thamura <
> frans@meruvian.org>
> > > > > wrote:
> > > > > >
> > > > > >> wah can share how the interceptor work with display tag
> > > > > >>
> > > > > >> sorry if this is silly question, but honestly i still need the
> > glue
> > > > > >>
> > > > > >> usually i create a private xxx List, and will be passed to the
> > list
> > > > > >>
> > > > > >> how integrate the list $xxx with the display tag?
> > > > > >>
> > > > > >> thx
> > > > > >>
> > > > > >>
> > > > > >> On Thu, Jan 7, 2010 at 7:25 AM, Chris Pratt <
> > > thechrispratt@gmail.com>
> > > > > >> wrote:
> > > > > >> > It's just a standard JSP Tag Library.  Because Struts 2 has
> the
> > > > > Request
> > > > > >> > Wrapper, you can use standard JSTL EL to get the list from
> your
> > > > action
> > > > > >> and
> > > > > >> > pass it to the DisplayTag Table, from then on it's just using
> > the
> > > > > >> > capabilities of DisplayTag to put the data where you want it.
> >  The
> > > > one
> > > > > >> > caveat is that we've had to set the requestURI attribute to
> make
> > > > sure
> > > > > >> that
> > > > > >> > the prev/next links go to the right place and I added the
> > > > > excludeParams
> > > > > >> > parameter below to the params interceptor so that you don't
> get
> > > the
> > > > > ugly
> > > > > >> > warnings from struts.
> > > > > >> >
> > > > > >> >        <interceptor-ref name="params">
> > > > > >> >          <param name="excludeParams">d-\d*-[a-z]</param>
> > > > > >> >        </interceptor-ref>
> > > > > >> >
> > > > > >> > (*Chris*)
> > > > > >> >
> > > > > >> > On Wed, Jan 6, 2010 at 4:12 PM, Frans Thamura <
> > frans@meruvian.org
> > > >
> > > > > >> wrote:
> > > > > >> >
> > > > > >> >> can share how the struts2 work with display tag
> > > > > >> >>
> > > > > >> >>
> > > > > >> >> sorry never use this also, how the display tag work with List
> > > when
> > > > we
> > > > > >> >> submit the grid
> > > > > >> >>
> > > > > >> >> F
> > > > > >> >>
> > > > > >> >>
> > > > > >> >>
> > > > > >> >>
> > > > > >> >> On Thu, Jan 7, 2010 at 7:00 AM, Chris Pratt <
> > > > thechrispratt@gmail.com
> > > > > >
> > > > > >> >> wrote:
> > > > > >> >> > We use DisplayTag (http://www.displaytag.org), it works
> > pretty
> > > > > well.
> > > > > >> >> >  (*Chris*)
> > > > > >> >> >
> > > > > >> >> > On Wed, Jan 6, 2010 at 3:28 PM, Sergio
> > > > > >> >> > <ki...@hotmail.com>wrote:
> > > > > >> >> >
> > > > > >> >> >> Hi, people, how can i show a table into a jsp from the
> > struts
> > > > > >> action?
> > > > > >> >> Are
> > > > > >> >> >> there a simple method for doing that? I've tried with java
> > > > > >> collections
> > > > > >> >> into
> > > > > >> >> >> the action and "property" tag into the jsp with no
> success.
> > > > > >> >> >>
> > > > > >> >> >> thanks in advance
> > > > > >> >> >>
> > > > > >> >> >> --
> > > > > >> >> >> Sergio
> > > > > >> >> >>
> > > > > >> >> >>
> > > > > >> >> >>
> > > > > >>
> > > ---------------------------------------------------------------------
> > > > > >> >> >> 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
> > > > > >> >>
> > > > > >> >>
> > > > > >> >
> > > > > >>
> > > > > >>
> > > ---------------------------------------------------------------------
> > > > > >> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > > > > >> For additional commands, e-mail: user-help@struts.apache.org
> > > > > >>
> > > > > >>
> > > > > >
> > > > >
> > > >
> > >
> > >
> > >
> > > --
> > > Saeed Iqbal
> > > Independant Consultant
> > > J2EE - Application Architect / Developer
> > >
> >
>
>
>
> --
> Saeed Iqbal
> Independant Consultant
> J2EE - Application Architect / Developer
>

Re: struts2 and tables

Posted by Saeed Iqbal <sa...@gmail.com>.
Replace the <s:property value="%{getText('titles.edit'
)}" />


<display:column href="adminaddoreditarticle"  title="Edit" paramId="id"
paramProperty="id" headerClass="listHeader">
        <s:property value="%{getText('titles.edit'
)}" />
    </display:column>


On Wed, Jan 27, 2010 at 5:23 PM, Arpan <ar...@gmail.com> wrote:

> Hi Saeed,
>
> Thanks for the reply. But how can you display your checkbox inside that
> "column Title"?
>
> On Wed, Jan 27, 2010 at 4:45 PM, Saeed Iqbal <sa...@gmail.com> wrote:
>
> > For display you can close your display tag open and end your tag
> > separately.
> > In between you can place your checkbox.
> > For example:
> > <display:column href="adminaddoreditarticle"  title="Edit" paramId="id"
> > paramProperty="id" headerClass="listHeader">
> >        <s:property value="%{getText('titles.edit')}" />
> >    </display:column>
> >
> > For checking all (javascript) include an id with each checkbox and have
> > onclick with the top one to be able to code in javascript to check all
> > others.
> >
> > On Wed, Jan 27, 2010 at 4:11 PM, Arpan <ar...@gmail.com> wrote:
> >
> > > My scenario is that I need a column only for checkboxes. In the title
> > there
> > > will be a checkbox and a link "Delete". How can I show these using
> > display
> > > tag.
> > > When the user will select the top checkbox, all other checkboxes in
> that
> > > column should be selected or unselected accordingly.
> > >
> > >
> > > On Thu, Jan 7, 2010 at 6:35 AM, Chris Pratt <th...@gmail.com>
> > > wrote:
> > >
> > > > Maybe this will clear things up.  This is a working example from our
> > > site:
> > > >
> > > >  <s:url action="reset-password-csr" id="reset" escapeAmp="false"/>
> > > >  <display:table uid="user" name="${users.list}" pagesize="20"
> > > > requestURI="csr-search-results.html" class="tableWithHeaderBG"
> > > > cellpadding="0" cellspacing="0" summary="This table lists Users
> > > > resulting from a previous search" export="false">
> > > >    <display:setProperty name="basic.msg.empty_list">No Users
> > > > Found</display:setProperty>
> > > >    <display:column title="Last Name" property="name.lastname"
> > > > class="tdLeft" scope="row"/>
> > > >    <display:column title="First Name" property="name.firstname"
> > > > class="tdLeftNoPad"/>
> > > >    <display:column title="User ID" property="userid" paramId="userid"
> > > > value="%{'userid'}" paramProperty="userid" class="tdLeft"
> > > > scope="row"/>
> > > >    <display:column title="Email" property="email" paramId="email"
> > > > paramProperty="email" class="tdLeftNoPad"/>
> > > >    <display:column title="Security Question"
> > > > property="securityChallenge" class="tdLeftNoPad"/>
> > > >    <display:column title="Security Answer"
> > > > property="securityResponse" class="tdLeftNoPad"/>
> > > >    <display:column title="&nbsp;" href="${reset}" paramId="userid"
> > > > paramProperty="userid" class="tdLeftNoPad">Reset
> > > > Password</display:column>
> > > >  </display:table>
> > > >
> > > >   (*Chris*)
> > > >
> > > >
> > > > On Wed, Jan 6, 2010 at 5:00 PM, Chris Pratt <thechrispratt@gmail.com
> >
> > > > wrote:
> > > >
> > > > > In your action, add a getList() method that returns the list
> > generated
> > > by
> > > > > the action, then just pass name="${list}" to the display:table tag.
> > >  Or,
> > > > you
> > > > > could create the list and put it in the request or session scope
> and
> > it
> > > > > would work exactly the same.
> > > > >
> > > > > The trick with the interceptor is just to get it to ignore the
> > special
> > > > > tracking parameters that DisplayTag uses in the prev/next links.
> > > > >
> > > > >   (*Chris*)
> > > > >
> > > > >
> > > > > On Wed, Jan 6, 2010 at 4:28 PM, Frans Thamura <fr...@meruvian.org>
> > > > wrote:
> > > > >
> > > > >> wah can share how the interceptor work with display tag
> > > > >>
> > > > >> sorry if this is silly question, but honestly i still need the
> glue
> > > > >>
> > > > >> usually i create a private xxx List, and will be passed to the
> list
> > > > >>
> > > > >> how integrate the list $xxx with the display tag?
> > > > >>
> > > > >> thx
> > > > >>
> > > > >>
> > > > >> On Thu, Jan 7, 2010 at 7:25 AM, Chris Pratt <
> > thechrispratt@gmail.com>
> > > > >> wrote:
> > > > >> > It's just a standard JSP Tag Library.  Because Struts 2 has the
> > > > Request
> > > > >> > Wrapper, you can use standard JSTL EL to get the list from your
> > > action
> > > > >> and
> > > > >> > pass it to the DisplayTag Table, from then on it's just using
> the
> > > > >> > capabilities of DisplayTag to put the data where you want it.
>  The
> > > one
> > > > >> > caveat is that we've had to set the requestURI attribute to make
> > > sure
> > > > >> that
> > > > >> > the prev/next links go to the right place and I added the
> > > > excludeParams
> > > > >> > parameter below to the params interceptor so that you don't get
> > the
> > > > ugly
> > > > >> > warnings from struts.
> > > > >> >
> > > > >> >        <interceptor-ref name="params">
> > > > >> >          <param name="excludeParams">d-\d*-[a-z]</param>
> > > > >> >        </interceptor-ref>
> > > > >> >
> > > > >> > (*Chris*)
> > > > >> >
> > > > >> > On Wed, Jan 6, 2010 at 4:12 PM, Frans Thamura <
> frans@meruvian.org
> > >
> > > > >> wrote:
> > > > >> >
> > > > >> >> can share how the struts2 work with display tag
> > > > >> >>
> > > > >> >>
> > > > >> >> sorry never use this also, how the display tag work with List
> > when
> > > we
> > > > >> >> submit the grid
> > > > >> >>
> > > > >> >> F
> > > > >> >>
> > > > >> >>
> > > > >> >>
> > > > >> >>
> > > > >> >> On Thu, Jan 7, 2010 at 7:00 AM, Chris Pratt <
> > > thechrispratt@gmail.com
> > > > >
> > > > >> >> wrote:
> > > > >> >> > We use DisplayTag (http://www.displaytag.org), it works
> pretty
> > > > well.
> > > > >> >> >  (*Chris*)
> > > > >> >> >
> > > > >> >> > On Wed, Jan 6, 2010 at 3:28 PM, Sergio
> > > > >> >> > <ki...@hotmail.com>wrote:
> > > > >> >> >
> > > > >> >> >> Hi, people, how can i show a table into a jsp from the
> struts
> > > > >> action?
> > > > >> >> Are
> > > > >> >> >> there a simple method for doing that? I've tried with java
> > > > >> collections
> > > > >> >> into
> > > > >> >> >> the action and "property" tag into the jsp with no success.
> > > > >> >> >>
> > > > >> >> >> thanks in advance
> > > > >> >> >>
> > > > >> >> >> --
> > > > >> >> >> Sergio
> > > > >> >> >>
> > > > >> >> >>
> > > > >> >> >>
> > > > >>
> > ---------------------------------------------------------------------
> > > > >> >> >> 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
> > > > >> >>
> > > > >> >>
> > > > >> >
> > > > >>
> > > > >>
> > ---------------------------------------------------------------------
> > > > >> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > > > >> For additional commands, e-mail: user-help@struts.apache.org
> > > > >>
> > > > >>
> > > > >
> > > >
> > >
> >
> >
> >
> > --
> > Saeed Iqbal
> > Independant Consultant
> > J2EE - Application Architect / Developer
> >
>



-- 
Saeed Iqbal
Independant Consultant
J2EE - Application Architect / Developer

Re: struts2 and tables

Posted by Arpan <ar...@gmail.com>.
Hi Saeed,

Thanks for the reply. But how can you display your checkbox inside that
"column Title"?

On Wed, Jan 27, 2010 at 4:45 PM, Saeed Iqbal <sa...@gmail.com> wrote:

> For display you can close your display tag open and end your tag
> separately.
> In between you can place your checkbox.
> For example:
> <display:column href="adminaddoreditarticle"  title="Edit" paramId="id"
> paramProperty="id" headerClass="listHeader">
>        <s:property value="%{getText('titles.edit')}" />
>    </display:column>
>
> For checking all (javascript) include an id with each checkbox and have
> onclick with the top one to be able to code in javascript to check all
> others.
>
> On Wed, Jan 27, 2010 at 4:11 PM, Arpan <ar...@gmail.com> wrote:
>
> > My scenario is that I need a column only for checkboxes. In the title
> there
> > will be a checkbox and a link "Delete". How can I show these using
> display
> > tag.
> > When the user will select the top checkbox, all other checkboxes in that
> > column should be selected or unselected accordingly.
> >
> >
> > On Thu, Jan 7, 2010 at 6:35 AM, Chris Pratt <th...@gmail.com>
> > wrote:
> >
> > > Maybe this will clear things up.  This is a working example from our
> > site:
> > >
> > >  <s:url action="reset-password-csr" id="reset" escapeAmp="false"/>
> > >  <display:table uid="user" name="${users.list}" pagesize="20"
> > > requestURI="csr-search-results.html" class="tableWithHeaderBG"
> > > cellpadding="0" cellspacing="0" summary="This table lists Users
> > > resulting from a previous search" export="false">
> > >    <display:setProperty name="basic.msg.empty_list">No Users
> > > Found</display:setProperty>
> > >    <display:column title="Last Name" property="name.lastname"
> > > class="tdLeft" scope="row"/>
> > >    <display:column title="First Name" property="name.firstname"
> > > class="tdLeftNoPad"/>
> > >    <display:column title="User ID" property="userid" paramId="userid"
> > > value="%{'userid'}" paramProperty="userid" class="tdLeft"
> > > scope="row"/>
> > >    <display:column title="Email" property="email" paramId="email"
> > > paramProperty="email" class="tdLeftNoPad"/>
> > >    <display:column title="Security Question"
> > > property="securityChallenge" class="tdLeftNoPad"/>
> > >    <display:column title="Security Answer"
> > > property="securityResponse" class="tdLeftNoPad"/>
> > >    <display:column title="&nbsp;" href="${reset}" paramId="userid"
> > > paramProperty="userid" class="tdLeftNoPad">Reset
> > > Password</display:column>
> > >  </display:table>
> > >
> > >   (*Chris*)
> > >
> > >
> > > On Wed, Jan 6, 2010 at 5:00 PM, Chris Pratt <th...@gmail.com>
> > > wrote:
> > >
> > > > In your action, add a getList() method that returns the list
> generated
> > by
> > > > the action, then just pass name="${list}" to the display:table tag.
> >  Or,
> > > you
> > > > could create the list and put it in the request or session scope and
> it
> > > > would work exactly the same.
> > > >
> > > > The trick with the interceptor is just to get it to ignore the
> special
> > > > tracking parameters that DisplayTag uses in the prev/next links.
> > > >
> > > >   (*Chris*)
> > > >
> > > >
> > > > On Wed, Jan 6, 2010 at 4:28 PM, Frans Thamura <fr...@meruvian.org>
> > > wrote:
> > > >
> > > >> wah can share how the interceptor work with display tag
> > > >>
> > > >> sorry if this is silly question, but honestly i still need the glue
> > > >>
> > > >> usually i create a private xxx List, and will be passed to the list
> > > >>
> > > >> how integrate the list $xxx with the display tag?
> > > >>
> > > >> thx
> > > >>
> > > >>
> > > >> On Thu, Jan 7, 2010 at 7:25 AM, Chris Pratt <
> thechrispratt@gmail.com>
> > > >> wrote:
> > > >> > It's just a standard JSP Tag Library.  Because Struts 2 has the
> > > Request
> > > >> > Wrapper, you can use standard JSTL EL to get the list from your
> > action
> > > >> and
> > > >> > pass it to the DisplayTag Table, from then on it's just using the
> > > >> > capabilities of DisplayTag to put the data where you want it.  The
> > one
> > > >> > caveat is that we've had to set the requestURI attribute to make
> > sure
> > > >> that
> > > >> > the prev/next links go to the right place and I added the
> > > excludeParams
> > > >> > parameter below to the params interceptor so that you don't get
> the
> > > ugly
> > > >> > warnings from struts.
> > > >> >
> > > >> >        <interceptor-ref name="params">
> > > >> >          <param name="excludeParams">d-\d*-[a-z]</param>
> > > >> >        </interceptor-ref>
> > > >> >
> > > >> > (*Chris*)
> > > >> >
> > > >> > On Wed, Jan 6, 2010 at 4:12 PM, Frans Thamura <frans@meruvian.org
> >
> > > >> wrote:
> > > >> >
> > > >> >> can share how the struts2 work with display tag
> > > >> >>
> > > >> >>
> > > >> >> sorry never use this also, how the display tag work with List
> when
> > we
> > > >> >> submit the grid
> > > >> >>
> > > >> >> F
> > > >> >>
> > > >> >>
> > > >> >>
> > > >> >>
> > > >> >> On Thu, Jan 7, 2010 at 7:00 AM, Chris Pratt <
> > thechrispratt@gmail.com
> > > >
> > > >> >> wrote:
> > > >> >> > We use DisplayTag (http://www.displaytag.org), it works pretty
> > > well.
> > > >> >> >  (*Chris*)
> > > >> >> >
> > > >> >> > On Wed, Jan 6, 2010 at 3:28 PM, Sergio
> > > >> >> > <ki...@hotmail.com>wrote:
> > > >> >> >
> > > >> >> >> Hi, people, how can i show a table into a jsp from the struts
> > > >> action?
> > > >> >> Are
> > > >> >> >> there a simple method for doing that? I've tried with java
> > > >> collections
> > > >> >> into
> > > >> >> >> the action and "property" tag into the jsp with no success.
> > > >> >> >>
> > > >> >> >> thanks in advance
> > > >> >> >>
> > > >> >> >> --
> > > >> >> >> Sergio
> > > >> >> >>
> > > >> >> >>
> > > >> >> >>
> > > >>
> ---------------------------------------------------------------------
> > > >> >> >> 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
> > > >> >>
> > > >> >>
> > > >> >
> > > >>
> > > >>
> ---------------------------------------------------------------------
> > > >> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > > >> For additional commands, e-mail: user-help@struts.apache.org
> > > >>
> > > >>
> > > >
> > >
> >
>
>
>
> --
> Saeed Iqbal
> Independant Consultant
> J2EE - Application Architect / Developer
>

Re: struts2 and tables

Posted by Saeed Iqbal <sa...@gmail.com>.
For display you can close your display tag open and end your tag separately.
In between you can place your checkbox.
For example:
<display:column href="adminaddoreditarticle"  title="Edit" paramId="id"
paramProperty="id" headerClass="listHeader">
        <s:property value="%{getText('titles.edit')}" />
    </display:column>

For checking all (javascript) include an id with each checkbox and have
onclick with the top one to be able to code in javascript to check all
others.

On Wed, Jan 27, 2010 at 4:11 PM, Arpan <ar...@gmail.com> wrote:

> My scenario is that I need a column only for checkboxes. In the title there
> will be a checkbox and a link "Delete". How can I show these using display
> tag.
> When the user will select the top checkbox, all other checkboxes in that
> column should be selected or unselected accordingly.
>
>
> On Thu, Jan 7, 2010 at 6:35 AM, Chris Pratt <th...@gmail.com>
> wrote:
>
> > Maybe this will clear things up.  This is a working example from our
> site:
> >
> >  <s:url action="reset-password-csr" id="reset" escapeAmp="false"/>
> >  <display:table uid="user" name="${users.list}" pagesize="20"
> > requestURI="csr-search-results.html" class="tableWithHeaderBG"
> > cellpadding="0" cellspacing="0" summary="This table lists Users
> > resulting from a previous search" export="false">
> >    <display:setProperty name="basic.msg.empty_list">No Users
> > Found</display:setProperty>
> >    <display:column title="Last Name" property="name.lastname"
> > class="tdLeft" scope="row"/>
> >    <display:column title="First Name" property="name.firstname"
> > class="tdLeftNoPad"/>
> >    <display:column title="User ID" property="userid" paramId="userid"
> > value="%{'userid'}" paramProperty="userid" class="tdLeft"
> > scope="row"/>
> >    <display:column title="Email" property="email" paramId="email"
> > paramProperty="email" class="tdLeftNoPad"/>
> >    <display:column title="Security Question"
> > property="securityChallenge" class="tdLeftNoPad"/>
> >    <display:column title="Security Answer"
> > property="securityResponse" class="tdLeftNoPad"/>
> >    <display:column title="&nbsp;" href="${reset}" paramId="userid"
> > paramProperty="userid" class="tdLeftNoPad">Reset
> > Password</display:column>
> >  </display:table>
> >
> >   (*Chris*)
> >
> >
> > On Wed, Jan 6, 2010 at 5:00 PM, Chris Pratt <th...@gmail.com>
> > wrote:
> >
> > > In your action, add a getList() method that returns the list generated
> by
> > > the action, then just pass name="${list}" to the display:table tag.
>  Or,
> > you
> > > could create the list and put it in the request or session scope and it
> > > would work exactly the same.
> > >
> > > The trick with the interceptor is just to get it to ignore the special
> > > tracking parameters that DisplayTag uses in the prev/next links.
> > >
> > >   (*Chris*)
> > >
> > >
> > > On Wed, Jan 6, 2010 at 4:28 PM, Frans Thamura <fr...@meruvian.org>
> > wrote:
> > >
> > >> wah can share how the interceptor work with display tag
> > >>
> > >> sorry if this is silly question, but honestly i still need the glue
> > >>
> > >> usually i create a private xxx List, and will be passed to the list
> > >>
> > >> how integrate the list $xxx with the display tag?
> > >>
> > >> thx
> > >>
> > >>
> > >> On Thu, Jan 7, 2010 at 7:25 AM, Chris Pratt <th...@gmail.com>
> > >> wrote:
> > >> > It's just a standard JSP Tag Library.  Because Struts 2 has the
> > Request
> > >> > Wrapper, you can use standard JSTL EL to get the list from your
> action
> > >> and
> > >> > pass it to the DisplayTag Table, from then on it's just using the
> > >> > capabilities of DisplayTag to put the data where you want it.  The
> one
> > >> > caveat is that we've had to set the requestURI attribute to make
> sure
> > >> that
> > >> > the prev/next links go to the right place and I added the
> > excludeParams
> > >> > parameter below to the params interceptor so that you don't get the
> > ugly
> > >> > warnings from struts.
> > >> >
> > >> >        <interceptor-ref name="params">
> > >> >          <param name="excludeParams">d-\d*-[a-z]</param>
> > >> >        </interceptor-ref>
> > >> >
> > >> > (*Chris*)
> > >> >
> > >> > On Wed, Jan 6, 2010 at 4:12 PM, Frans Thamura <fr...@meruvian.org>
> > >> wrote:
> > >> >
> > >> >> can share how the struts2 work with display tag
> > >> >>
> > >> >>
> > >> >> sorry never use this also, how the display tag work with List when
> we
> > >> >> submit the grid
> > >> >>
> > >> >> F
> > >> >>
> > >> >>
> > >> >>
> > >> >>
> > >> >> On Thu, Jan 7, 2010 at 7:00 AM, Chris Pratt <
> thechrispratt@gmail.com
> > >
> > >> >> wrote:
> > >> >> > We use DisplayTag (http://www.displaytag.org), it works pretty
> > well.
> > >> >> >  (*Chris*)
> > >> >> >
> > >> >> > On Wed, Jan 6, 2010 at 3:28 PM, Sergio
> > >> >> > <ki...@hotmail.com>wrote:
> > >> >> >
> > >> >> >> Hi, people, how can i show a table into a jsp from the struts
> > >> action?
> > >> >> Are
> > >> >> >> there a simple method for doing that? I've tried with java
> > >> collections
> > >> >> into
> > >> >> >> the action and "property" tag into the jsp with no success.
> > >> >> >>
> > >> >> >> thanks in advance
> > >> >> >>
> > >> >> >> --
> > >> >> >> Sergio
> > >> >> >>
> > >> >> >>
> > >> >> >>
> > >> ---------------------------------------------------------------------
> > >> >> >> 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
> > >> >>
> > >> >>
> > >> >
> > >>
> > >> ---------------------------------------------------------------------
> > >> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > >> For additional commands, e-mail: user-help@struts.apache.org
> > >>
> > >>
> > >
> >
>



-- 
Saeed Iqbal
Independant Consultant
J2EE - Application Architect / Developer

Re: struts2 and tables

Posted by Arpan <ar...@gmail.com>.
My scenario is that I need a column only for checkboxes. In the title there
will be a checkbox and a link "Delete". How can I show these using display
tag.
When the user will select the top checkbox, all other checkboxes in that
column should be selected or unselected accordingly.


On Thu, Jan 7, 2010 at 6:35 AM, Chris Pratt <th...@gmail.com> wrote:

> Maybe this will clear things up.  This is a working example from our site:
>
>  <s:url action="reset-password-csr" id="reset" escapeAmp="false"/>
>  <display:table uid="user" name="${users.list}" pagesize="20"
> requestURI="csr-search-results.html" class="tableWithHeaderBG"
> cellpadding="0" cellspacing="0" summary="This table lists Users
> resulting from a previous search" export="false">
>    <display:setProperty name="basic.msg.empty_list">No Users
> Found</display:setProperty>
>    <display:column title="Last Name" property="name.lastname"
> class="tdLeft" scope="row"/>
>    <display:column title="First Name" property="name.firstname"
> class="tdLeftNoPad"/>
>    <display:column title="User ID" property="userid" paramId="userid"
> value="%{'userid'}" paramProperty="userid" class="tdLeft"
> scope="row"/>
>    <display:column title="Email" property="email" paramId="email"
> paramProperty="email" class="tdLeftNoPad"/>
>    <display:column title="Security Question"
> property="securityChallenge" class="tdLeftNoPad"/>
>    <display:column title="Security Answer"
> property="securityResponse" class="tdLeftNoPad"/>
>    <display:column title="&nbsp;" href="${reset}" paramId="userid"
> paramProperty="userid" class="tdLeftNoPad">Reset
> Password</display:column>
>  </display:table>
>
>   (*Chris*)
>
>
> On Wed, Jan 6, 2010 at 5:00 PM, Chris Pratt <th...@gmail.com>
> wrote:
>
> > In your action, add a getList() method that returns the list generated by
> > the action, then just pass name="${list}" to the display:table tag.  Or,
> you
> > could create the list and put it in the request or session scope and it
> > would work exactly the same.
> >
> > The trick with the interceptor is just to get it to ignore the special
> > tracking parameters that DisplayTag uses in the prev/next links.
> >
> >   (*Chris*)
> >
> >
> > On Wed, Jan 6, 2010 at 4:28 PM, Frans Thamura <fr...@meruvian.org>
> wrote:
> >
> >> wah can share how the interceptor work with display tag
> >>
> >> sorry if this is silly question, but honestly i still need the glue
> >>
> >> usually i create a private xxx List, and will be passed to the list
> >>
> >> how integrate the list $xxx with the display tag?
> >>
> >> thx
> >>
> >>
> >> On Thu, Jan 7, 2010 at 7:25 AM, Chris Pratt <th...@gmail.com>
> >> wrote:
> >> > It's just a standard JSP Tag Library.  Because Struts 2 has the
> Request
> >> > Wrapper, you can use standard JSTL EL to get the list from your action
> >> and
> >> > pass it to the DisplayTag Table, from then on it's just using the
> >> > capabilities of DisplayTag to put the data where you want it.  The one
> >> > caveat is that we've had to set the requestURI attribute to make sure
> >> that
> >> > the prev/next links go to the right place and I added the
> excludeParams
> >> > parameter below to the params interceptor so that you don't get the
> ugly
> >> > warnings from struts.
> >> >
> >> >        <interceptor-ref name="params">
> >> >          <param name="excludeParams">d-\d*-[a-z]</param>
> >> >        </interceptor-ref>
> >> >
> >> > (*Chris*)
> >> >
> >> > On Wed, Jan 6, 2010 at 4:12 PM, Frans Thamura <fr...@meruvian.org>
> >> wrote:
> >> >
> >> >> can share how the struts2 work with display tag
> >> >>
> >> >>
> >> >> sorry never use this also, how the display tag work with List when we
> >> >> submit the grid
> >> >>
> >> >> F
> >> >>
> >> >>
> >> >>
> >> >>
> >> >> On Thu, Jan 7, 2010 at 7:00 AM, Chris Pratt <thechrispratt@gmail.com
> >
> >> >> wrote:
> >> >> > We use DisplayTag (http://www.displaytag.org), it works pretty
> well.
> >> >> >  (*Chris*)
> >> >> >
> >> >> > On Wed, Jan 6, 2010 at 3:28 PM, Sergio
> >> >> > <ki...@hotmail.com>wrote:
> >> >> >
> >> >> >> Hi, people, how can i show a table into a jsp from the struts
> >> action?
> >> >> Are
> >> >> >> there a simple method for doing that? I've tried with java
> >> collections
> >> >> into
> >> >> >> the action and "property" tag into the jsp with no success.
> >> >> >>
> >> >> >> thanks in advance
> >> >> >>
> >> >> >> --
> >> >> >> Sergio
> >> >> >>
> >> >> >>
> >> >> >>
> >> ---------------------------------------------------------------------
> >> >> >> 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
> >> >>
> >> >>
> >> >
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> >> For additional commands, e-mail: user-help@struts.apache.org
> >>
> >>
> >
>

Re: struts2 and tables

Posted by Chris Pratt <th...@gmail.com>.
Maybe this will clear things up.  This is a working example from our site:

  <s:url action="reset-password-csr" id="reset" escapeAmp="false"/>
  <display:table uid="user" name="${users.list}" pagesize="20"
requestURI="csr-search-results.html" class="tableWithHeaderBG"
cellpadding="0" cellspacing="0" summary="This table lists Users
resulting from a previous search" export="false">
    <display:setProperty name="basic.msg.empty_list">No Users
Found</display:setProperty>
    <display:column title="Last Name" property="name.lastname"
class="tdLeft" scope="row"/>
    <display:column title="First Name" property="name.firstname"
class="tdLeftNoPad"/>
    <display:column title="User ID" property="userid" paramId="userid"
value="%{'userid'}" paramProperty="userid" class="tdLeft"
scope="row"/>
    <display:column title="Email" property="email" paramId="email"
paramProperty="email" class="tdLeftNoPad"/>
    <display:column title="Security Question"
property="securityChallenge" class="tdLeftNoPad"/>
    <display:column title="Security Answer"
property="securityResponse" class="tdLeftNoPad"/>
    <display:column title="&nbsp;" href="${reset}" paramId="userid"
paramProperty="userid" class="tdLeftNoPad">Reset
Password</display:column>
  </display:table>

   (*Chris*)


On Wed, Jan 6, 2010 at 5:00 PM, Chris Pratt <th...@gmail.com> wrote:

> In your action, add a getList() method that returns the list generated by
> the action, then just pass name="${list}" to the display:table tag.  Or, you
> could create the list and put it in the request or session scope and it
> would work exactly the same.
>
> The trick with the interceptor is just to get it to ignore the special
> tracking parameters that DisplayTag uses in the prev/next links.
>
>   (*Chris*)
>
>
> On Wed, Jan 6, 2010 at 4:28 PM, Frans Thamura <fr...@meruvian.org> wrote:
>
>> wah can share how the interceptor work with display tag
>>
>> sorry if this is silly question, but honestly i still need the glue
>>
>> usually i create a private xxx List, and will be passed to the list
>>
>> how integrate the list $xxx with the display tag?
>>
>> thx
>>
>>
>> On Thu, Jan 7, 2010 at 7:25 AM, Chris Pratt <th...@gmail.com>
>> wrote:
>> > It's just a standard JSP Tag Library.  Because Struts 2 has the Request
>> > Wrapper, you can use standard JSTL EL to get the list from your action
>> and
>> > pass it to the DisplayTag Table, from then on it's just using the
>> > capabilities of DisplayTag to put the data where you want it.  The one
>> > caveat is that we've had to set the requestURI attribute to make sure
>> that
>> > the prev/next links go to the right place and I added the excludeParams
>> > parameter below to the params interceptor so that you don't get the ugly
>> > warnings from struts.
>> >
>> >        <interceptor-ref name="params">
>> >          <param name="excludeParams">d-\d*-[a-z]</param>
>> >        </interceptor-ref>
>> >
>> > (*Chris*)
>> >
>> > On Wed, Jan 6, 2010 at 4:12 PM, Frans Thamura <fr...@meruvian.org>
>> wrote:
>> >
>> >> can share how the struts2 work with display tag
>> >>
>> >>
>> >> sorry never use this also, how the display tag work with List when we
>> >> submit the grid
>> >>
>> >> F
>> >>
>> >>
>> >>
>> >>
>> >> On Thu, Jan 7, 2010 at 7:00 AM, Chris Pratt <th...@gmail.com>
>> >> wrote:
>> >> > We use DisplayTag (http://www.displaytag.org), it works pretty well.
>> >> >  (*Chris*)
>> >> >
>> >> > On Wed, Jan 6, 2010 at 3:28 PM, Sergio
>> >> > <ki...@hotmail.com>wrote:
>> >> >
>> >> >> Hi, people, how can i show a table into a jsp from the struts
>> action?
>> >> Are
>> >> >> there a simple method for doing that? I've tried with java
>> collections
>> >> into
>> >> >> the action and "property" tag into the jsp with no success.
>> >> >>
>> >> >> thanks in advance
>> >> >>
>> >> >> --
>> >> >> Sergio
>> >> >>
>> >> >>
>> >> >>
>> ---------------------------------------------------------------------
>> >> >> 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
>> >>
>> >>
>> >
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
>

Re: struts2 and tables

Posted by Chris Pratt <th...@gmail.com>.
In your action, add a getList() method that returns the list generated by
the action, then just pass name="${list}" to the display:table tag.  Or, you
could create the list and put it in the request or session scope and it
would work exactly the same.

The trick with the interceptor is just to get it to ignore the special
tracking parameters that DisplayTag uses in the prev/next links.

  (*Chris*)

On Wed, Jan 6, 2010 at 4:28 PM, Frans Thamura <fr...@meruvian.org> wrote:

> wah can share how the interceptor work with display tag
>
> sorry if this is silly question, but honestly i still need the glue
>
> usually i create a private xxx List, and will be passed to the list
>
> how integrate the list $xxx with the display tag?
>
> thx
>
>
> On Thu, Jan 7, 2010 at 7:25 AM, Chris Pratt <th...@gmail.com>
> wrote:
> > It's just a standard JSP Tag Library.  Because Struts 2 has the Request
> > Wrapper, you can use standard JSTL EL to get the list from your action
> and
> > pass it to the DisplayTag Table, from then on it's just using the
> > capabilities of DisplayTag to put the data where you want it.  The one
> > caveat is that we've had to set the requestURI attribute to make sure
> that
> > the prev/next links go to the right place and I added the excludeParams
> > parameter below to the params interceptor so that you don't get the ugly
> > warnings from struts.
> >
> >        <interceptor-ref name="params">
> >          <param name="excludeParams">d-\d*-[a-z]</param>
> >        </interceptor-ref>
> >
> > (*Chris*)
> >
> > On Wed, Jan 6, 2010 at 4:12 PM, Frans Thamura <fr...@meruvian.org>
> wrote:
> >
> >> can share how the struts2 work with display tag
> >>
> >>
> >> sorry never use this also, how the display tag work with List when we
> >> submit the grid
> >>
> >> F
> >>
> >>
> >>
> >>
> >> On Thu, Jan 7, 2010 at 7:00 AM, Chris Pratt <th...@gmail.com>
> >> wrote:
> >> > We use DisplayTag (http://www.displaytag.org), it works pretty well.
> >> >  (*Chris*)
> >> >
> >> > On Wed, Jan 6, 2010 at 3:28 PM, Sergio
> >> > <ki...@hotmail.com>wrote:
> >> >
> >> >> Hi, people, how can i show a table into a jsp from the struts action?
> >> Are
> >> >> there a simple method for doing that? I've tried with java
> collections
> >> into
> >> >> the action and "property" tag into the jsp with no success.
> >> >>
> >> >> thanks in advance
> >> >>
> >> >> --
> >> >> Sergio
> >> >>
> >> >>
> >> >> ---------------------------------------------------------------------
> >> >> 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
> >>
> >>
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

Re: struts2 and tables

Posted by Frans Thamura <fr...@meruvian.org>.
wah can share how the interceptor work with display tag

sorry if this is silly question, but honestly i still need the glue

usually i create a private xxx List, and will be passed to the list

how integrate the list $xxx with the display tag?

thx


On Thu, Jan 7, 2010 at 7:25 AM, Chris Pratt <th...@gmail.com> wrote:
> It's just a standard JSP Tag Library.  Because Struts 2 has the Request
> Wrapper, you can use standard JSTL EL to get the list from your action and
> pass it to the DisplayTag Table, from then on it's just using the
> capabilities of DisplayTag to put the data where you want it.  The one
> caveat is that we've had to set the requestURI attribute to make sure that
> the prev/next links go to the right place and I added the excludeParams
> parameter below to the params interceptor so that you don't get the ugly
> warnings from struts.
>
>        <interceptor-ref name="params">
>          <param name="excludeParams">d-\d*-[a-z]</param>
>        </interceptor-ref>
>
> (*Chris*)
>
> On Wed, Jan 6, 2010 at 4:12 PM, Frans Thamura <fr...@meruvian.org> wrote:
>
>> can share how the struts2 work with display tag
>>
>>
>> sorry never use this also, how the display tag work with List when we
>> submit the grid
>>
>> F
>>
>>
>>
>>
>> On Thu, Jan 7, 2010 at 7:00 AM, Chris Pratt <th...@gmail.com>
>> wrote:
>> > We use DisplayTag (http://www.displaytag.org), it works pretty well.
>> >  (*Chris*)
>> >
>> > On Wed, Jan 6, 2010 at 3:28 PM, Sergio
>> > <ki...@hotmail.com>wrote:
>> >
>> >> Hi, people, how can i show a table into a jsp from the struts action?
>> Are
>> >> there a simple method for doing that? I've tried with java collections
>> into
>> >> the action and "property" tag into the jsp with no success.
>> >>
>> >> thanks in advance
>> >>
>> >> --
>> >> Sergio
>> >>
>> >>
>> >> ---------------------------------------------------------------------
>> >> 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
>>
>>
>

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


Re: struts2 and tables

Posted by Chris Pratt <th...@gmail.com>.
It's just a standard JSP Tag Library.  Because Struts 2 has the Request
Wrapper, you can use standard JSTL EL to get the list from your action and
pass it to the DisplayTag Table, from then on it's just using the
capabilities of DisplayTag to put the data where you want it.  The one
caveat is that we've had to set the requestURI attribute to make sure that
the prev/next links go to the right place and I added the excludeParams
parameter below to the params interceptor so that you don't get the ugly
warnings from struts.

        <interceptor-ref name="params">
          <param name="excludeParams">d-\d*-[a-z]</param>
        </interceptor-ref>

(*Chris*)

On Wed, Jan 6, 2010 at 4:12 PM, Frans Thamura <fr...@meruvian.org> wrote:

> can share how the struts2 work with display tag
>
>
> sorry never use this also, how the display tag work with List when we
> submit the grid
>
> F
>
>
>
>
> On Thu, Jan 7, 2010 at 7:00 AM, Chris Pratt <th...@gmail.com>
> wrote:
> > We use DisplayTag (http://www.displaytag.org), it works pretty well.
> >  (*Chris*)
> >
> > On Wed, Jan 6, 2010 at 3:28 PM, Sergio
> > <ki...@hotmail.com>wrote:
> >
> >> Hi, people, how can i show a table into a jsp from the struts action?
> Are
> >> there a simple method for doing that? I've tried with java collections
> into
> >> the action and "property" tag into the jsp with no success.
> >>
> >> thanks in advance
> >>
> >> --
> >> Sergio
> >>
> >>
> >> ---------------------------------------------------------------------
> >> 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: struts2 and tables

Posted by Frans Thamura <fr...@meruvian.org>.
can share how the struts2 work with display tag


sorry never use this also, how the display tag work with List when we
submit the grid

F




On Thu, Jan 7, 2010 at 7:00 AM, Chris Pratt <th...@gmail.com> wrote:
> We use DisplayTag (http://www.displaytag.org), it works pretty well.
>  (*Chris*)
>
> On Wed, Jan 6, 2010 at 3:28 PM, Sergio
> <ki...@hotmail.com>wrote:
>
>> Hi, people, how can i show a table into a jsp from the struts action? Are
>> there a simple method for doing that? I've tried with java collections into
>> the action and "property" tag into the jsp with no success.
>>
>> thanks in advance
>>
>> --
>> Sergio
>>
>>
>> ---------------------------------------------------------------------
>> 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: struts2 and tables

Posted by Chris Pratt <th...@gmail.com>.
We use DisplayTag (http://www.displaytag.org), it works pretty well.
  (*Chris*)

On Wed, Jan 6, 2010 at 3:28 PM, Sergio
<ki...@hotmail.com>wrote:

> Hi, people, how can i show a table into a jsp from the struts action? Are
> there a simple method for doing that? I've tried with java collections into
> the action and "property" tag into the jsp with no success.
>
> thanks in advance
>
> --
> Sergio
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>