Hi,

I'm having trouble putting some pagination on a list that is inside a webblock. Attached is a snippet which I will now explain.

I used the "Drag and Drop" in the forge and changed it to my needs. In the left container you can drag the element and drop on the right container. However, in the left container I have the list and the pagination right bellow it (inside the same webblock), but in the right container the list is inside another webblock! So, hence my struggle. I need to, somehow, put the pagination outside the webblock that contains the list.

Since I need to pass the list Id as a parameter to the list navigation and list counter, I'm a bit stuck!

Is it possible to have pagination on a parent webblock with a list of a child webblock?

Thanks in advance, 

Miguel Marçal

The web block with the list needs to expose input parameters that represent the start index and page size for the pagination. Once you've done that, the external controls can update those parameters, and refresh the web block using Ajax Refresh.

G. Andrew Duthie wrote:

The web block with the list needs to expose input parameters that represent the start index and page size for the pagination. Once you've done that, the external controls can update those parameters, and refresh the web block using Ajax Refresh.

Thanks for the reply! 

Still, if I don't have access to the list inside the webblock (and the list widget ID), how can I fill the input parameters of the list_Navigation and list_counter?

Thank you,

Miguel Marçal

Hello Miguel,

Don't do that.
Keep the pagination INSIDE the web block where the List is.

Why do you want to have the pagination OUTSIDE the web block?

Cheers.

Eduardo Jauch wrote:

Hello Miguel,

Don't do that.
Keep the pagination INSIDE the web block where the List is.

Why do you want to have the pagination OUTSIDE the web block?

Cheers.

Hi Eduardo,

Because the pagination needs to be exactly like in the left container of the first image. And if I put the pagination inside the webblock of the right container, this happens: 

Thank you,

Miguel Marçal

But this is just a visual problem, that you can fix with margins (and columns, etc)... 

Eduardo Jauch wrote:

But this is just a visual problem, that you can fix with margins... 

Well sure, I can do that, thanks.

Still, my question remains, is there a way of doing what I previously asked? Or it shouldn't be done?

Thanks Eduardo


Solution

Hi Miguel,

You shouldn't. You would be creating a connection between page and web block that shouldn't exist (as the web block should be a piece of standalone interface working autonomously).

The Input Parameters / Event System (Notification System until version 10) is the way to create a communication channel between the Web Block and its parent, but it should be "generic" (so, it should work on any parent the same way).

You can pass a widget Id to the outside of the block using an event triggered in the preparation, I suppose (not sure if the ID is already available at this point), but trying to use this outside would create a problem. First, you should guarantee that no other thing (code/widget) use it if it is still not ready. And any refresh on the widget INSIDE the block would require also a refresh in any widget attached to it outside of the block.

This would defeat the idea of the web block, creating a more or less complex logic and maintenance situation, more error prone...

So, I suggest to deal with UI styling problems using UI styling solutions instead of logic.

Cheers.

Solution

Eduardo Jauch wrote:

Hi Miguel,

You shouldn't. You would be creating a connection between page and web block that shouldn't exist (as the web block should be a piece of standalone interface working autonomously).

The Input Parameters / Event System (Notification System until version 10) is the way to create a communication channel between the Web Block and its parent, but it should be "generic" (so, it should work on any parent the same way).

You can pass a widget Id to the outside of the block using an event triggered in the preparation, I suppose (not sure if the ID is already available at this point), but trying to use this outside would create a problem. First, you should guarantee that no other thing (code/widget) use it if it is still not ready. And any refresh on the widget INSIDE the block would require also a refresh in any widget attached to it outside of the block.

This would defeat the idea of the web block, creating a more or less complex logic and maintenance situation, more error prone...

So, I suggest to deal with UI styling problems using UI styling solutions instead of logic.

Cheers.

Ok Eduardo, thank you very much for the explanation!

I will do as you suggested! 

Cheers,

Miguel Marçal