defect
(User-visible)
minor
#26039
Gridcomponent: Display of context menu for new (transient) row object leads to UnsupportedOperationException
This happens in prime and also in newly configured apps, but surprisingly not in TLDemo:
Command 'dispatchControlCommand' failed.
com.top_logic.util.error.TopLogicException: Internal error
at com.top_logic.mig.html.layout.CommandDispatcher.internalDispatchCommand(CommandDispatcher.java:214)
at com.top_logic.mig.html.layout.CommandDispatcher.internalDispatch(CommandDispatcher.java:130)
at com.top_logic.mig.html.layout.CommandDispatcher.dispatchCommand(CommandDispatcher.java:123)
at com.top_logic.base.services.simpleajax.AJAXServlet.processRequest(AJAXServlet.java:638)
at com.top_logic.base.services.simpleajax.AJAXServlet.doPost(AJAXServlet.java:356)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
at com.top_logic.util.TopLogicServlet.doService(TopLogicServlet.java:336)
at com.top_logic.util.TopLogicServlet.inContext(TopLogicServlet.java:193)
at com.top_logic.util.TopLogicServlet$1.inContext(TopLogicServlet.java:268)
at com.top_logic.util.TLContextManager.inInteractionInternal(TLContextManager.java:243)
at com.top_logic.util.TLContextManager.inInteraction(TLContextManager.java:219)
at com.top_logic.util.TopLogicServlet.enterContext(TopLogicServlet.java:263)
at com.top_logic.util.TopLogicServlet.service(TopLogicServlet.java:156)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
Caused by: java.lang.UnsupportedOperationException
at com.top_logic.model.TransientObject.tHandle(TransientObject.java:22)
at com.top_logic.model.TLObject.tTable(TLObject.java:180)
at com.top_logic.layout.provider.LabelProviderService$Registry.searchFallbackModel(LabelProviderService.java:657)
at com.top_logic.layout.provider.LabelProviderService$Registry.lookupModel(LabelProviderService.java:650)
at com.top_logic.layout.provider.LabelProviderService$Registry.lookup(LabelProviderService.java:611)
at com.top_logic.layout.provider.LabelProviderService$ContextCommandRegistry.lookup(LabelProviderService.java:1)
at com.top_logic.layout.provider.LabelProviderService$ContextCommandRegistry.getContextCommands(LabelProviderService.java:549)
at com.top_logic.layout.provider.LabelProviderService.getContextCommands(LabelProviderService.java:449)
at com.top_logic.layout.basic.contextmenu.config.MetaContextMenuCommandsProvider.getContextCommands(MetaContextMenuCommandsProvider.java:36)
at com.top_logic.layout.basic.contextmenu.component.factory.TypeBasedContextMenuFactory$Provider.createProviderButtons(TypeBasedContextMenuFactory.java:172)
at com.top_logic.layout.basic.contextmenu.component.factory.TypeBasedContextMenuFactory$Provider.createButtons(TypeBasedContextMenuFactory.java:165)
at com.top_logic.layout.basic.contextmenu.component.factory.ComponentContextMenuFactory$Provider.createButtons(ComponentContextMenuFactory.java:85)
at com.top_logic.layout.basic.contextmenu.component.factory.SelectableContextMenuFactory$Provider.createButtons(SelectableContextMenuFactory.java:67)
at com.top_logic.layout.basic.contextmenu.component.factory.TypeBasedContextMenuFactory$Provider.getContextMenu(TypeBasedContextMenuFactory.java:139)
at com.top_logic.layout.basic.contextmenu.component.factory.adapter.TypeBasedContextMenuProvider.getContextMenu(TypeBasedContextMenuProvider.java:72)
at com.top_logic.layout.table.control.TableControl.createContextMenu(TableControl.java:397)
at com.top_logic.layout.basic.contextmenu.control.ContextMenuOpener.execute(ContextMenuOpener.java:60)
at com.top_logic.layout.basic.AbstractControlBase.executeCommand(AbstractControlBase.java:888)
at com.top_logic.layout.basic.component.ControlSupport.executeCommand(ControlSupport.java:221)
at com.top_logic.layout.basic.component.ControlComponent$DispatchAction.handleCommand(ControlComponent.java:231)
at com.top_logic.tool.boundsec.CommandHandlerUtil.handleCommand(CommandHandlerUtil.java:27)
at com.top_logic.mig.html.layout.LayoutComponent.dispatchCommand(LayoutComponent.java:3437)
at com.top_logic.mig.html.layout.CommandDispatcher.internalDispatchCommand(CommandDispatcher.java:192)
... 50 more
Analysis
The context menu’s title contains the object for which the context menu is displayed. However, the lookup for the `tl:LabelProvider` fails because it cannot be determined in which table the new grid object is stored (since a LabelProvider fallback can be defined for all types within a table).
Test
- Create a new app.
- Define a new Type A.
- Create a grid view for A.
- Add a "Create Grid" button for A to the view.
- Use the new button to add a new row to the grid, but do not commit or save it.
- Open the context menu over the transient row.
- Expected behavior: The context menu opens and has a title.