cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamic programming: Add transparent container to root container

Former Member
0 Kudos

Hi all,

I'm trying to add a transparent container to the root container,

but I´m getting this error: 'ASSERT condition was violated'


METHOD WDDOMODIFYVIEW .

  DATA: LR_ROOT       TYPE REF TO CL_WD_UIELEMENT_CONTAINER,
        LR_TCONTAINER TYPE REF TO CL_WD_TRANSPARENT_CONTAINER.

  LR_ROOT ?= VIEW->GET_ROOT_ELEMENT( ).

  LR_TCONTAINER = CL_WD_TRANSPARENT_CONTAINER=>NEW_TRANSPARENT_CONTAINER( ).

  CL_WD_FLOW_DATA=>NEW_FLOW_DATA( LR_TCONTAINER ).

  LR_ROOT->ADD_CHILD( LR_TCONTAINER ).

ENDMETHOD.

Is something wrong with this code?

Thank you.

Regards,

Thomas

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

I have the same problem.

I am getting the error "The ASSERT condition was violated".

I have reduced my code to just simply add a transparent container to the rootuielement and I am getting the error.

I could not figure out why. Does anyone have info on this? Thanks.

Giscard

Former Member
0 Kudos

>

> I have the same problem.

> I am getting the error "The ASSERT condition was violated".

>

> I have reduced my code to just simply add a transparent container to the rootuielement and I am getting the error.

>

> I could not figure out why. Does anyone have info on this? Thanks.

>

> Giscard

My problem was the layout, after I added it, the problem was solved.

METHOD WDDOMODIFYVIEW .

DATA: LR_ROOT TYPE REF TO CL_WD_UIELEMENT_CONTAINER,

LR_TCONTAINER TYPE REF TO CL_WD_TRANSPARENT_CONTAINER.

LR_ROOT ?= VIEW->GET_ROOT_ELEMENT( ).

LR_TCONTAINER = CL_WD_TRANSPARENT_CONTAINER=>NEW_TRANSPARENT_CONTAINER( ).

CL_WD_FLOW_DATA=>NEW_FLOW_DATA( LR_TCONTAINER ).

CL_WD_FLOW_LAYOUT=>NEW_FLOW_LAYOUT( LR_TCONTAINER ).

LR_ROOT->ADD_CHILD( LR_TCONTAINER ).

ENDMETHOD.

Hope it helps you.

Regards,

Thomas

Former Member
0 Kudos

Thomas your a life saver.

Late in the day is not the best time to do complicated dynamic layouts, and thats when you forget what needs to be done.

CL_WD_FLOW_LAYOUT=>NEW_FLOW_LAYOUT( LR_TCONTAINER ).

After adding a container, always got to remember to set the layout! Argh! In my case it was a grid!!

Thanks again!!

Former Member
0 Kudos

Hi Thomas,

I think this error is coming because of some data confict in ur component.

And the data conflict is occuring because of this code.

otherwise the code is correct.

Please check the whole code and do a manual run.

Regards,

Sumit

Former Member
0 Kudos

Thomas,

I tested the same code and it is working fine