Hi,
I attachment simple project to reproduce the problem:
On click button event I added code like below:
procedure TForm1.WebButton1Click(Sender: TObject);
begin
if(Self.WebButton1.Tag=0)then
begin
Self.WebButton1.Tag:=1;
Self.WebButton1.Caption:='<i class="material-icons">settings</i>Logout';
end
else
begin
Self.WebButton1.Tag:=0;
Self.WebButton1.Caption:='<i class="material-icons">lock</i>Login';
end;
console.log(WebButton1.Caption);
end;
The button should change the caption when clicked, but it only works when I'm not using the template and linking the template to the button via id.
Steps to reproduce:
- Run the example project and click button. The button caption should change but it doesn't work.
- Clean property ElementID for the webButton1 object, now all is working properly.
Why?
buttscratch.zip (1.4 MB)