如何在XPage上配置xe:viewFileItemService以过滤分类视图中的数据? [英] How to configure an xe:viewFileItemService on an XPage to filter the data in a categorized view?

查看:420
本文介绍了如何在XPage上配置xe:viewFileItemService以过滤分类视图中的数据?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个DocsByUsername分类视图,按用户名排序和分类。对于经过身份验证的用户,我只想在Dojo数据网格中显示他们的文档。网格需要支持网格编辑,所以我需要使用xe:viewFileItemService读/写服务作为网格的数据源。

I have a DocsByUsername categorized view, sorted and categorized by the username. For the authenticated user I only want to display their documents in a Dojo Data Grid. The grid needs to support in-grid editing so I need to use an xe:viewFileItemService read/write service as the data source for the grid.

我以为这将是相当直接使用以下服务配置...

I thought this would be fairly straight forward using the following service configuration ...

    <xe:restService id="restService1" jsId="restServiceObj"
        pathInfo="pathinfo">
        <xe:this.service>
            <xe:viewItemFileService
                viewName="DocsByUsername" var="rsEntry"
                contentType="application/json" defaultColumns="true"
                sortColumn="Username" categoryFilter="#{sessionScope.username}">
            </xe:viewItemFileService>
        </xe:this.service>
    </xe:restService>

当我预览页面并将/ pathinfo附加到url来测试服务时,以下错误是返回...

When I preview the page and append the /pathinfo to the url to test the service the following error is returned ...

{
   "code":500,
   "text":"Internal Error",
   "message":"",
   "type":"text",
   "data":"java.lang.NullPointerException\r\n\tat 
      ... removed for space ...

}

如果我从xe:viewFileItemService切换到xe:viewJsonService,数据被正确地返回没有错误。

If I switch from xe:viewFileItemService to xe:viewJsonService the data is properly returned without error.

我可以不指定xe的分类视图:viewFileItemService?

Can I not specify a Categorized view for xe:viewFileItemService ?

推荐答案

使用参数而不是 categoryFilter 。这将返回用户名类别的所有文档。

Use parameter keys instead of categoryFilter. That gives you back all documents for username's category.

... keys="#{sessionScope.username}">

Steve Zavocki有一个博客关于这个问题一段时间。

Steve Zavocki had a blog about this issue a while ago.

这篇关于如何在XPage上配置xe:viewFileItemService以过滤分类视图中的数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