I have an async table with remove row button in it. User is allowed to remove all the rows from the table. If all the rows are moved, then I want to hide the table (which now consists only of header and footer). Over “Remove Row” button, I used a custom script and used following code to get number of rows in the table and if it’s zero, then hide the table.
I have used setVisible() function all over the places in the portal and it all works fine. I am doing refresh on the hideable panel in “Remove Row” button’s on-click event.
Looks like something is wrong in the way I am using getRowCount() to retrieve number of rows in the table.
Is your custom script control rendered inside of a table column? In that case your clientId expressions would resolve to the id of the row of the table that is currently being rendered, instead of the clientId of the table control itself.
Perhaps you could just use a table row change listener that is in a script block control that is rendered after the table control whose value is something like this:
If you get rid of that Custom Script control inside the table column and add a new “Script Block” control after the table control with the snippet I specified earlier, it should work for you.