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

时间:2021-11-25 18:19:37

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:

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

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.

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

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:

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

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

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

我在这里错过了什么吗?任何想法从哪里开始寻找?

2 个解决方案

#1


1  

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.

其次,将custom =“true”属性添加到您的分页属性中。

<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.

第四,在目标定义中,添加adapter =“java-dao”而不是引用它。

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

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

五,确保你覆盖了必要的方法(useFillPage,Collection fill等)

@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/flexcoders@yahoogroups.com/msg111746.html

有关类似问题的一些有用回应,请参阅此主题:http://www.mail-archive.com/flexcoders@yahoogroups.com/msg111746.html

#2


1  

Your destination configuration looks complete.

目标配置看起来很完整。

Double check that you assembler extends AbstractAssembler:

仔细检查你的汇编器扩展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
}

#1


1  

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.

其次,将custom =“true”属性添加到您的分页属性中。

<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.

第四,在目标定义中,添加adapter =“java-dao”而不是引用它。

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

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

五,确保你覆盖了必要的方法(useFillPage,Collection fill等)

@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/flexcoders@yahoogroups.com/msg111746.html

有关类似问题的一些有用回应,请参阅此主题:http://www.mail-archive.com/flexcoders@yahoogroups.com/msg111746.html

#2


1  

Your destination configuration looks complete.

目标配置看起来很完整。

Double check that you assembler extends AbstractAssembler:

仔细检查你的汇编器扩展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
}