Reputation: 336
I have a table extended main class (table_A). Inside table_A class i have a method which function is to add new table (table_b) into my table_A (for achieving scrollpane result), at the same time assign click listener to the table_b.
I though by adding clicklistener (ck) to table_b will makes table_b detectable. However, only the elements in the table_b able to make detection from clicklistener.
Please help
My table_A adding table function as follow:
public void addRow(Table newRow){
scrollTable.row();
scrollTable.add(newRow).width(newRow.getWidth()).pad(10);
newRow.addListener(ck);
newRow.debug();
newRow.setName(stage++ +"");
}
My debug table goes as:
My table_b codes goes as:
add(challengeLabel).colspan(10).expandX().align(Align.left).fill();
row();
add(star1).colspan(1).size(starSpaceWidth, star1.getHeight() / star1.getWidth() * starSpaceWidth).expandX().fillX().align(Align.right);
add(star2).colspan(1).size(starSpaceWidth, star1.getHeight() / star1.getWidth() * starSpaceWidth);
add(star3).colspan(1).size(starSpaceWidth, star1.getHeight() / star1.getWidth() * starSpaceWidth);
add(star4).colspan(1).size(starSpaceWidth, star1.getHeight() / star1.getWidth() * starSpaceWidth);
add(star5).colspan(1).size(starSpaceWidth, star1.getHeight() / star1.getWidth() * starSpaceWidth);
Upvotes: 0
Views: 62
Reputation: 1791
If you take a look in Table's constructor, you see this line:
setTouchable(Touchable.childrenOnly);
It is causing your troubles. Change it for your table_B.
Upvotes: 3