Java Code Examples for org.apache.wicket.markup.repeater.Item#findParent()

The following examples show how to use org.apache.wicket.markup.repeater.Item#findParent() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AjaxCheckTablePanel.java    From nextreports-server with Apache License 2.0 6 votes vote down vote up
@SuppressWarnings("unchecked")
@Override
public void populateItem(final Item<ICellPopulator<T>> item, String componentId, IModel<T> rowModel) {
      	final HighlitableDataItem highlitableDataItem = item.findParent(HighlitableDataItem.class);
      	IModel<Boolean> checkBoxModel = new LoadableDetachableModel<Boolean>() {

		private static final long serialVersionUID = 1L;

		@Override
		protected Boolean load() {
			return highlitableDataItem.isHighlite();
		}
      		
      	};
      	if (isCheckable(rowModel)) {
      		item.add(new CheckBoxColumnPanel(componentId, checkBoxModel));
      		item.add(AttributeModifier.replace("class", "checkboxColumn"));
      	} else {
      		item.add(new EmptyPanel(componentId));
      	}
}
 
Example 2
Source File: AbstractListPage.java    From projectforge-webapp with GNU General Public License v3.0 5 votes vote down vote up
/**
 * @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);
  }
}
 
Example 3
Source File: AbstractListPage.java    From projectforge-webapp with GNU General Public License v3.0 4 votes vote down vote up
public static void addRowClick(final Item< ? > cellItem)
{
  final Item< ? > row = (cellItem.findParent(Item.class));
  WicketUtils.addRowClick(row);
}