struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Heligon Sandra <sandra.heli...@nextream.fr>
Subject RE: How to let a user click a column header to sort data in a t ab le u sing struts?
Date Thu, 16 Jan 2003 08:32:28 GMT
I did what you said but that still does not go, here the code of my page
JSP.
I would have forgotten something? 

<%@ taglib uri="/WEB-INF/tld/struts-logic.tld" prefix="logic" %>
<script src="sortTable.js"></script>

<html:form action="/myLookupDispatchAction.do" method="GET">
<%-- Add a vertical scroll bar to the list --%>
<div style="overflow: auto; width: 597px; height: 100; padding:0px;
margin:0px">

<%-- List of ATM calls --%>
<table id="table0" width="100%" border="1" cellpadding="0" cellspacing="0"
bordercolor="#FFFFFF">

<%-- Title for the columns of the table --%>
<tr bgcolor="#FFCC00">
    <th align=left width="13%"><bean:message key="lable.id"/></th>
    <th align=left width="5%"><bean:message key="label.name"/></th>
    <th align=left width="9%"><bean:message key="label.type"/></th>
</tr>

<logic:iterate id="elements" name="list" type="com.MyAppli" offset="offset"
length="length">
<tr bgcolor="#EBEBEB">
    <td bgcolor="#EBEBEB" width="13%"> 
    <bean:write name="elements" property="id"/>
    </td>

    <td bgcolor="#EBEBEB" width="5%"> 
    <bean:write name="elements" property="name"/>
    </td>

    <td bgcolor="#EBEBEB" width="10%">
    <html:checkbox name="elements" property="type" value="on"/>
    </td>
</tr>
</logic:iterate>
</table>
<script>initTable("table0");</script>
</div>

</html:form>

I placed the file sortTable.js in the directory where I placed the JSP file.
How can I be certain that script is called? 

Thanks a lot in advance

-----Original Message-----
From: Thomas CORNET [mailto:thomas@cornet.name]
Sent: 15 January 2003 22:31
To: Struts Users Mailing List
Subject: RE: How to let a user click a column header to sort data in a t
ab le u sing struts?




    To resolve your problem, here is what you can do : write

         <script>initTable("table0");</script>

   after the tag "</table>" of your table. The script only needs the 
contents of the table to be loaded. Putting the code on the onLoad event of 
the body make sure the script is executed after the whole page has been 
loaded, but putting this line of code instead, at the bottom of the page, 
works fine, I've just tested it.

            Thomas

At 18:24 15/01/2003, you wrote:
>That seems indeed very simple but I will know if somebody uses it with the
>Tiles components.
>Because with these components we do not write "with the hand" JSP  pages
and
>more particularly the tag < body > attached to each page. The page is build
>with the content of the file tiles-def.xml.
>Moreover I do not understand exactly how does this work.
>And thus I do not see how to indicate the command
>onLoad='initTable("table0");' for init the table to sorting.
>This table can vary from one page to another, is it systematically
necessary
>to put the same id?
>where do I have to put the JS command onLoad within a Tiles application?
>
>Thanks in advance.
>
>-----Original Message-----
>From: Jacob Hookom [mailto:hookomjj@uwec.edu]
>Sent: 15 January 2003 15:09
>To: 'Struts Users Mailing List'
>Subject: RE: How to let a user click a column header to sort data in a
>tab le u sing struts?
>
>
>BOMBZ!! That's really cool.  It works in Mozilla too FYI.
>
>-Jacob
>
>| -----Original Message-----
>| From: Thomas CORNET [mailto:thomas@cornet.name]
>| Sent: Wednesday, January 15, 2003 7:55 AM
>| To: Struts Users Mailing List
>| Subject: Re: How to let a user click a column header to sort data in a
>tab
>| le u sing struts?
>|
>|
>| Isn't it ? This is a friend of mine who has coded it, and it's working
>| well. Check out the attachement.
>|
>| Thomas
>|
>| At 14:40 15/01/2003 +0100, you wrote:
>| >2003. január 15. 14:39 dátummal Thomas CORNET ezt írtad:
>| > > Hello
>| > >
>| > > Do you need this sequence to be full JSP ?? Because JavaScript
>| librairies
>| > > exist to let you directly sort tables. Thus, no page reload is
>needed.
>| >
>| >Sounds interesting! Is it running on the popular browsers? Where can
>I
>| get
>| >this?
>| >
>| >Tib
>| >
>| >--
>| >To unsubscribe, e-mail:   <mailto:struts-user-
>| unsubscribe@jakarta.apache.org>
>| >For additional commands, e-mail: <mailto:struts-user-
>| help@jakarta.apache.org>
>
>
>
>--
>To unsubscribe, e-mail:
><mailto:struts-user-unsubscribe@jakarta.apache.org>
>For additional commands, e-mail:
><mailto:struts-user-help@jakarta.apache.org>
>
>--
>To unsubscribe, e-mail:
<mailto:struts-user-unsubscribe@jakarta.apache.org>
>For additional commands, e-mail:
<mailto:struts-user-help@jakarta.apache.org>



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

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


Mime
View raw message