Is pagination supposed to work for a suitelet subl...
# suitescript
b
Is pagination supposed to work for a suitelet sublist of type STATICLIST? I'm running a SuiteQL query and populating the sublist. The results populate and the page controls show the right number of results/pages but when the page is changed the results disappear. The same thing happens when a column is clicked to sort it. I've searched and looked through documentation. All the examples I've found conveniently use less than 25 results so paging doesn't apply.
b
add more logs to the incoming request to your suitelet
and pay attention to those logs when triggering those action you describe
b
Yep I'm logging the entire request but focusing on the parameters. Changing the page triggers a GET. I don't see anything that indicates the selected page. If it does, am I then responsible for determining the results that belong to a certain page and populating that in the sublist?
It seems to have something to do with the order I was doing things. I've at least been able to get the paging to work after a few tweaks. It seems like the column sorting is an enhancement though so hopefully the users can live without that.
b
suitescript relies entirely on the server to decide what should be shown in the sublist
whenever you do something that triggers a sublist change, it sends a get to the suitelet to ask for what to change it to
you are supposed to return a response with the form as it should look like
most of the time, thats the exact same form. the suitelet logic knows how to pick out the requested part
pay closer attention to the request url
the query parameters will tell you if its one of these sublist refresh requests
b
That's making more sense. I was trying to avoid certain actions on initial load by looking for GET calls. I realize I need to be more nuanced than that and am looking at how the parameters array behaves. I should be able to figure out another way of doing what I need.
Thanks for the thoughts.
I have noticed that the parameters contain information about the sublist sort options that are selected. Any idea why that functionality doesn't work?
b
my guess is you are returning the wrong form in the response
b
So it is supposed to work? I found enhancement 163776 that looked to be related to that.
123 Views