JohnM
(John Mooney)
April 24, 2018, 8:56am
#1
Hi,
I have a screen that has a few tabs on it. The main tab has a field group to edit the main details and the other tabs are lazy loaded so when the tab is selected I load a frame in to the tab.
I have a weird situation where the frame loads fine but the Create/Edit/Remove options are disabled and when I go back to the main tab the fieldgroup is all disabled.
I don’t know what is going on or where I should be looking. No errors are thrown and nothing weird is in the logs.
Does anyone have any hints or has seen this before?
JohnM
(John Mooney)
April 24, 2018, 10:04am
#2
I think I have tracked down the issue. I have raised it on Github here
opened 10:03AM - 24 Apr 18 UTC
closed 02:59PM - 23 May 19 UTC
state: won't fix
Hi,
I think there is an issue with using a Combined Screen within a TabSheet.…
I'll try to explain.
I have a screen with multiple tabs. In a tab I have placed a frame with a Combined Browse/Edit screen. When I switch to the tab containing the combined screen a lot of the elements go in to read only mode.
What is happening is this.
In the EntityCombinedScreen there is a method getTabSheet which looks for a TabSheet component with a specific ID "tabSheet". When getTabSheet() is called from within initEditComponents it actually locates the TabSheet in the parent frame which happens to be called "tabSheet" the sets everything to readonly.
The getTabSheet call ends up in ComponentHelper.getFrameComponent with the correct frame as a parameter and the id = "tabSheet". Since the CombinedScreen has no TabSheet or component with id "tabSheet" the code drops in to frame.getFrame().getComponent(id) which locates the TabSheet with id "tabSheet" in the parent frame.
So I guess why, if you want to find a component of a Frame using ComponentHelper.getFrameComponent would it traverse up the tree to check parents?
Is there a method to check ONLY children and not traverse backwards to parents?
This kind of makes combined screens a bit unusable in frames. I suspect a workaround might be to either add a dummy tabsheet to the combined screen or give the parent screen's TabSheet an id other than "tabSheet"