Liferay Portal 6.2 - 复选框进入搜索容器

时间:2016-04-14 14:50:31

标签: search checkbox liferay containers

我创建了一个包含列复选框类型的搜索容器表,即

                <liferay-ui:search-container-column-text
                    name="territoriale"
                    orderable="<%= true %>"
                >
                    <input type="checkbox" id="territoriale" checked="<%= cmt.getTerritoriale() == 1 %>" />
                </liferay-ui:search-container-column-text>

此表在使用liferay-util:include包含的jsp中声明,但也可以通过单击搜索按钮在接下来的步骤中刷新。

当桌子第一次出现时,我看到该列只有文本(值为“1”),当我点击运行ajax调用的搜索按钮时,资源操作返回正确的复选框列。

有什么想法吗? 下面是一些屏幕截图 感谢

Column after page load Column after click on search button

1 个答案:

答案 0 :(得分:0)

这适用于6.2 CE ga5:

<liferay-ui:search-container-column-text
    name="checkbox"
    orderable="<%= true %>"
>
 <% String checked = (Math.random() < 0.5) ? "checked" : ""; %>
 <input type="checkbox" <%= checked %>/>
 </liferay-ui:search-container-column-text>

因此,问题的根本原因应该是其他地方。您可以将cmt.getTerritoriale()输出到html中以检查其内容。

我认为,检查=“&lt;%= cmt.getTerritoriale()== 1%&gt;”是不正确的, 您可以使用选中或不使用任何内容。 有关使用checked属性的信息,请参阅here

你也可以像Pankajkumar Kathiriya的评论中提到的那样使用rowchecker。

相关问题