Jump to content

Parent.OwnerForm must be same as Self.OwnerForm


RobYost

Recommended Posts

The code below only gives me an error if I have more than one session that uses the same frame fraTenantDetails.

 

Do I have something declared that is used in multiple sessions?  If so, where would I look?

 

 

 

        if (fraTenantDetails = nil) then
          fraTenantDetails := TfraTenantDetails.Create(self);

        fraTenantDetails.Align := alClient;
        fraTenantDetails.Parent := tsTenant; <===This line fails

 

tsTenant is a TUniTabSheet

fraTenantDetails is a TUniFrame

 

 

Project  raised exception class EAssertionFailed with message 'TUniSimplePanel.SetParent(): Parent.OwnerForm must be same as Self.OwnerForm (H:\Framework\uniGUI\Source\Core\uniGUIClasses.pas, line 4837)'.

 

 

Link to comment
Share on other sites

unit fTenantDetails;

interface

uses

...

type
  TfraTenantDetails = class(TUniFrame)
    pgTenantBottom: TUniPageControl;
    tsScheduledCharges: TUniTabSheet;
    UniSimplePanel1: TUniSimplePanel;
    sgRecurringCharges: TUniStringGrid;
    tsLease: TUniTabSheet;
    lblLeaseBegin: TUniLabel;
    dateLeaseBegin: TUniDateTimePicker;
  
  
    edtRoommateName: TUniEdit;
    edtRoommateAddress: TUniMemo;
    edtRoommateOther: TUniMemo;
    tsTenantNotes: TUniTabSheet;

...
    procedure UniFrameCreate(Sender: TObject);
    procedure pgTenantBottomChange(Sender: TObject);
  private
    procedure LoadScheduledCharges();
    function rtnDateRangeDesc(StartDate, EndDate: TDate): string;
  public
    { Public declarations }
  end;

var
  fraTenantDetails: TfraTenantDetails;

implementation

{$R *.dfm}

uses

Link to comment
Share on other sites

What is owner of tsTenant?

What is owner of fraTenantDetails?

 

They both must be owned by same Form or Frame.

tsTenant is a tabsheet on the main form.

 

 

This is created in the main form.

procedure TfrmMain.LoadEntity(aNode: TUniTreeNode);

begin

  ...

        if (fraTenantDetails = nil) then

          fraTenantDetails := TfraTenantDetails.Create(self);

 

        fraTenantDetails.Align := alClient;

        fraTenantDetails.Parent := tsTenant; { TODO 1: core dump }

 

 

 

 

end;

Link to comment
Share on other sites

When I moved

   fraTIncome: TfraTIncome;

Public declarations area of (TfraTIncome) I couldn't figure out how to reference it.

 

Do I add this?

.

 

function TfraTIncome: TfraTIncome;
begin
  Result := TfraTIncome(UniMainModule.GetFormInstance(TfraTIncome));
end;

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...