From: Chad B. <cwb...@us...> - 2007-09-26 16:11:42
|
User: cwbrandon Date: 07/09/26 09:11:45 Modified: andromda-jsf2/src/main/resources/templates/jsf2/views/jsp/includes view-table.jspf.vsl andromda-jsf2/src/main/resources/templates/jsf2/views/facelets view-table.xhtml.vsl Removed: andromda-jsf2/src/main/resources/resources/lib/trinidad trinidad-impl-1.0.2-SNAPSHOT.jar trinidad-api-1.0.2-SNAPSHOT.jar Log: couple minor fixes regarding commandLinks and commandButtons on tables (also remove trinidad jars since 1.0.2 was released) Revision Changes Path 1.3 +14 -9 cartridges/andromda-jsf2/src/main/resources/templates/jsf2/views/jsp/includes/view-table.jspf.vsl Index: view-table.jspf.vsl =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-jsf2/src/main/resources/templates/jsf2/views/jsp/includes/view-table.jspf.vsl,v retrieving revision 1.2 retrieving revision 1.3 diff -u -w -r1.2 -r1.3 --- view-table.jspf.vsl 19 Jul 2007 18:09:31 -0000 1.2 +++ view-table.jspf.vsl 26 Sep 2007 16:11:45 -0000 1.3 @@ -1,14 +1,19 @@ ## ## This macro renders the <f:param> elements for a command link ## -#macro (renderTableCommandLinkParameters) +#macro (renderTableCommandLinkParameters $attribute) #foreach ($parameter in $action.parameters) #if ($table.tableColumnNames.contains($parameter.name) || $table.tableAttributeNames.contains($parameter.name)) #set ($parameterValue = "row.${parameter.name}") #else #set ($parameterValue = "$parameter.name") #end - <f:param name="$parameter.name" value="#{${parameterValue}}"/> +#if($attribute) +#set ($elementType = "attribute") +#else +#set ($elementType = "param") +#end + <f:$elementType name="$parameter.name" value="#{${parameterValue}}"/> #end #end <h:form> @@ -28,13 +33,13 @@ #set ($tableColumnActions = $table.getTableColumnActions($columnName)) #if (!$tableColumnActions.empty) #set ($action = $tableColumnActions.iterator().next()) - <tr:commandLink action="#{${action.controller.beanName}.${action.triggerName}}"> + <tr:commandLink action="#{${action.controller.beanName}.${action.triggerName}}" actionListener="#{${action.controller.beanName}.action}"> <tr:outputText value="#{row.${columnName}}"> #if ($column.type.dateType) <a:convertDateTime pattern="$defaultDateFormat"/> #end </tr:outputText> -#renderTableCommandLinkParameters() +#renderTableCommandLinkParameters(false) </tr:commandLink> #else <tr:outputText value="#{row.${columnName}}"> @@ -65,8 +70,8 @@ <h:panelGroup styleClass="actionColumn"><t:graphicImage url="/images/space.gif"/></h:panelGroup> </f:facet> <h:panelGroup styleClass="actionColumn"> - <tr:commandLink text="#{messages['$action.trigger.messageKey']}" action="#{${action.controller.beanName}.${action.triggerName}}"> -#renderTableCommandLinkParameters() + <tr:commandLink text="#{messages['$action.trigger.messageKey']}" action="#{${action.controller.beanName}.${action.triggerName}}" actionListener="#{${action.controller.beanName}.action}"> +#renderTableCommandLinkParameters(false) </tr:commandLink> </h:panelGroup> </tr:column> @@ -80,8 +85,8 @@ <h:panelGroup styleClass="actionColumn"><t:graphicImage url="/images/space.gif"/></h:panelGroup> </f:facet> <h:panelGroup styleClass="actionColumn"> - <tr:commandButton text="#{messages['$action.trigger.messageKey']}" action="#{${action.controller.beanName}.${action.triggerName}}"> -#renderTableCommandLinkParameters() + <tr:commandButton text="#{messages['$action.trigger.messageKey']}" action="#{${action.controller.beanName}.${action.triggerName}}" actionListener="#{${action.controller.beanName}.action}"> +#renderTableCommandLinkParameters(true) </tr:commandButton> </h:panelGroup> </tr:column> 1.5 +11 -6 cartridges/andromda-jsf2/src/main/resources/templates/jsf2/views/facelets/view-table.xhtml.vsl Index: view-table.xhtml.vsl =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-jsf2/src/main/resources/templates/jsf2/views/facelets/view-table.xhtml.vsl,v retrieving revision 1.4 retrieving revision 1.5 diff -u -w -r1.4 -r1.5 --- view-table.xhtml.vsl 19 Sep 2007 16:50:52 -0000 1.4 +++ view-table.xhtml.vsl 26 Sep 2007 16:11:45 -0000 1.5 @@ -1,14 +1,19 @@ ## ## This macro renders the <f:param> elements for a command link ## -#macro (renderTableCommandLinkParameters) +#macro (renderTableCommandLinkParameters $attribute) #foreach ($parameter in $action.parameters) #if ($table.tableColumnNames.contains($parameter.name) || $table.tableAttributeNames.contains($parameter.name)) #set ($parameterValue = "row.${parameter.name}") #else #set ($parameterValue = "$parameter.name") #end - <f:attribute name="$parameter.name" value="#{${parameterValue}}"/> +#if($attribute) +#set ($elementType = "attribute") +#else +#set ($elementType = "param") +#end + <f:$elementType name="$parameter.name" value="#{${parameterValue}}"/> #end #end <html xmlns="http://www.w3.org/1999/xhtml" @@ -37,13 +42,13 @@ #set ($tableColumnActions = $table.getTableColumnActions($columnName)) #if (!$tableColumnActions.empty) #set ($action = $tableColumnActions.iterator().next()) - <tr:commandLink action="#{${action.controller.beanName}.${action.triggerName}}"> + <tr:commandLink action="#{${action.controller.beanName}.${action.triggerName}}" actionListener="#{${action.controller.beanName}.action}"> <tr:outputText value="#{row.${columnName}}"> #if ($column.type.dateType) <a:convertDateTime pattern="$defaultDateFormat"/> #end </tr:outputText> -#renderTableCommandLinkParameters() +#renderTableCommandLinkParameters(false) </tr:commandLink> #else <tr:outputText value="#{row.${columnName}}"> @@ -75,7 +80,7 @@ </f:facet> <h:panelGroup styleClass="actionColumn"> <tr:commandLink text="#{messages['$action.trigger.messageKey']}" action="#{${action.controller.beanName}.${action.triggerName}}" actionListener="#{${action.controller.beanName}.action}"> -#renderTableCommandLinkParameters() +#renderTableCommandLinkParameters(false) </tr:commandLink> </h:panelGroup> </tr:column> @@ -90,7 +95,7 @@ </f:facet> <h:panelGroup styleClass="actionColumn"> <tr:commandButton text="#{messages['$action.trigger.messageKey']}" action="#{${action.controller.beanName}.${action.triggerName}}" actionListener="#{${action.controller.beanName}.action}"> -#renderTableCommandLinkParameters() +#renderTableCommandLinkParameters(true) </tr:commandButton> </h:panelGroup> </tr:column> |