Sorry , i forgot a word.
You will see code like below,
<thtmlb:areaFrameSetter toolbarButtons = "<%= controller->GT_BUTTONS %>"
maxButtonNumber = "3" />
what i mean is ,
if you want to hidden the button, add a line of code in the .htm and make it like below.
<% REFRESH controller->GT_BUTTONS .
%>
<thtmlb:areaFrameSetter toolbarButtons = "<%= controller->GT_BUTTONS %>"
maxButtonNumber = "3" />
and if you want to display only ,just change the code.
data: l_display type c.
l_dislpay = abap_true.
<chtmlb:config displayMode = "<%= l_display. %>"
Maybe your .HTM is not the same with my example, i think it has similar code , your can also add your condition codes for disabled the button in the .HTM.
In my solution it works well, wish this can help you.
Best regards.