Refresh table on page load without clicking Reset

Hi,

I want to refresh the data from table on page load. The logic is actually, if we give value to the text box, then it will fetch the data or if we click the reset button then also it fetches the data. But what i want is displaying the data without reset or without giving a particular value to the text box. The text box is having some value initially set. So in accordance with that initial value on page load it should fetch the data from table.

  

Hi Sohini Dasgupta,

Can you explain your situation better? What you describe should be the default behaviour, your Preparation has an Aggregate that fetches the information to be displayed on the Web Screen. When you navigate to a Web Screen, it first executes the Preparation (so it will execute your Aggregate) and then will render the screen (with the up to date data) 

Hi Jorge,

my screen is having 2 DATE text boxes. 

        1. Date_To

        2. Date_From

And there is a RESET button beside them.

The date_To is always set to the Current date and the date_from is always set to Current date - 1

So, if i click on the RESET button it is fetching the data from the table in accordance with that Curr date and Curr date - 1 . Also if i give some other date and RESET, then also accordingly it fetches the data.

But what i want is, on loading the page, without clicking on RESET button, it should fetch the table data.

Thanks,

Sohini

Sohini,

So... what is it doing now? doesn't fetch/display any data? fetches/displays the wrong data? if it's wrong... what's wrong about it?

Also, if the Button is called RESET, it's hints at an intended behaviour: reset the values of those two inputs to their default values, and display data accordingly. Otherwise, in my opinion it would provide better guidance to the purpose of the button if it was called something like SEARCH or FILTER.

Jorge,

The thing is that, on loading the page without clicking the RESET, it is fetching the entire data, even that DATE_TO and DATE_FROM is being set to the assigned format of CurrDate() and CurrDate() - 1 respectively.




Jorge,

So this is the thing. On loading this page it should fetch the data for Current Date - 1 to Current Date, as it is being assigned. But on page load it is showing the entire list of data. 

Sohini Dasgupta wrote:

Jorge,

So this is the thing. On loading this page it should fetch the data for Current Date - 1 to Current Date, as it is being assigned. But on page load it is showing the entire list of data. 

Hi Sohini,


Are you sure that you are only ajax refreshing the container with data on change and not the filter wrapper? Because if you refresh the date boxes they will be reset to their initial value. Other than that it is also a bit unclear to me what your reset button and change actions are suppose to do.


Best wishes,


Khadija


Hi,

Can you share with us a print screen of preparation and of the aggregate you use to get the data specially the filters part.

Regards,

Marcelo

Hello Sohini,

If you are using an aggregate to fetch data in the preparation, and the aggregate has a filter using the variables where you store the date_to and date_from, than you need to set those values BEFORE the aggregate node, or when you load the page, the aggregate will fetch all the data because there is NO date defined (and you may be taking this into consideration, if setting reset is working).

So, if you are using variables, you can set the Default values to CurrDate() for the date_to variable and AddDays(CurrDate(), -1) for the date_from variable.

This will guarantee that your aggregate fetches the correct values on page loading.

Then, in your reset screen action, you use an assign and set the values again for the default ones.

Cheers. 

Thanks Eduardo :)