{"record":{"id":"b03f27faa05fbaef","repo":"theonedev/onedev","slug":"cannot-update-component-that-does-not-have-setoutp","errorCode":null,"errorMessage":"cannot update component that does not have setOutputMarkupId property set to true. Component: {component.toString()}","messagePattern":"cannot update component that does not have setOutputMarkupId property set to true\\. Component: (.+?)","errorType":"exception","errorClass":"java.lang.IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"server-core/src/main/java/org/apache/wicket/protocol/ws/api/WebSocketRequestHandler.java","lineNumber":152,"sourceCode":"\t\t\t\t\t\tOneDev.getInstance(WebSocketService.class).observe((BasePage) getPage());\n\t\t\t\t\tsuper.onAfterRespond(response);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t};\n\t\t}\n\t\treturn update;\n\t}\n\n\t@Override\n\tpublic void add(Component... components)\n\t{\n\t\tfor (final Component component : components)\n\t\t{\n\t\t\tArgs.notNull(component, \"component\");\n\n\t\t\tif (component.getOutputMarkupId() == false)\n\t\t\t{\n\t\t\t\tthrow new IllegalArgumentException(\n\t\t\t\t\t\t\"cannot update component that does not have setOutputMarkupId property set to true. Component: \" +\n\t\t\t\t\t\t\t\tcomponent.toString());\n\t\t\t}\n\t\t\tadd(component, component.getMarkupId());\n\t\t}\n\t}\n\n\t@Override\n\tpublic final void addChildren(MarkupContainer parent, Class<?> childCriteria)\n\t{\n\t\tArgs.notNull(parent, \"parent\");\n\t\tArgs.notNull(childCriteria, \"childCriteria\");\n\n\t\tparent.visitChildren(childCriteria, new IVisitor<Component, Void>()\n\t\t{\n\t\t\t@Override\n\t\t\tpublic void component(final Component component, final IVisit<Void> visit)\n\t\t\t{","sourceCodeStart":134,"sourceCodeEnd":170,"githubUrl":"https://github.com/theonedev/onedev/blob/d44925c47c37992c828ea673a5f9620539bc3ff2/server-core/src/main/java/org/apache/wicket/protocol/ws/api/WebSocketRequestHandler.java#L134-L170","documentation":"WebSocketRequestHandler.add(components...) re-renders components on the client via JavaScript, which requires each component's HTML id attribute to be present in the markup. Wicket only renders that id when setOutputMarkupId(true) is set, so any component with outputMarkupId==false throws IllegalArgumentException immediately. The component is never partially updated; the whole request fails.","triggerScenarios":"Calling webSocketRequestHandler.add(component) (or add(c1, c2, ...)) where at least one component never had setOutputMarkupId(true) called, including via setOutputMarkupPlaceholderTag(true).","commonSituations":"Adding components created in code without markup id output; a component moved between pages/handlers; newly added children in an AJAX/WS handler that were assumed to inherit the setting (they do not).","solutions":["Call setOutputMarkupId(true) on the component in its constructor or onInitialize before it is added to the handler","Set it once in the component class so every instance is updatable","If you must add many components, iterate and set the flag before handler.add"],"exampleFix":"// before\nLabel name = new Label(\"name\", model);\ntarget.add(name); // throws\n// after\nLabel name = new Label(\"name\", model);\nname.setOutputMarkupId(true);\ntarget.add(name);","handlingStrategy":"validation","validationCode":"// Java\nif (!component.getOutputMarkupId()) {\n    component.setOutputMarkupId(true);\n}\nhandler.add(component);","typeGuard":null,"tryCatchPattern":"try {\n    handler.add(component);\n} catch (IllegalArgumentException e) {\n    log.warn(\"Component not repaintable, missing markup id\", e);\n}","preventionTips":["Call setOutputMarkupId(true) in every component you intend to repaint via AJAX/WS","Remember setOutputMarkupPlaceholderTag(true) also sets the flag","Set the flag in the component's constructor, not at usage time","Code-review repaint targets for the flag"],"tags":["wicket","ajax","markup-id"],"backgroundTag":"invalid-argument-value","analyzedSha":"d44925c47c37992c828ea673a5f9620539bc3ff2","analyzedAt":"2026-09-06T07:18:27.995Z","contentChangedAt":"2026-09-06T07:18:27.995Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}