public static void addRowClick(final Item<?> cellItem) { final Item<?> row = (cellItem.findParent(Item.class)); WicketUtils.addRowClick(row); }
@Override protected void onEvent(AjaxRequestTarget target) { ListDataTable dataTable = item.findParent(ListDataTable.class); dataTable.getSelectionListener().selectionChanged(model); } });
@Override public void populateItem(Item<ICellPopulator<ExternalSearchResult>> cellItem, String componentId, IModel<ExternalSearchResult> model) { @SuppressWarnings("rawtypes") Item rowItem = cellItem.findParent( Item.class ); int rowIndex = rowItem.getIndex(); ResultRowView rowView = new ResultRowView(componentId, rowIndex + 1, model); cellItem.add(rowView); } });
@Override public void populateItem(Item<ICellPopulator<ExternalSearchResult>> cellItem, String componentId, IModel<ExternalSearchResult> model) { @SuppressWarnings("rawtypes") Item rowItem = cellItem.findParent(Item.class); int rowIndex = rowItem.getIndex(); ResultRowView rowView = new ResultRowView(componentId, rowIndex + 1, model); cellItem.add(rowView); } });
@Override public void populateItem(Item<ICellPopulator<ExternalSearchResult>> cellItem, String componentId, IModel<ExternalSearchResult> model) { @SuppressWarnings("rawtypes") Item rowItem = cellItem.findParent( Item.class ); int rowIndex = rowItem.getIndex(); ResultRowView rowView = new ResultRowView(componentId, rowIndex + 1, model); cellItem.add(rowView); } });
/** * @param cellItem * @param massUpdate If true then a mouse click on the row should (de)activate the check box to select the row for the * mass update, otherwise this method calls addRowClick(Item). * @see #addRowClick(Item) */ protected static void addRowClick(final Item<?> cellItem, final boolean massUpdate) { if (massUpdate == true) { final Item<?> row = (cellItem.findParent(Item.class)); row.add(AttributeModifier.replace("onmousedown", "javascript:rowCheckboxClick(this, event);")); } else { addRowClick(cellItem); } }
item.add(actionPanel); item.add(AttributeModifier.append("style", new Model<String>("white-space: nowrap;"))); final Item<?> row = item.findParent(Item.class); WicketUtils.addRowClick(row); cellItemListener.populateItem(item, componentId, rowModel);
@Override public void populateItem(final Item<ICellPopulator<TimesheetDO>> item, final String componentId, final IModel<TimesheetDO> rowModel) { final TimesheetDO timesheet = rowModel.getObject(); final TaskDO task = rowModel.getObject().getTask(); final Label label = new Label("label", task != null ? task.getTitle() : ""); final ListSelectActionPanel actionPanel = new ListSelectActionPanel(componentId, createRecentTimeSheetSelectionLink(timesheet), label); WicketUtils.addTooltip(label, WicketTaskFormatter.getTaskPath(task.getId(), false, OutputType.HTML)); item.add(actionPanel); final Item<?> row = item.findParent(Item.class); WicketUtils.addRowClick(row); cellItemListener.populateItem(item, componentId, rowModel); } });
@Override public void populateItem(final Item<ICellPopulator<TimesheetDO>> item, final String componentId, final IModel<TimesheetDO> rowModel) { final TimesheetDO timesheet = rowModel.getObject(); final int rowIndex = ((Item<?>) item.findParent(Item.class)).getIndex(); String cssClasses = null; if (timesheet.isDeleted() == true) { cssClasses = RowCssClass.MARKED_AS_DELETED.getCssClass(); } else if (rowIndex < TimesheetEditPage.SIZE_OF_FIRST_RECENT_BLOCK) { cssClasses = RowCssClass.IMPORTANT_ROW.getCssClass(); } if (cssClasses != null) { item.add(AttributeModifier.append("class", cssClasses)); } } };
@Override public void populateItem(final Item<ICellPopulator<VacationDO>> item, final String componentId, final IModel<VacationDO> rowModel) { final VacationDO vacation = rowModel.getObject(); item.add(new ListSelectActionPanel(componentId, rowModel, VacationEditPage.class, vacation.getId(), returnToPage, DateTimeFormatter.instance().getFormattedDate(vacation.getStartDate()))); cellItemListener.populateItem(item, componentId, rowModel); final Item<?> row = (item.findParent(Item.class)); WicketUtils.addRowClick(row); } });
@SuppressWarnings("unchecked") @Override public void onClick(AjaxRequestTarget target) { EditableDataTable eventTarget = rowItem.findParent(EditableDataTable.class); send(getPage(), Broadcast.BREADTH, new GridOperationData<T>(OperationType.DELETE, (T)rowItem.getDefaultModelObject(), eventTarget)); target.add(eventTarget); onDelete(target); }
@Override public void populateItem(final Item<ICellPopulator<GroupTaskAccessDO>> item, final String componentId, final IModel<GroupTaskAccessDO> rowModel) { final int rowIndex = ((Item<?>) item.findParent(Item.class)).getIndex(); final GroupTaskAccessDO access = rowModel.getObject(); final List<AccessEntryDO> accessEntries = access.getOrderedEntries(); final AccessTablePanel accessTablePanel = new AccessTablePanel(componentId, accessEntries); if (rowIndex == 0) { accessTablePanel.setDrawHeader(true); } item.add(accessTablePanel); accessTablePanel.init(); cellItemListener.populateItem(item, componentId, rowModel); } });
public EditableGridActionsPanel(String id, final Item<ICellPopulator<T>> cellItem) { super(id); @SuppressWarnings("unchecked") final Item<T> rowItem = cellItem.findParent(Item.class); add(newEditLink(rowItem)); add(newSaveLink(rowItem)); add(newCancelLink(rowItem)); add(newDeleteLink(rowItem)); }
@SuppressWarnings("unchecked") @Override public final void populateItem(final Item<ICellPopulator<T>> item, final String componentId, final IModel<T> rowModel) { final Item<T> rowItem = ((Item<T>) item.findParent(Item.class)); if (inEditiingMode(rowItem) && isEditable) { EditableCellPanel provider = getEditableCellPanel(componentId); FormComponent<?> editorComponent = provider.getEditableComponent(); editorComponent.setDefaultModel((IModel<Object>) getDataModel(rowModel)); item.add(provider); } else { super.populateItem(item, componentId, rowModel); } }
@Override public void onEvent(IEvent<?> event) { if (event.getPayload() instanceof Item) { @SuppressWarnings("unchecked") Item<T> rowItem = ((Item<T>)event.getPayload()); if (rowItem.findParent(EditableDataTable.class).equals(this)) { this.datagrid.refreash(rowItem); event.stop(); } } else if (event.getPayload() instanceof GridOperationData) { @SuppressWarnings("unchecked") GridOperationData<T> gridOperationData = (GridOperationData<T>)event.getPayload(); if (null != gridOperationData && OperationType.DELETE.equals(gridOperationData.getOperationType()) && this.equals(gridOperationData.getTarget())) { getDataProvider().remove(gridOperationData.getData()); event.stop(); } } }
@Override public void populateItem(Item<ICellPopulator<Issue>> cellItem, String componentId, IModel<Issue> rowModel) { Issue issue = rowModel.getObject(); Fragment fragment = new Fragment(componentId, "summaryFrag", IssueListPanel.this); fragment.add(new Label("number", "#" + issue.getNumber())); OddEvenItem<?> row = cellItem.findParent(OddEvenItem.class); QueryPosition position = new QueryPosition(parsedQueryModel.getObject().toString(), (int)issuesTable.getItemCount(), (int)issuesTable.getCurrentPage() * WebConstants.PAGE_SIZE + row.getIndex()); Link<Void> link = new BookmarkablePageLink<Void>("title", IssueActivitiesPage.class, IssueActivitiesPage.paramsOf(issue, position)); link.add(new Label("label", issue.getTitle())); fragment.add(link); fragment.add(new WebMarkupContainer("copy").add(new CopyClipboardBehavior(Model.of("#" + issue.getNumber() + ": " + issue.getTitle())))); fragment.add(new IssueStateLabel("state", rowModel)); UserIdent submitterIdent = UserIdent.of(UserFacade.of(issue.getSubmitter()), issue.getSubmitterName()); fragment.add(new UserIdentPanel("submitter", submitterIdent, Mode.NAME)); fragment.add(new Label("submitDate", DateUtils.formatAge(issue.getSubmitDate()))); fragment.add(new Label("votes", issue.getVoteCount())); fragment.add(new Label("comments", issue.getCommentCount())); cellItem.add(fragment); }