Flex/LCDS Server-to-data-source Paging
Asked Answered
L

2

39

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?

Laxative answered 4/2, 2009 at 22:54 Comment(2)
I would start by looking in that params variable. It should be an instance containing "begin" and "rows" information? Maybe your flex DataService ignores that parameter.Hollins
@Travis, you asked this a while ago. Have you found any resolution? BTW: I would highly recommend Charles Proxy for your network debugging needs. It is a great debugging tool that will help you figure out what is actually being sent back and forth between flex and server.Latin
Y
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.

<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

Yanyanaton answered 13/8, 2011 at 14:20 Comment(0)
G
1

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
}
Guam answered 26/8, 2011 at 6:50 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.