Flex/LCDS 服务器到数据源分页

发布于 2024-07-13 14:16:01 字数 1184 浏览 9 评论 0原文

我正在尝试设置数据源分页服务的服务器。 我已经完成了所有设置,以便调用我的汇编器并返回值,但我没有收到“分页”调用。

具体来说:

public Collection fill(List fillArgs, int begin, int rows)

始终使用 begin == -1rows == -1 调用,而不是获取实际值进行分页。 另外:

public boolean useFillPage(List fillParameters)

永远不会被调用(我的实现总是为所有参数返回 true)。 看起来它从未被调用,因为 JavaAdapter 没有从 Flex 客户端接收 pageSize 标头。

这是我的目标配置:

<destination id="invoiceListDataService">
  <adapter ref="java-dao" />
  <properties>
    <scope>session</scope>
    <source>com.williams.finance.invoice.dao.InvoiceReviewListAssembler</source>
    <network>
      <paging enabled="true" pageSize="100" />
    </network>
    <metadata>
      <identity property="invoiceNumber"/>
    </metadata>
  </properties>
</destination>

以及用于调用数据服务的 Flex 代码:

myDataService = new DataService("invoiceListDataService");
myDataService.autoSyncEnabled=false;
myDataService.fill(invoiceReviewListModel.invoiceList, params);

我在这里遗漏了什么吗? 有什么想法从哪里开始寻找吗?

I’m trying to set up a server to data-source paged service. I’ve got everything set up so that I’m getting my assembler called and am returning values, but I’m not getting “paged” calls.

Specifically:

public Collection fill(List fillArgs, int begin, int rows)

is always called with begin == -1 and rows == -1, instead of getting real values to page through. In addition:

public boolean useFillPage(List fillParameters)

is never called (my implementation always returns true for all parameters). It looks like it is never called because the JavaAdapter is not receiving the pageSize header from the Flex client.

This is my destination configuration:

<destination id="invoiceListDataService">
  <adapter ref="java-dao" />
  <properties>
    <scope>session</scope>
    <source>com.williams.finance.invoice.dao.InvoiceReviewListAssembler</source>
    <network>
      <paging enabled="true" pageSize="100" />
    </network>
    <metadata>
      <identity property="invoiceNumber"/>
    </metadata>
  </properties>
</destination>

And my Flex code for calling the data service:

myDataService = new DataService("invoiceListDataService");
myDataService.autoSyncEnabled=false;
myDataService.fill(invoiceReviewListModel.invoiceList, params);

Am I missing something in here? Any ideas where to start looking?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

书信已泛黄 2024-07-20 14:16:02

首先,您的适配器定义是什么?
试试这个:

<adapters>
    <adapter-definition class="flex.data.adapters.JavaAdapter" 
        id="java-dao"></adapter-definition>
</adapters>

其次,将 custom="true" 属性添加到您的 paging 属性中。

<paging enabled="true" pageSize="100" custom="true"/> 

第三,可能将您的范围更改为应用程序

第四,在您的目标定义中,添加adapter =“java-dao”而不是对其进行引用。

<destination adapter="java-dao"  id="invoiceListDataService">

第五,确保您覆盖了必要的方法(useFillPage、Collection fill 等)。

@Override
public boolean useFillPage(List fillParameters)
{
    // enabling paged-fill for all fills
    return true;
}

请参阅此线程以获取对类似问题的一些有用的响应:
http://www.mail-archive.com/[电子邮件受保护]/msg111746.html

First, What is your adapter definition?
Try this:

<adapters>
    <adapter-definition class="flex.data.adapters.JavaAdapter" 
        id="java-dao"></adapter-definition>
</adapters>

Second, add custom="true" attribute to your paging property.

<paging enabled="true" pageSize="100" custom="true"/> 

Third, possibly change your scope to application

Fourth, in your destination definition, add adapter="java-dao" instead of having a reference to it.

<destination adapter="java-dao"  id="invoiceListDataService">

Fifth, make sure you're Overridding the necessary methods (useFillPage, Collection fill, etc.)

@Override
public boolean useFillPage(List fillParameters)
{
    // enabling paged-fill for all fills
    return true;
}

See this thread for some helpful responses to a similar problem:
http://www.mail-archive.com/[email protected]/msg111746.html

痴意少年 2024-07-20 14:16:02

您的目标配置看起来已完成。

仔细检查您的汇编器是否扩展了 AbstractAssembler:

public class InvoiceReviewListAssembler extends AbstractAssembler 

并且至少覆盖了以下内容:

@Override
public int count(List arg0) {
    return -1; // or return the collection length.
}

@Override
public boolean useFillPage(List fillParameters) {       
    return true;
}

@Override
public Collection fill(List fillParameters,
                       PropertySpecifier ps,
                       int startIndex,
                       int numItems) {
   // TODO
}

Your destination configuration looks complete.

Double check that you assembler extends AbstractAssembler:

public class InvoiceReviewListAssembler extends AbstractAssembler 

and that you override the following at minimum:

@Override
public int count(List arg0) {
    return -1; // or return the collection length.
}

@Override
public boolean useFillPage(List fillParameters) {       
    return true;
}

@Override
public Collection fill(List fillParameters,
                       PropertySpecifier ps,
                       int startIndex,
                       int numItems) {
   // TODO
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文