struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Grant Lewis <ukchuckt...@gmail.com>
Subject ognl: calling action method inside iterator tag
Date Fri, 21 May 2010 23:10:05 GMT
Wondering if it's possible (struts 2.1.8.1)? From my testing it
doesn't appear possible to to call an action method from inside an
iterator tag. I can't find any documentation on it so hoping an
experienced user can shed some light on this mystery. I can call the
method fine outside the iterator but inside the call is masked. It's
odd because a property reference on the action is returned in the
iterator but not my method call. Below is my code fragment. The call
to getErrorCount never makes it to the action but the later call to
fileSubmissionErrors.size is resolved which doesn't make sense to me.
One is a property on the action the other a method. If it doesn't work
I suppose I can push a utility object on the action context and
reference it inside the iterator instead of keeping the utility method
on the action class. Thanks for any help.

Grant

			<s:iterator value="%{fileSubmissionErrors}" status="errorStatus">
                <tr>
                    <s:if
test="%{!complianceCategory.name.equals(#currentCategory)}">
                        <s:set var="errorCount"
value="%{getErrorCount(complianceCategory)}"/>
                        <td style="vertical-align:top;"
                            rowspan="">
                            <s:property
value="%{complianceCategory.name + ' (' + #errorCount + ')'}"/>
                        </td>
                    </s:if>

                    <td>
                        <s:property
value="nonCompliance.dataAggregate.element.name"/>
                    </td>

                    <td>
                        <s:property value="errorMessage"/>
                    </td>

                    <s:if test="%{#errorStatus.first}">
                        <td style="vertical-align:top;"
                            rowspan='<s:property
value="fileSubmissionErrors.size()"/>'>
                            TODO: calculate penalty
                        </td>
                    </s:if>
                </tr>
                <s:set name="currentCategory" value="complianceCategory.name"/>
			</s:iterator>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message