{"record":{"id":"0db2d9228fdb4d95","repo":"theonedev/onedev","slug":"markup-id-set-on-a-component-that-is-usually-not-r","errorCode":null,"errorMessage":"Markup id set on a component that is usually not rendered into markup. Markup id: %s, component id: %s, component tag: %s.","messagePattern":"Markup id set on a component that is usually not rendered into markup\\. Markup id: (.+?), component id: (.+?), component tag: (.+?)\\.","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"warning","filePath":"server-core/src/main/java/org/apache/wicket/Component.java","lineNumber":4091,"sourceCode":"\t\t\tif ((tag instanceof WicketTag) && !tag.isClose() &&\n\t\t\t\t!getFlag(FLAG_IGNORE_ATTRIBUTE_MODIFIER))\n\t\t\t{\n\t\t\t\tExceptionSettings.NotRenderableErrorStrategy notRenderableErrorStrategy = ExceptionSettings.NotRenderableErrorStrategy.LOG_WARNING;\n\t\t\t\tif (Application.exists())\n\t\t\t\t{\n\t\t\t\t\tnotRenderableErrorStrategy = getApplication().getExceptionSettings().getNotRenderableErrorStrategy();\n\t\t\t\t}\n\n\t\t\t\tString tagName = tag.getNamespace() + \":\" + tag.getName();\n\t\t\t\tString componentId = getId();\n\t\t\t\tif (getFlag(FLAG_OUTPUT_MARKUP_ID))\n\t\t\t\t{\n\t\t\t\t\tString message = String.format(\"Markup id set on a component that is usually not rendered into markup. \" +\n\t\t\t\t\t                               \"Markup id: %s, component id: %s, component tag: %s.\",\n\t\t\t\t\t                               getMarkupId(), componentId, tagName);\n\t\t\t\t\tif (notRenderableErrorStrategy == ExceptionSettings.NotRenderableErrorStrategy.THROW_EXCEPTION)\n\t\t\t\t\t{\n\t\t\t\t\t\tthrow new IllegalStateException(message);\n\t\t\t\t\t}\n\t\t\t\t\tlog.warn(message);\n\t\t\t\t}\n\t\t\t\tif (getFlag(FLAG_PLACEHOLDER))\n\t\t\t\t{\n\t\t\t\t\tString message = String.format(\n\t\t\t\t\t\t\t\"Placeholder tag set on a component that is usually not rendered into markup. \" +\n\t\t\t\t\t\t\t\"Component id: %s, component tag: %s.\", componentId, tagName);\n\t\t\t\t\tif (notRenderableErrorStrategy == ExceptionSettings.NotRenderableErrorStrategy.THROW_EXCEPTION)\n\t\t\t\t\t{\n\t\t\t\t\t\tthrow new IllegalStateException(message);\n\t\t\t\t\t}\n\t\t\t\t\tlog.warn(message);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Write the tag\n\t\t\ttag.writeOutput(getResponse(), !needToRenderTag(null),","sourceCodeStart":4073,"sourceCodeEnd":4109,"githubUrl":"https://github.com/theonedev/onedev/blob/d44925c47c37992c828ea673a5f9620539bc3ff2/server-core/src/main/java/org/apache/wicket/Component.java#L4073-L4109","documentation":"When a component that normally contributes no markup (e.g. a Border's body or transparent resolver components) gets a markup id requested during render, Wicket warns and, if ExceptionSettings.NotRenderableErrorStrategy is THROW_EXCEPTION, throws IllegalStateException with the markup id, component id and tag name. It signals a request for an HTML id attribute on a component that will never be written to the response.","triggerScenarios":"Calling setOutputMarkupId(true)/getMarkupId() on a component that is not rendered into markup (e.g. inside a transparent markup resolver or a Border body), with NotRenderableErrorStrategy set to THROW_EXCEPTION.","commonSituations":"Applications enabling strict not-renderable strategy in ExceptionSettings; AJAX-updating components that turn out to be non-renderable; misuse of setOutputMarkupId(true) inside borders.","solutions":["Remove setOutputMarkupId(true)/markup-id usage from the non-renderable component, or move it to a renderable parent container.","Wrap the component in a WebMarkupContainer that is rendered and set the markup id on the container.","Switch ExceptionSettings.NotRenderableErrorStrategy to LOG_WARNING if the warning is acceptable."],"exampleFix":"// before\nLabel hidden = new Label(\"x\", \"v\");\nhidden.setOutputMarkupId(true); // not rendered into markup\nborder.add(hidden);\n// after\nWebMarkupContainer wrap = new WebMarkupContainer(\"x\");\nwrap.setOutputMarkupId(true);\nwrap.add(new Label(\"inner\", \"v\"));\nborder.add(wrap);","handlingStrategy":"validation","validationCode":"if (!component.isVisibleInHierarchy() || component instanceof Border.BorderBodyContainer) {\n    // do not setOutputMarkupId on non-renderable components\n}","typeGuard":null,"tryCatchPattern":"try { component.getMarkupId(); } catch (IllegalStateException e) { component = wrapInContainer(component); }","preventionTips":["Only call setOutputMarkupId(true) on components that render their own tag.","Set NotRenderableErrorStrategy to LOG_WARNING unless strict checking is needed.","Wrap border-body or transparent-resolver content in a WebMarkupContainer when AJAX updates are required."],"tags":["wicket","markup","rendering","configuration"],"backgroundTag":"invalid-config-value","analyzedSha":"d44925c47c37992c828ea673a5f9620539bc3ff2","analyzedAt":"2026-09-06T07:18:27.995Z","contentChangedAt":"2026-09-06T07:18:27.995Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}