However, it only works correctly if I display only one row per page. If I set it to more than one row, it doesn’t work correctly.
I’m using the Detail Preview extension.
Can anyone help me?
Thanks
I’ve tried it and it doesn’t work.
The way I posted it works partially.
On the first line of the page it works until it finds a different condition, until then it’s working. From this point on, it responds to this condition until the end of the page, disregarding the adverse conditions. On the next page, it meets the first line and so on.
I tested the example in the help file, in the posts here in the group, but this was the best I could find so far.
Reading the help file more carefully, I found the following note: “Note Do NOT try to show/hide a column dynamically by setting the Visible property of the list option in this event. If the column is visible in one row but invisible in another, the table will be malformed.”
So, there is no way to solve it?
I had already tried it, following the help file and here on the forum.
I tried:
if ($this->MyField->CurrentValue == “xxx”) {
$this->ListOptions->Items[“new”]->Body = “yyy”;
} else {
$this->ListOptions->Items[“new”]->clear(); // Set Body = “”
}
which displays the following error: “Call to a member function Clear() on null”
I also tried:
$this->ListOptions->Items[“new”]->Body = “”
which displays the error: “Attempt to assign property “Body” on null”
Are you sure your code is correct? It seems you were trying to add a new column named “new”. If so, make sure you have already written the related code to create that new column in ListOptions_Load server event, too.