v2021.0.8I have 4 file upload fields in my table
I’m trying to use Row_Rendered event to display text in cases where the a file has not been uploaded yet.
Field type is varchar(255)My Row_Rendered code is like this.
if ($this->Review->CurrentValue == NULL){
$this->Review->CellAttrs["class"] = "bg-danger text-white";
$this->Review->ViewValue = "no file";
}
The CellAttrs[“class”] is being correctly applied based on whether $this->Review->CurrentValue is null or not.
But my modified ViewValue is not being rendered at all.
I am however able to override the view value if the field is NOT NULL
I have also tried the same code above on a varchar(75) field in the same table which also contains a NULL value, and it works fine.It seems to only be an issue with NULL file upload field values.Can someone please try to replicate?
For now I have worked around this problem by setting a default value in the mysql table of ‘nofile’ for that field.It’s not an ideal solution as the text I’m dispalying still gets rendered as if its a link, but I’m working on removing the link styling via CSS class instead.Final solution in case anyone hits this issue:
set Review field’s default value in the MySql table to ‘nofile’, and update all current NULL records to this value.