Update of /cvsroot/displaytag/display09/examples/web/jsp
In directory sc8-pr-cvs1:/tmp/cvs-serv18533/examples/web/jsp

Modified Files:
        example-columns.jsp example-imp-objects.jsp example-paging.jsp 
        example-sorting.jsp example-styles.jsp 
Log Message:
improved documention related to changes/new features

Index: example-columns.jsp
===================================================================
RCS file: /cvsroot/displaytag/display09/examples/web/jsp/example-columns.jsp,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** example-columns.jsp 16 Jun 2003 18:30:23 -0000      1.2
--- example-columns.jsp 17 Jun 2003 20:52:07 -0000      1.3
***************
*** 27,36 ****
  </p>
  
  <p>
!       The column property specifies what <code>getXXX</code> method is called on 
each item
!       in the list.  So for the second column, <code>getName</code> is called, and by
!       default the property name is used as the header of the column (unless you give
!       it an explicit column name).
  </p>
  
  
--- 27,56 ----
  </p>
  
+ <p class="changed">
+       You can define the content of a column adding a <code>property</code> attribute
+       to the column tag or adding a content to the tag.
+ </p>
+ 
+ <ul>
+       <li>&lt;display:column property="email" /&gt;</li>
+       <li>&lt;display:column title="email"&gt;[EMAIL 
PROTECTED]&lt;/display:column&gt;</li>
+ </ul>
+ 
+ <p class="changed">
+       These are two way to define the content of a column. Of course in the tag body
+       you can use scriptlets or other custom tags.
+       Using the <code>property</code> attribute to define the content of a column is
+       usually faster and works better with sorting. If you add a 
<code>property</code>
+       attribute the tag body is ignored.
+ </p>
+ 
  <p>
!       The <code>property</code> attribute specifies what <code>getXXX</code> method 
is 
!       called on each item in the list.  
!       So for the second column, <code>getName</code> is called, and by default the 
!       property name is used as the header of the column (unless you give it an 
explicit
!       column name).
  </p>
+ 
  
  

Index: example-imp-objects.jsp
===================================================================
RCS file: /cvsroot/displaytag/display09/examples/web/jsp/example-imp-objects.jsp,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** example-imp-objects.jsp     16 Jun 2003 18:30:23 -0000      1.2
--- example-imp-objects.jsp     17 Jun 2003 20:52:07 -0000      1.3
***************
*** 10,66 ****
      <display:column property="id" title="ID" />
      <display:column property="name" />
!     <display:column property="email" />
!     <display:column property="status" styleClass="tableCellError"/>
!     <display:column property="description" title="Comments"/>
!     <display:column title="extra">static</display:column>
!     <display:column title="row number"><%=testit_rowNum%></display:column>
      <display:column 
title="((ListObject)testit).getMoney()"><%=((ListObject)testit).getMoney()%></display:column>
  </display:table>
  
! <p>
!       I include this page, as it is a reasonable assumption/resquest that this tag
!       would work like other iterating tags, and perhaps make the object corresponding
!       to the given row available as some type of implicit object that you could use
!       inside scriptlet code (or some other tag) for you to access while the list you
!       provided is being looped over.
! </p>
! 
! <p>
!       I tried designing this as an iterating tag that would expose the underlying
!       object each time through the loop, etc...  But I ran into many problems, and
!       ultimatly decided that using "<a href="example-decorator.jsp">decorators</a>"
!       provided the same type of functionality and was cleaner as it helped keep code
!       out of the JSP pages.
  </p>
  
! <p>
!       So if you have come to this page, thinking I wish I had access to the objects
!       as they were being processed in the loop in my JSP page, well I'm not going to
!       provide that - but look at the following three pages and I'll bet one of them
!       will have a solution to your problem.
  </p>
  
- <ul>
-       <li><a href="example-decorator.jsp">Standard, using decorators to 
transform/process data</a>
-       <li><a href="example-decorator-link.jsp">Standard, using decorators to create 
dynamic links</a>
-       <li><a href="example-callbacks.jsp">Wow, using callbacks to show totals</a>
- </ul>
- 
  <p>
! Rather then implementing this tag as an iterating tag, it's implemented as
! follows: The various column tags register themselves with the parent table tag
! just once, and when we hit the closing table tag, we use the configuration data
! provided in the table attributes, and the column tags to blast through the list
! of objects and draw the table all at once.  We do <strong>not</strong> loop over the
! column tags and call them over and over, and thus we can't really provide any
! implicit objects that would be useful to you in the JSP page...  Doing that
! caused the following problems:
  </p>
  
  <ul>
!       <li>broke sorting, as we need to do some processing of the entire list up 
front.</li>
!       <li>made dealing with exceptional cases difficult (no values, null values)</li>
!       <li>made performance horrible (3-5 times slower, then just creating the buffer 
in the end tag).</li>
!       <li>probably others, I moved away from this approach pretty early on.</li>
  </ul>
  
--- 10,39 ----
      <display:column property="id" title="ID" />
      <display:column property="name" />
!     <display:column title="static value">static</display:column>
!     <display:column title="row number 
(testit_rowNum)"><%=testit_rowNum%></display:column>
      <display:column 
title="((ListObject)testit).getMoney()"><%=((ListObject)testit).getMoney()%></display:column>
  </display:table>
  
