No Record is shown when refreshing the page

Hello,

I currently have a trouble in creating a toggle search feature by categories in my web application. The first time the page loads, it shown me 7 rows of records. 

But, everytime I triy to use this feature(click the toggle), the table shows me "No items to show...". 

I've tried to check it in debug, and when I refresh the aggregate, it returns no records at all. But when I try it manually through the aggregate in preparation, it works just fine.

Even when I tried to take out the InStr_StatusId Filter in this aggregate, whenever I Ajax refresh the table, It shows me no records result.

And after I try this toggle search and it shows me no records, and then I refreshed the page, the results were still "No items to show..." even though the first time I load the page it returned 7 rows of records. I can only load the right records if I use CTRL + F5 to refresh the page.

I am sorry I cannot present the .oml in this post. What do you guys think is the problem here? And how do I solve it? Thank you.


Regards,

Hentry

Hi Hentry,

the last part of your story seems to point to another problem than just your status filter.  Since you can't share  your oml, could you share some screenprints of following :

* the preparation where the initial aggregate is run

* the screen action where the aggregate and table are refrheshed

* the full list of aggregate filters, not just the one on status

* the logic in detail of how you construct InStr_StatusId, and where you empty it if toggle is All


I see also a Search_Statuslabel, where is that one used, and how is it populated.

As far as the toggle buttons is concerned, i guess you append a !index! for every button toggled on ?  

Neat trick, but maybe as al last resort you could try using a separate flter for each toggle button as follows

T_OS_Voucher.VoucherStatusId = Entities.Status.Progress or OnProgressFilter = False


Happy to help if you can give a little more info, can't really see anything wrong in what you've shown so far.


Dorine


Edit : you say you need to use F5 to get initial list again, what about re-launching the app from Service Studio ?

Hello Dorine,

Yeah actually there are 2 problems here that I experienced. For what you asked, you can see them in here:

https://marvelapp.com/57jcce9

In the filter section of GetVoucher, maybe a little bit confusing, Actually it is just

'Name = "" or name like "%" + Search.Name + "%"' with a lot of field in there.


Right now, I cannot see the result even I tried different method for toggle search because whenever I use ajax submit for the list, it returns no rows.


Regards,

Hentry

Hi Hentry,

I'm going to try and rebuild your code to see what is going on, but can you tell me, why do you transfer the result from the aggregates to other lists instead of just using the aggregates lists as source for your table records ?  That makes stuff much more complex, what is the reason?

Hi Hentry,


I made a similar OML, see attached.  I tried some differnt approaches, they all work, and I can't really see much different between my 'withoutWebblock' approach and yours.  So I'm not really sure, but some remarks about your code :


* there is the use of 'CurrentRowNumber' where I would have expected something like 'ListRecords1.CurrentRowNumber', now it looks like you have some local variable with the name CurrentRowNumber, but maybe that's not the reason it's not working, maybe you are populating it earlier with the correct rownumber ??  Same goes for the If right before that assign, are you looking at some local variable with name CurrentRowNumber ??


* In the True branch (user toggled one of the individual statusses) you are only unselecting the All option after constructing the InStr_StatusId, that means that it won't be empty string, but "!0!", that could be a problem for your aggregate filtering if user unselects the only selected status.  in that case it should go back to showing all, but none will fit filter of "!0!"

* I notice you use a get for every voucher, in order to retrieve the status label, probably better performance if you would get that from the join in the aggregate.


But I haven't reallly found what is not working for you, maybe you can look at my oml and spot some difference that I missed.  I haven't mixed it up with other filter conditions, so maybe you can remove all other filters from your aggregate and see if that makes any difference...

Dorine

Hi Dorine,

The reason why I transfer the aggregate to the local variable is because I need the IsSelected feature for each record in the list. I cannot accomplish this with only aggregate list records.

About the currentRowNumber Variable, it is the input parameter of the screen action. Actually I could just use it like ListRecords1.List.CurrentRowNumber. I used this input parameter just for the sake of debugging.

The "!0!" has not to be the problem because when I tested it in the aggregate with value "!0!1!", it returned some records, but when I tried it in debug, it returned 0.

I'll check your .oml for comparison and I'll get back to you asap. Thank you Dorine for the help. Really appreciate it!


Regards,

Hentry

Hentry - wrote:

Hi Dorine,

The reason why I transfer the aggregate to the local variable is because I need the IsSelected feature for each record in the list. I cannot accomplish this with only aggregate list records. For the list with possible status options for search, transferring to another list allows to easily add the 'All' option, so for that one, I would do the same.  But for the Voucher list itself, there isn't really a need if all you want is adding a checkbox to each row.  You can add extra columns to an aggregate for non-datamodel fields, and set whatever initial value you want.  For example, i did this in my oml for the IsSelected.

About the currentRowNumber Variable, it is the input parameter of the screen action. Actually I could just use it like ListRecords1.List.CurrentRowNumber. I used this input parameter just for the sake of debugging. Ok, that makes sense.

The "!0!" has not to be the problem because when I tested it in the aggregate with value "!0!1!", it returned some records, but when I tried it in debug, it returned 0. Yes, agreed.

I'll check your .oml for comparison and I'll get back to you asap. Thank you Dorine for the help. Really appreciate it! Ok, let me know if you find anything, I'm real curious now, it's probably some small oversight.


Regards,

Hentry