I want to add a label with an id and an inputfield with an id to a panelgroup (layout box), which has its own id. I expect the label and the inputfield to have the following ids: (viewid):(formid):(panelgroupid):(own id) But somehow the panelgroupid (fachlich1) isnt passed on to the children.
<form id="viewns_Z7_6PQJDK4JGD09F0I34QTLQH2015_:j_id_3" …>
<div id="viewns_Z7_6PQJDK4JGD09F0I34QTLQH2015_:j_id_3:fachlich1">
<label id="viewns_Z7_6PQJDK4JGD09F0I34QTLQH2015_:j_id_3:label" for="viewns_Z7_6PQJDK4JGD09F0I34QTLQH2015_:j_id_3:value">Bla</label>
<input id="viewns_Z7_6PQJDK4JGD09F0I34QTLQH2015_:j_id_3:value" type="text" value="Blubb34534" name="viewns_Z7_6PQJDK4JGD09F0I34QTLQH2015_:j_id_3:value">
</div>
</form>
Any clue what I might be doing wrong? :(
Thanks for your help!
Edit:
i want to create my own component which basically consits of a surrounding div + label + inputtext. i extend from the HtmlPanelGroup and override the encodeBegin method, where i set the layout to block, set the id of the panelgroup,add the components, after which i call super.encodeBegin:
public void encodeBeginn(FacesContext context)
{
setLayout("block");
setId(getId());
HtmlOutputLabel label = new HtmlOutputLabel();
label.setId("label");
label.setFor("value");
label.setValue(getLabel());
getChildren().add(label);
HtmlInputText text = new HtmlInputText();
text.setId("value");
text.setValue(getValue());
getChildren().add(text);
super.encodeBeginn(context)
}