I have to write a table that updates via AJAX on a timer that polls data from
the server (the data comes as collection, not as a database call).  

My first question is what class I need to use; I've looked at a few of the
available classes and I think the AjaxFallbackDefaultDataTable is too
heavyweight because I don't need to sort or page.  I need to use my own CSS
and I also need to set the background colors of cells dependent upon the
values in the model.  It looks like a DataView would be adequate with a
provider that wraps a LoadableDetachableModel if I hook it up to a timer and
set the output markup ID to true.  

So if I'm using a DataView, I get stumped at a point that should be easy. 
All the examples let you instantiate a DataView but I'm using Wicket 1.4-m3
and DataView is abstract, so I'd have to subclass it and provide my own
HTML.  Fine, but I can't figure out how to plug the table into its parent
panel.

So if I have in the enclosing panel:

<html>
<body>
  <wicket:panel>
      ...
      <table wicket:id="storageUnits" class="fullTabWidth"
cellspacing="0"></table>      
  </wicket:panel>
</body>
</html>

and I've called my DataView subclass StorageUnitAJAXDataView, then in my
enclosing panel, the code:

        StorageUnitAJAXDataView dataView = new StorageUnitAJAXDataView(
"storageUnits", new StorageServerUnitsDataProvider( m_strClientRole,
m_strPlatformId ) );

isn't going to work.  According to the sample, I need to make the ID the ID
of the repeating rows.  My HTML for the DataView looks like this:

<html>
<body>
  <wicket:extend>
     <table class="fullTabWidth" cellspacing="0">
        <thead class="tableGridheader">
          <tr>
            <th></th>
            <th></th>
            <th></th>
            <th></th>
            <th></th>
            <th></th>
          </tr>
        </thead>
        <tbody class="tableGrid">
          <tr wicket:id="storageUnitStatus">
            <td></td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>          
          </tr>
        </tbody>
      </table>      
  </wicket:extend>
</body>
</html>

So the real question is, since I have to subclass and have a separate HTML
file for the DataView, how do I get the right ID in there?  What should the
HTML look like?

-- 
View this message in context: 
http://www.nabble.com/Ajax-table-grid-questions-tp22379387p22379387.html
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

Reply via email to