add panelItems and panelIndex
stop at last panelItem