It would be good for you to send your code to understand where you went wrong when you used onEvent. Already with the addPenListener, you must have confused with addPressListener.
Follow the code for creating an accordion with a Button inside, which when you click fires a popup with a message.
public class AccordionTela extends Container {
AccordionContainer ac;
Label lb;
public AccordionTela(){
setBackColor(Color.WHITE);
}
public void initUI(){
ac = new AccordionContainer();
ac.setFont(font.asBold());
add(ac, CENTER, TOP+30, PARENTSIZE+85, PREFERRED);
ac.setBackForeColors(0xadd8e6,Color.BLACK);
ac.add(ac.new Caption("Legenda"), LEFT, TOP, FILL, PREFERRED);
lb = new Label("Texto");
ac.add(lb,LEFT,AFTER,FILL,PREFERRED);
Button bt = new Button("botão");
bt.setBackForeColors(Color.WHITE, Color.BLACK);
ac.add(bt,LEFT,AFTER,PREFERRED+10,PREFERRED+10);
bt.addPressListener(e -> {
new MessageBox("Aviso","Dados atualizados").popup();
});
}
}