From: <jt...@hy...> - 2008-05-09 15:16:07
|
Author: jtravis Date: 2008-05-09 08:15:36 -0700 (Fri, 09 May 2008) New Revision: 9427 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=9427 Modified: trunk/src/org/hyperic/ui/tapestry/components/panel/ListPanel.html trunk/src/org/hyperic/ui/tapestry/components/panel/ListPanel.java trunk/src/org/hyperic/ui/tapestry/components/panel/ListPanel.jwc Log: ListPanel now delgates all rendering of selected and unselected lines to the parent who has full control over their display Modified: trunk/src/org/hyperic/ui/tapestry/components/panel/ListPanel.html =================================================================== --- trunk/src/org/hyperic/ui/tapestry/components/panel/ListPanel.html 2008-05-09 13:47:22 UTC (rev 9426) +++ trunk/src/org/hyperic/ui/tapestry/components/panel/ListPanel.html 2008-05-09 15:15:36 UTC (rev 9427) @@ -1,18 +1,20 @@ <div jwcid='listContents@Any'> - <ol> - <li jwcid="listLinks@For" source="ognl:listItems" value="ognl:item" element="li"> - <li> - <span jwcid="listLink@DirectLink" async="true" - listener="listener:selectItem" - parameters="ognl:item.id"> - <span jwcid="@If" condition="ognl:loopedItemIsSelected"> - <span jwcid="@Insert" style="color:red" renderTag="true" value="ognl:item.label"/> - </span> - <span jwcid="@Else"> - <span jwcid="@Insert" style="color:blue" renderTag="true" value="ognl:item.label"/> - </span> - </span> - </li> - </li> - </ol> + <ol> + <li jwcid="listLinks@For" source="ognl:listItems" value="ognl:item" element="li"> + <li> + <span jwcid="listLink@DirectLink" async="true" + listener="listener:selectItem" + parameters="ognl:item.id"> + <span jwcid="@If" condition="ognl:loopedItemIsSelected"> + <span jwcid="@RenderBlock" block="ognl:selectedBlock" + item="ognl:item"/> + </span> + <span jwcid="@Else"> + <span jwcid="@RenderBlock" block="ognl:unselectedBlock" + item="ognl:item"/> + </span> + </span> + </li> + </li> + </ol> </div> Modified: trunk/src/org/hyperic/ui/tapestry/components/panel/ListPanel.java =================================================================== --- trunk/src/org/hyperic/ui/tapestry/components/panel/ListPanel.java 2008-05-09 13:47:22 UTC (rev 9426) +++ trunk/src/org/hyperic/ui/tapestry/components/panel/ListPanel.java 2008-05-09 15:15:36 UTC (rev 9427) @@ -10,6 +10,7 @@ import org.apache.tapestry.annotations.InjectObject; import org.apache.tapestry.annotations.Parameter; import org.apache.tapestry.annotations.Persist; +import org.apache.tapestry.components.Block; import org.apache.tapestry.listener.ListenerInvoker; import org.hyperic.ui.tapestry.components.BaseComponent; @@ -36,6 +37,14 @@ @InjectObject("infrastructure:listenerInvoker") public abstract ListenerInvoker getListenerInvoker(); + public Block getSelectedBlock() { + return (Block)getContainer().getComponent("selectedBlock"); + } + + public Block getUnselectedBlock() { + return (Block)getContainer().getComponent("unselectedBlock"); + } + /** * Used for iterating over the collection. */ Modified: trunk/src/org/hyperic/ui/tapestry/components/panel/ListPanel.jwc =================================================================== --- trunk/src/org/hyperic/ui/tapestry/components/panel/ListPanel.jwc 2008-05-09 13:47:22 UTC (rev 9426) +++ trunk/src/org/hyperic/ui/tapestry/components/panel/ListPanel.jwc 2008-05-09 15:15:36 UTC (rev 9427) @@ -4,6 +4,6 @@ "-//Apache Software Foundation//Tapestry Specification 4.1//EN" "http://jakarta.apache.org/tapestry/dtd/Tapestry_4_1.dtd"> -<component-specification allow-body="no" allow-informal-parameters="no" +<component-specification allow-body="yes" allow-informal-parameters="no" class="org.hyperic.ui.tapestry.components.panel.ListPanel"> </component-specification> |