public class TabLabelComponent extends UIPanel {
private static int id = 0;
/** Creates a new instance of TabLabelComponent */
public TabLabelComponent() {
setId("tab_" + id);
UIGraphic leftTabEnd = new UIGraphic();
leftTabEnd.setUrl("images/left_unselected.gif");
leftTabEnd.setId("left_" + id);
UIGraphic rightTabEnd = new UIGraphic();
rightTabEnd.setUrl("images/right_unselected.gif");
rightTabEnd.setId("right_" + id);
UIOutput tabTitle = new UIOutput();
tabTitle.setValue("Tab");
tabTitle.setId("title_" + id);
UIGraphic closeIcon = new UIGraphic();
closeIcon.setUrl("images/close.gif");
closeIcon.setId("closeIcon_" + id);
HtmlCommandLink close = new HtmlCommandLink();
close.addActionListener(new CloseListener());
close.setId("close_" + id);
close.getChildren().add(closeIcon);
List kids = getChildren();
kids.add(leftTabEnd);
kids.add(tabTitle);
kids.add(close);
kids.add(rightTabEnd);
id++;
}
}
Can anybody spot any error in it ? I mean, why that error ?
I found the same problem here, but there is no solution to it:
http://mail-archives.apache.org/mod_mbox/myfaces-users/200511.mbox/[EMAIL PROTECTED]
Thank you,
Ionut
Ionut S <[EMAIL PROTECTED]> wrote:
Anybody cares to help ?
Ionut S <[EMAIL PROTECTED]> wrote:Hi there,
I have created a custom components that agregates 2 other components. The component works just fine until a submit is performed. Then I get the following error:
..............
14:57:10,531 WARN [HtmlGridRendererBase] PanelGrid _id0:holder has not enough children. Child count should be a multiple of the columns attribute.
14:57:11,240 ERROR [[Faces Servlet]] Servlet.service() for servlet Faces Servlet threw exception
java.lang.IndexOutOfBoundsException: Index: 1, Size: 1
at java.util.ArrayList.RangeCheck(ArrayList.java:546)
at java.util.ArrayList.get(ArrayList.java:321)
at javax.faces.component.UIComponentBase.processRestoreState(UIComponentBase.java:499)
at javax.faces.component.UIComponentBase.processRestoreState(UIComponentBase.java:502)
at javax.faces.component.UIComponentBase.processRestoreState(UIComponentBase.java:502)
...............
I set ids for all the children in the custom component and also for the component itself. Is somebody who had this problem before ?
Thank you,
Ionut
Love cheap thrills? Enjoy PC-to-Phone calls to 30+ countries for just 2�/min with Yahoo! Messenger with Voice.
New Yahoo! Messenger with Voice. Call regular phones from your PC and save big.
Do you Yahoo!?
Get on board. You're invited to try the new Yahoo! Mail Beta.

