RepeatingView list = new RepeatingView("list"); for (final String s : names) { list.add(createLink(list.newChildId(), s)); } add(list);
/** * @see org.apache.wicket.markup.repeater.AbstractRepeater#renderIterator() */ @Override protected Iterator<? extends Component> renderIterator() { return iterator(); }
public <C extends Component> C newComponent(IBSComponentFactory<C> factory) { C comp = factory.newComponent(items.newChildId()); items.add(comp); return comp; }
public ColGroup(String id) { super(id); this.colgroupCols = new RepeatingView("col"); add(colgroupCols); }
@Override public StructureTableCommandsToolbar<P> addCommand(Command<P> command) { commands.add(command); return this; }
/** * Generates a unique id string. This makes it easy to add items to be rendered w/out having to * worry about generating unique id strings in your code. * * @return unique child id */ public String newChildId() { return areas.newChildId(); }
private void addCalendarHead() { WebMarkupContainer calendarHead = new WebMarkupContainer("calendarHead"); calendar.add(calendarHead); RepeatingView dayHeads = new RepeatingView("dayHead"); calendarHead.add(dayHeads); final DateTimeFormatter dayOfWeekFormatter = DateTimeFormat.forPattern("E"); for(int i=0; i<7; i++) dayHeads.add(new Label(""+i, dayOfWeekFormatter.print(model.getWeek().getFirstDay().plusDays(i)))); }
/** * Adds a repeater as child if not already exist. You can't use both: {@link #newChildId()} and add a child with {@link #CHILD_ID}. * @see RepeatingView#newChildId() */ public String newChildId() { if (repeater == null) { repeater = new RepeatingView("child"); div.add(repeater); } return repeater.newChildId(); }
private void rebuildAttendees() { attendeesRepeater.removeAll(); for (final TeamEventAttendeeDO attendee : attendees) { final WebMarkupContainer item = new WebMarkupContainer(attendeesRepeater.newChildId()); attendeesRepeater.add(item); item.add(new AttendeeEditableLabel("editableLabel", Model.of(attendee), false)); final DropDownChoice<TeamEventAttendeeStatus> statusChoice = new DropDownChoice<TeamEventAttendeeStatus>("status", new PropertyModel<TeamEventAttendeeStatus>(attendee, "status"), statusChoiceRenderer.getValues(), statusChoiceRenderer); statusChoice.setEnabled(false); item.add(statusChoice); } }
@Override protected void onConfigure() { super.onConfigure(); menus.replaceWith((menus = new RepeatingView("menus"))); this.setVisible(menus.size() > 0); } }
public FieldsetPanel removeAllFields() { fieldsRepeater.removeAll(); return this; }
@Override protected void addHeadColumns(final RepeatingView headColRepeater) { headColRepeater.add(new Label(headColRepeater.newChildId(), getString("id"))); headColRepeater.add(new Label(headColRepeater.newChildId(), getString("fibu.employee.user"))); final List<AttrColumnDescription> attrColumnsInSheet = parentPage.getAttrColumnsInSheet(); if (attrColumnsInSheet != null) { attrColumnsInSheet.forEach( desc -> headColRepeater.add(new Label(headColRepeater.newChildId(), getString(desc.getI18nKey()))) ); } }
/** * Constructor * * @param id */ private ToolbarsContainer(final String id) { super(id); toolbars = new RepeatingView("toolbars"); add(toolbars); }
/** * adds a component to the given position inside the navbar * * @param component the component to add * @return this component instance for chaining */ public final Navbar addComponents(final NavbarText component) { extraItems.add(component); return this; }
/** * Generates a unique id string. This makes it easy to add items to be rendered w/out having to * worry about generating unique id strings in your code. * * @return unique child id */ public String newChildId() { return areas.newChildId(); }
private void addHourLabels(WebMarkupContainer calendarBody) { WebMarkupContainer calendarTime = new WebMarkupContainer("calendarTime"); calendarBody.add(calendarTime); RepeatingView calendarTimeEntries = new RepeatingView("calendarTimeEntry"); calendarTime.add(calendarTimeEntries); int hour = 0; for(String hourLabel : hourLabels) { calendarTimeEntries.add(new Label(""+hour, hourLabel).add(new SimpleAttributeModifier("style", "height: "+hourHeight+"px"))); hour++; } }
public String newIconChildId() { if (iconContainer == null) { iconContainer = new RepeatingView("icons"); fieldset.add(iconContainer); } return iconContainer.newChildId(); }
public BSModalBorder removeButtons() { buttonsContainer.removeAll(); return this; }
RepeatingView repeating = new RepeatingView("repeating"); for (Service service : databaseService.getAllServices()) { AbstractItem item = new AbstractItem(repeating.newChildId()); repeating.add(item); ...