Hello

I have a web block with filters and other block with list results of this filters. I need to send object with all filters to block with results in preparation of the page and every time that I have click on my filter button. How can I do it?

I do not see option to put trigger event to my preparation.

Hi Viktoria,

Based on if you have OS10 or OS11 the preferred solution is different:

Assuming both webblocks are in the same screen:

OS10:

- in the filter webblock in the screen action attached to the button, you have to call Notify server action and pass your filter options in the message property. This property is a string so you have to serialize your filter options if you have more than one.

- in the screen in the OnNotify action you retrieve the filter options with the NotifyGetMessage server action then assign them to the input parameters of the results webblock. Then you have to do a Ajax Refresh of the results webblock.


OS11:

- in the filter webblock create an event called FilterOptions, and set parameters same as your filter options. Then in the screen actions for the filter button trigger the event and pass all the filter options.

- in the screen define the eventhandler for the filterwebblock and  then assign them to the input parameters of the results webblock. Then you have to do a Ajax Refresh of the results webblock.


An alternative approach would be if you would define a results content place holder in your filter webblock.

Then the result webblock  can be placed in the placeholder. Now you just have to set the input parameters to the result webblock and do the ajax refresh. This solution doesn't need the screen to to receive and pass on the filter options.

Regards,

Daniel

I think what do you want is when you select filters block you want to update the webblock with results/table, and for that you have to put the on change option to run an action to refresh your data.

Daniël Kuhlmann wrote:

Hi Viktoria,

Based on if you have OS10 or OS11 the preferred solution is different:

Assuming both webblocks are in the same screen:

OS10:

- in the filter webblock in the screen action attached to the button, you have to call Notify server action and pass your filter options in the message property. This property is a string so you have to serialize your filter options if you have more than one.

- in the screen in the OnNotify action you retrieve the filter options with the NotifyGetMessage server action then assign them to the input parameters of the results webblock. Then you have to do a Ajax Refresh of the results webblock.


OS11:

- in the filter webblock create an event called FilterOptions, and set parameters same as your filter options. Then in the screen actions for the filter button trigger the event and pass all the filter options.

- in the screen define the eventhandler for the filterwebblock and  then assign them to the input parameters of the results webblock. Then you have to do a Ajax Refresh of the results webblock.


An alternative approach would be if you would define a results content place holder in your filter webblock.

Then the result webblock  can be placed in the placeholder. Now you just have to set the input parameters to the result webblock and do the ajax refresh. This solution doesn't need the screen to to receive and pass on the filter options.

Regards,

Daniel

Hi Daniel,

I am working with OS11. In preparation of my page I need to send default filters from my filters block to results block and I have not trigger event in my toolbar (I have this option just if I make screen action).


Nuno Gonçalo Pereira wrote:

I think what do you want is when you select filters block you want to update the webblock with results/table, and for that you have to put the on change option to run an action to refresh your data.

Hello Nuno,

In preparation of my page I have request with filters object, so in preparation of my page I want to send from block with filters default object, and after changing of my filter fields in filter block I am sending new request to my page. 


Hi Viktoria,

You need to have the filters as local variables on your screen, that way you should be able to pass them on to the webblocks and default the filter values on preparation. 

Attached I made a screen with one webblock for filter input and one webblock with results

filter value is passed from filter webblock via parent to result webblock.

Also on preperation the filter value has a default.

Hope this helps.

Regards,

Daniel