From: Chad B. <cwb...@us...> - 2005-09-30 17:52:20
|
User: cwbrandon Date: 05/09/30 10:32:21 Modified: andromda-jsf/src/templates/jsf/views/jsp/includes view-table.jspf.vsl andromda-jsf/src/java/org/andromda/cartridges/jsf/metafacades JSFParameterLogicImpl.java andromda-jsf/src/uml JSFMetafacadeModel.xml.zip Log: add missing column link support Revision Changes Path 1.11 +25 -23 cartridges/andromda-jsf/src/templates/jsf/views/jsp/includes/view-table.jspf.vsl Index: view-table.jspf.vsl =================================================================== RCS file: /cvsroot/andromda/cartridges/andromda-jsf/src/templates/jsf/views/jsp/includes/view-table.jspf.vsl,v retrieving revision 1.10 retrieving revision 1.11 diff -u -w -r1.10 -r1.11 --- view-table.jspf.vsl 29 Sep 2005 14:30:47 -0000 1.10 +++ view-table.jspf.vsl 30 Sep 2005 17:32:21 -0000 1.11 @@ -1,5 +1,4 @@ #set ($targetColumns = $table.targettedTableColumnNames) - <h:panelGrid columns="3" columnClasses="standardTableColumnCentered" > <x:dataScroller id="scroll_1" for="data" @@ -76,11 +75,24 @@ <h:outputText value="#{messages['$table.getTableColumnMessageKey($columnName)']}"/> </x:commandSortHeader> </f:facet> +#set ($tableColumnActions = $table.getTableColumnActions($columnName)) +#if (!$tableColumnActions.empty) +#set ($action = $tableColumnActions.iterator().next()) + <h:commandLink action="#{${action.controller.beanName}.${action.triggerName}}" styleClass="columnLink"> + <h:outputText value="#{row.${columnName}}"> +#if ($column.type.dateType) + <jsf:convertDateTime pattern="$defaultDateFormat"/> +#end + </h:outputText> +#renderTableCommandLinkParameters() + </h:commandLink> +#else <h:outputText value="#{row.${columnName}}"> #if ($column.type.dateType) <jsf:convertDateTime pattern="$defaultDateFormat"/> #end </h:outputText> +#end </h:column> #end #else @@ -104,21 +116,7 @@ </f:facet> <h:commandLink action="#{${action.controller.beanName}.${action.triggerName}}"> <h:outputText value="#{messages['$action.trigger.messageKey']}"/> -#foreach ($parameter in $action.parameters) -#if ($table.tableColumnNames.contains($parameter.name) || $table.tableAttributeNames.contains($parameter.name)) -#set ($parameterValue = "row.${parameter.name}") -#elseif ($parameter.defaultValuePresent) -#set ($parameterValue = $parameter.defaultValue) -#else -#set ($parameterValue = "${actionFormKey}.${parameter.name}") -#end -#if ($parameter.type.dateType || $parameter.type.timeType) -#set ($formattedParameterValue = "${parameter.name}Formatted") - <fmt:formatDate var="$formattedParameterValue" value="${${parameterValue}}" pattern="$parameter.format" scope="request"/> -#set ($parameterValue = $formattedParameterValue) -#end - <f:param name="$parameter.name" value="#{${parameterValue}}"/> -#end +#renderTableCommandLinkParameters() </h:commandLink> </h:column> #end @@ -132,11 +130,19 @@ </f:facet> <h:commandLink action="#{${action.controller.beanName}.${action.triggerName}}" styleClass="buttonLink"> <h:outputText value="#{messages['$action.trigger.messageKey']}" /> +#renderTableCommandLinkParameters() + </h:commandLink> + </h:column> +#end +#end +</x:dataTable> +## +## This macro renders the <f:param> elements for a command link +## +#macro (renderTableCommandLinkParameters) #foreach ($parameter in $action.parameters) #if ($table.tableColumnNames.contains($parameter.name) || $table.tableAttributeNames.contains($parameter.name)) #set ($parameterValue = "row.${parameter.name}") -#elseif ($parameter.defaultValuePresent) -#set ($parameterValue = $parameter.defaultValue) #else #set ($parameterValue = "${actionFormKey}.${parameter.name}") #end @@ -147,8 +153,4 @@ #end <f:param name="$parameter.name" value="#{${parameterValue}}"/> #end - </h:commandLink> - </h:column> -#end #end -</x:dataTable> \ No newline at end of file 1.21 +24 -0 cartridges/andromda-jsf/src/java/org/andromda/cartridges/jsf/metafacades/JSFParameterLogicImpl.java Index: JSFParameterLogicImpl.java =================================================================== RCS file: /cvsroot/andromda/cartridges/andromda-jsf/src/java/org/andromda/cartridges/jsf/metafacades/JSFParameterLogicImpl.java,v retrieving revision 1.20 retrieving revision 1.21 diff -u -w -r1.20 -r1.21 --- JSFParameterLogicImpl.java 28 Sep 2005 16:02:16 -0000 1.20 +++ JSFParameterLogicImpl.java 30 Sep 2005 17:32:21 -0000 1.21 @@ -966,4 +966,28 @@ { return ObjectUtils.toString(this.findTaggedValue(JSFProfile.TAGGEDVALUE_INPUT_TABLE_IDENTIFIER_COLUMNS)).trim(); } + + /** + * @see org.andromda.cartridges.jsf.metafacades.JSFParameter#getTableColumnActions(java.lang.String) + */ + protected List handleGetTableColumnActions(final String columnName) + { + final List columnActions = new ArrayList(); + + if (columnName != null) + { + final Set actions = new LinkedHashSet(this.getTableHyperlinkActions()); + actions.addAll(this.getTableFormActions()); + for (final Iterator iterator = actions.iterator(); iterator.hasNext();) + { + final JSFAction action = (JSFAction)iterator.next(); + if (columnName.equals(action.getTableLinkColumnName())) + { + columnActions.add(action); + } + } + } + + return columnActions; + } } \ No newline at end of file 1.23 +131 -159 cartridges/andromda-jsf/src/uml/JSFMetafacadeModel.xml.zip <<Binary file>> |