08-04-2023, 01:04 AM
(This post was last modified: 08-04-2023, 01:05 AM by Alexandre Machado.)
Hi Stéphane,
This was a tough one.
There is a bug when there are multiple levels of frames like this. We have already fixed the bug so the fix will be available in the next release.
There is an easy workaround for you, while the fix is not available:
After creating the IWModalCard you can notify the owner form directly that there was a change (i.e. you have created a control youself), doing:
IWForm.RehashPending := True;
In your project you don't have direct access to the parent main form, however you can obtain it using the owner of the TIWFrameCard itself.
So it would be like:
Please have in mind that after the update this workaround is redundant and should be removed.
Cheers
This was a tough one.
There is a bug when there are multiple levels of frames like this. We have already fixed the bug so the fix will be available in the next release.
There is an easy workaround for you, while the fix is not available:
After creating the IWModalCard you can notify the owner form directly that there was a change (i.e. you have created a control youself), doing:
IWForm.RehashPending := True;
In your project you don't have direct access to the parent main form, however you can obtain it using the owner of the TIWFrameCard itself.
So it would be like:
Code:
uses
uHome, IWForm; // add IWForm here
procedure TIWFrameCard.IWButtonCardAsyncClick(Sender: TObject;
EventParams: TStringList);
var
oModal: TIWFrameModal;
begin
with IWModalCard do
begin
Reset;
//use region from uCard
oModal := TIWFrameModal.Create(Self);
oModal.Name := Owner.Name + '_FrameModal';
oModal.Parent := IWRegionCardModal;
oModal.IWLabelTitle.Caption := 'From button ' + (Sender As TIWButton).Tag.ToString;
ContentElement := IWRegionCardModal;
Autosize := True;
HasHeader := False;
HasFooter := False;
CloseButtonVisible := False;
Show;
end;
// Add this new code
if (Self.Owner is TIWForm) then
TIWForm(Self.Owner).RehashPending := True;
end;Please have in mind that after the update this workaround is redundant and should be removed.
Cheers

