I'm having a problem with a Border containing an embedded ListView.  I've
looked at the previous posts re. borders & markup inheritance etc, but my
case is slightly different - setTransparentResolver() is not going to get me
out of trouble.

I want to define a border intended to render a table containing a standard
header & footer (I may have more than 1 table on a page, so markup
inheritance is not applicable).  The content of the table will be rendered
using a standard ListView component.

My border markup looks something like:
-----------------------------------------------------------------------------------------------------------------------------
<wicket:border>
        <table>
            <tr><th wicket:id="headerId">Header Content Here</th></tr>
                    
            <tr wicket:id="listViewId"><wicket:body/></tr>
            
            <tr><td wicket:id="footerId">Footer Content Here</td></tr>
        </table>
  </wicket:border>
-----------------------------------------------------------------------------------------------------------------------------

Note that the body will be rendered inside another component tag
("listViewId") - this is the crucial point.  My page markup looks something
like:
-----------------------------------------------------------------------------------------------------------------------------

        <td>Property 1 Here</td>
        <td>Property 2 Here</td>
        <td> # Link Here </td>

-----------------------------------------------------------------------------------------------------------------------------

When I try to render my page, Wicket throws the standard "Unable to find
component" MarkupException, complaining that it can't find component
"linkId" in component "borderId".  Which makes sense, as (in my java code)
component "linkId" is a child of "listViewId" which is itself a child of
"borderId".

I naively expected Wicket to substitute the border markup into the page
markup before trying to resolve the components.  That is, I expected Wicket
to consider the page markup as looking like:
-----------------------------------------------------------------------------------------------------------------------------

        <table>
            <tr>
                <th wicket:id="headerId">Header Content Here</th>
            </tr>
                    
            <tr wicket:id="listViewId">
                <td>Property 1 Here</td>
                <td>Property 2 Here</td>
                <td> # Link Here </td>
            </tr>
            
            <tr>
                <td wicket:id="footerId">Footer Content Here</td>
            </tr>
        </table>

-----------------------------------------------------------------------------------------------------------------------------
In which case the markup would match my java component hierarchy.  But the
standard Wicket exception page contains the page markup without the border
markup, and complains that it cannot find "linkId" within "borderId".

Should I simply avoid embedding component tags inside my border (i.e. avoid
putting the "listViewId" tag inside the border)?  I liked this approach
because it saved me repeating the tag in every page which wants to use the
border.  Is there some way to get wicket to handle this kind of component
hierarchy (maybe not involving borders)?
-- 
View this message in context: 
http://www.nabble.com/Borders-Containing-Embedded-Components-tf3776704.html#a10679274
Sent from the Wicket - User mailing list archive at Nabble.com.


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to