! <p class="changed">
!       If you add and <code>id</code> attribute the table tag makes the object 
corresponding
!       to the given row available in the page context so you could use it inside 
scriptlet code
!       or some other tag. Another implicit object exposed by the table tag is the row 
number,
!       named <code><em>id</em>_rowNum</code>.
  </p>
  
! <p class="changed">
!       If you do not specify the <code>id</code> attribute no object is added to the 
pagecontext
!       by the table tag
  </p>
  
  <p>
!       You can also use "<a href="example-decorator.jsp">decorators</a>" to provide 
the same type
!       of functionality.
  </p>
  
  <ul>
!       <li><a href="example-decorator.jsp">Standard, using decorators to 
transform/process data</a></li>
!       <li><a href="example-decorator-link.jsp">Standard, using decorators to create 
dynamic links</a></li>
!       <li><a href="example-callbacks.jsp">Wow, using callbacks to show 
totals</a></li>
  </ul>
  

Index: example-paging.jsp
===================================================================
RCS file: /cvsroot/displaytag/display09/examples/web/jsp/example-paging.jsp,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** example-paging.jsp  16 Jun 2003 18:30:23 -0000      1.2
--- example-paging.jsp  17 Jun 2003 20:52:07 -0000      1.3
***************
*** 54,58 ****
        a correct answer in environment where you are forwarding a request around 
before
        arriving at the JSP that is to be displayed (like struts).  In those cases, you
!       need to tell the table tag what it's URL is via the "requestURI" attribute.<p>
  </p>
  
--- 54,62 ----
        a correct answer in environment where you are forwarding a request around 
before
        arriving at the JSP that is to be displayed (like struts).  In those cases, you
!       need to tell the table tag what it's URL is via the "requestURI" attribute.
! </p>
! 
! <p class="changed">
!       All the parameters received in the first request are preserved in paging.
  </p>
  

Index: example-sorting.jsp
===================================================================
RCS file: /cvsroot/displaytag/display09/examples/web/jsp/example-sorting.jsp,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** example-sorting.jsp 16 Jun 2003 18:30:23 -0000      1.2
--- example-sorting.jsp 17 Jun 2003 20:52:07 -0000      1.3
***************
*** 12,19 ****
  
  <display:table name="sessionScope.stest">
!   <display:column property="id" title="ID" sort="true" headerClass="sortable" />
!   <display:column property="name" sort="true" headerClass="sortable"/>
    <display:column property="email" />
!   <display:column property="status" sort="true" headerClass="sortable"/>
  </display:table>
  
--- 12,19 ----
  
  <display:table name="sessionScope.stest">
!   <display:column property="id" title="ID" sortable="true" headerClass="sortable" />
!   <display:column property="name" sortable="true" headerClass="sortable"/>
    <display:column property="email" />
!   <display:column property="status" sortable="true" headerClass="sortable"/>
  </display:table>
  
***************
*** 23,30 ****
        returned from your property implements the Comparable interface (if it doesn't
        nativly - use the decorator pattern as shown a couple of examples ago), and
!       then set the attribute <code>sort="true"</code> on the columns that you want
        to be able to sort by.
  </p>
  
  <p>
        When the user clicks on the column title the rows
--- 23,35 ----
        returned from your property implements the Comparable interface (if it doesn't
        nativly - use the decorator pattern as shown a couple of examples ago), and
!       then set the attribute <code>sortable="true"</code> on the columns that you 
want
        to be able to sort by.
  </p>
  
+ <p class="changed">
+       Note the <code>sortable</code> attribute was previously named 
<code>sort</code>.
+       The sort attribute is still supported for compatibility with previous versions.
+ </p>
+ 
  <p>
        When the user clicks on the column title the rows
***************
*** 45,48 ****
--- 50,57 ----
        When doing sorts, we copy the list into our own internally managed list, so
        that we don't change the ordering of the original list.
+ </p>
+ 
+ <p class="changed">
+       All the parameters received in the first request are preserved in sorting.
  </p>
  

Index: example-styles.jsp
===================================================================
RCS file: /cvsroot/displaytag/display09/examples/web/jsp/example-styles.jsp,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** example-styles.jsp  16 Jun 2003 18:30:23 -0000      1.2
--- example-styles.jsp  17 Jun 2003 20:52:07 -0000      1.3
***************
*** 140,144 ****
  
  <p class="changed">
!       These css classes were applied in previous version of the &lt;display:*&lt; 
tag library. See the "now use"
        column for direction on how migrate your css to the new version (a quick task 
wich will also improve the
        quality -and lower the weight- of your html output)
--- 140,144 ----
  
  <p class="changed">
!       These css classes were applied in previous version of the &lt;display:*&gt; 
tag library. See the "now use"
        column for direction on how migrate your css to the new version (a quick task 
wich will also improve the
        quality -and lower the weight- of your html output)
***************
*** 157,161 ****
                        <td>table</td>
                        <td>assigned to the main table tag</td>
!                       <td>on class is assigned by default. You can add your own 
adding a "class" attrbute to the &lt;display:table&gt; tag</td>
                </tr>
                <tr>
--- 157,161 ----
                        <td>table</td>
                        <td>assigned to the main table tag</td>
!                       <td>on class is assigned by default. You can add your own 
adding a "class" attribute to the &lt;display:table&gt; tag</td>
                </tr>
                <tr>




-------------------------------------------------------
This SF.Net email is sponsored by: INetU
Attention Web Developers & Consultants: Become An INetU Hosting Partner.
Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission!
INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php
_______________________________________________
displaytag-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/displaytag-devel

Reply via email to