I am trying to add a list into a table using DisplayTag.
Everything works normally when I add list property to a column in the usual manner:
<display:column property="status" title="Claim Status"/>
<display:column property="authNo" title="Authorization Number" href="authSlipMasterAction">
Now, I want to check when authNo is not blank; if it is blank, then do not provide the link, so how can I use <s:if test=''>
and <s:property value="">
in the <display:table>
tag ?
I've tried to display the value using <s:property value="authNo"/>
but no value is shown (I have to display the value because I want to check the condition)
This is my code
<display:table uid="myTable" id="display-tag" name="session.claimReportList">
<display:column title="Authorization No">
<s:property value="#attr.myTable.transNo" />
</display:column>
I have also tried
<s:property value="#session.myTable.transNo" />
You need to use the
#attr.
notation in your<s:property />
or<s:if />
when inside a DisplayTag column; you also need to use theuid
specified in the<display:table>
tag after the#attr.
to access your objects.For example:
From OGNL Basics - Struts 2 Named Objects:
P.S: I'd consider taking a look at some newer grid like jqGrid or DataTables, though.