Hi all,


very strange issue.
I'm using a local variable 'isShowDetails' on a screen....
This variable has an default value False.
Depending on a simple non important selection, this value is changed to true.
On this screen I have a webblock (within a container), which is visible depending on the variable, using an if-statement around the webblock.
When i click a button (Ajax submit), I do an ajax refresh to display or hide the webblock.
Somehow the value of the variable is lost. The screen itself 'hangs' with the ajax-refresh-busy-thingy... and the webblock is never shown.
When I set the default value of the variable to true, this issue doesn't occur.........

Best Regards,

Jeroen Vormer

Hi Jeroen Vormer,

When you do the ajax refresh, you get from the server the same variable value you had stored there. Try to change that value in the server (for example inside the action) and maybe it will solve your issue.

Let me know if this helps, regards!

Hi Jeroen,

Assuming that you are really doing what you did say (ajax refreshing the Web Block), as the logical variable is being used in the Visible of the Container and you are not ajax refreshing the container, the system is not storing the variable value in the viewstate of the page, as it is not necessary (optimization), and if the start value is false, the container is not visible (ever) and doing the ajax refresh in the Web Block will not work.

If you give a name to the container and ajax refresh the container, it will start to work.

But if you ARE ajax refreshing the container, than would be nice to have a small module with a single page that reproduces the problem, so we can take a look.

Cheers.

Hi Eduardo,


This is the picture:

When clicking a button, the ShowResults is set to true and the "ShowResults_If" is refreshed.
Maybe it isn't possible to refresh an "If", and they should the "ContainerWrapper"...Don't know why they build an IF around it, because obviously the Display = ShowResults can be set on the ContainerWrapper ?!

Hello Jeroen,

An IF does something different than the Display in a Container. The display just adds a "display:none" to the container, while an IF is used by the server to put or not its content in the page.

The Visible property does the same as the IF, but the IF I can spot right away when I open the page, the Visible property I need to select an element to see if it is there.

Said that, If you are using the local variable ONLY in the IF, the assign to change the variable put before the Ajax Refresh of the IF in the screen action should work (I do this all the time).

If one of the containers AROUND the IF is also using the local variable in the Visible/Display property, that would explain why you are not seeing the web block when starting the variable with False but is seeing when starting with true, as it would not show the container and the ajax is not being applied on it, but in the IF, that will not appear because the container is invisible.

Could be this?

Cheers.

Hi Eduardo,


i think there are not enough ajax-refresh-thingies...
Inside the if there is one container, with another, with another inside. Both depending on another boolean.
If i do a refresh on the first and the last, but not on the 2nd, the 3th will not be visible if the second was not visible in the first place.....
I'll have a little talk with the guy who made this :-)

Hello Jeroen,

Before you do the talk... rs

If you refresh the IF, everything inside will be rebuild. No need to ajax refresh things inside an element you are already refreshing.

This behaviour seems really as something ABOVE the "if" using the variable. In that case, that element (one of the divs), should be refreshed instead of the IF.

Cheers.

Just to be sure:
If i ajax-refresh an IF or a container, everything inside will also be ajax-refreshed?

Exactly.