2013 Oct 30 1:03 PM
Hello.
I have a normal screen with two subscreens which has to be shown or hidden depending on a condition. These subscreens are between other elements, in the middle.
With the first subscreen there is no problem. It has only fields and labels, and at PBO I set to invisible all of them, and the subscreen does not appear, neither the space of it (the rest of elements below it goes up).
But when I do the same with the second, which has a custom control, I can't set invisible this element, it is not in the screen and I can't process it in the "loop at screen". The result is that the space of the custom control (uninitialized) remains there, between the other elements.
How can I do to hide the subscreen and its space?
Thanks in advance
2013 Oct 30 1:26 PM
Hi,
Try the below option, if you are not able to achieve by element properties..
Create a new blank sub screen and call it dynamically.
If you want to have the custom control, then call the existing screen as sub screen. If you dont want the custom control in display, pass the new sub screen number to call the sub screen.
Thanks,
Balu.
Hi,
Try the below option, if you are not able to achieve by element properties..
Create a new blank sub screen and call it dynamically.
If you want to have the custom control, then call the existing screen as sub screen. If you dont want the custom control in display, pass the new sub screen number to call the sub screen.
Thanks,
Balu.
2013 Oct 30 1:17 PM
PD: This method:
CALL METHOD go_custom_container->set_visible
EXPORTING
visible = cl_gui_control=>visible_false.
Is not valid, because the space remains, is the same result that uninicializate it.
2013 Oct 30 1:26 PM
Hi,
Try the below option, if you are not able to achieve by element properties..
Create a new blank sub screen and call it dynamically.
If you want to have the custom control, then call the existing screen as sub screen. If you dont want the custom control in display, pass the new sub screen number to call the sub screen.
Thanks,
Balu.
2013 Oct 30 1:47 PM
Thanks, I had tried it and it works, but I want a cleaner solution (I think probably is imposible).
2013 Oct 30 1:51 PM
Hi
in second screen PBO ,check your condition and if the condition is ok then decide about creating custom control object and also write :
for example:
Data:Guitxt type ref to cl_gui_textedit,
container1 type ref to cl_gui_custom_container.
I want to load a gui text in customer control .
if not condition is ok ." you dont want to display
if Guitxt is initial ." TEXT
create object: container1 exporting container_name = 'XUST1'.
create object:
Guitxt exporting parent = container1.
endif.
endif .
if condition ok .
LOOP AT SCREEN.
SCREEN-invisible = 1 .
MODIFY SCREEN .
ENDLOOP.
ENDIF.
I checked it.ıf you did not understand please inform me to put here code completely.
Reza Rostami - Saphiran.com
2013 Oct 30 2:30 PM
Thanks, but I didn't create the object. The blank space, the "square" painted in the screen painter (in your example, the custom container 'XUST1'), remains without the container creation.
2013 Oct 30 3:27 PM
| User | Count |
|---|---|
| 6 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |