Page 1 of 2

Button Icon disappear on caption modified

PostPosted: 17 Nov 2015 12:13
by feland
Hi,
I insert an icon in jqbutton.jqbuttonOptions.Icons.Picture and I see it.
When i run my application I change on runtime the caption of the button and the images disappear.
Why??

Best Regard

Re: Button Icon disappear on caption modified

PostPosted: 17 Nov 2015 12:44
by assapan
Hi,
could you tell us how you change the caption ?

Re: Button Icon disappear on caption modified

PostPosted: 17 Nov 2015 14:08
by feland
At start the button is hidden.

These is the code used to show the button and change the caption:

JQButton.Caption:='Insert';
JQButton.show;

Re: Button Icon disappear on caption modified

PostPosted: 17 Nov 2015 15:10
by assapan
Check the renderinvisiblecontrol property of the button owner and also AjaxRerender of the button

Re: Button Icon disappear on caption modified

PostPosted: 17 Nov 2015 16:08
by feland
I don't solve the problem.

I set the property RenderInvisibleControls of the JQRegion that contain my button at true and i call the method AjaxRerender of the button.

I post the code that i used:

procedure TfrmUsersManagement.btnInsertJQButtonOptionsClick(Sender: TObject; AParams: TStringList);
begin
btnConfirm.Caption := 'Insert';
btnConfirm.Show;
btnConfirm.AjaxReRender();
RenderRegionAsync(RegionData, false, true);
end;

Re: Button Icon disappear on caption modified

PostPosted: 17 Nov 2015 16:19
by assapan
try to replace btnConfirm.Show by btnConfirm.visible:=True;

Re: Button Icon disappear on caption modified

PostPosted: 17 Nov 2015 16:28
by feland
I obtain the same result as before

Re: Button Icon disappear on caption modified

PostPosted: 17 Nov 2015 16:35
by Alexander Bulei
Hi feland,

btnConfirm.Caption := 'Insert';
btnConfirm.Show;
btnConfirm.AjaxReRender();
RenderRegionAsync(RegionData, false, true);


First, you don't need use neither AjaxReRender nor RenderRegionAsync just for this propose, because Caption propery supports async change, as the method Show.

jqbutton.jqbuttonOptions.Icons.Picture


Are you using the Primary or PrimaryPicture property?

Best Regards.

Re: Button Icon disappear on caption modified

PostPosted: 17 Nov 2015 16:48
by assapan
Hi alex,
I thing i found problem , if you set primarypicture with a picture after setting caption , image disappear see demo

Re: Button Icon disappear on caption modified

PostPosted: 17 Nov 2015 17:04
by Alexander Bulei
Hi assapan,
It seems, this only happens when PrimaryPictureInTextSpan is False.
I will investigate this case.
Thanks.

Best Regards.