GroupSection Specs
@GroupSectionSpec
class FooSectionSpec {
@OnCreateChildren
static Children onCreateChildren(
SectionContext c,
@Prop String headerTitle,
@Prop List<String> data) {
return Children.create()
.child(
SingleComponentSection.create(c)
.component(
Text.create(c)
.text(headerTitle)
.build()))
.child(
DataDiffSection.<String>create(c)
.data(data)
.renderEventHandler(FooSection.onRender(c)))
.build();
}
@OnEvent(RenderEvent.class)
static ComponentRenderInfo onRender(
SectionContext c,
@FromEvent String item) {
return ComponentRenderInfo.create(c)
.component(
Text.create(c)
.text(item)
.build())
.build();
}
}Last updated
