Class RefreshingView<T>

    • Method Detail

      • newItemFactory

        protected IItemFactory<TnewItemFactory()
        Create a new IItemFactory based upon the RefreshingView
        Returns:
        An Item factory that delegates to the RefreshingView
      • getItemModels

        protected abstract Iterator<IModel<T>> getItemModels()
        Returns an iterator over models for items that will be added to this view
        Returns:
        an iterator over models for items that will be added to this view
      • populateItem

        protected abstract void populateItem​(Item<T> item)
        Populate the given Item container.

        be careful to add any components to the item and not the view itself. So, don't do:

         add(new Label("foo", "bar"));
         
        but:
         item.add(new Label("foo", "bar"));
         

        Parameters:
        item - The item to populate
      • newItem

        protected Item<TnewItem​(String id,
                                  int index,
                                  IModel<T> model)
        Factory method for Item container. Item containers are simple MarkupContainer used to aggregate the user added components for a row inside the view.
        Parameters:
        id - component id for the new data item
        index - the index of the new data item
        model - the model for the new data item
        Returns:
        DataItem created DataItem
        See Also:
        Item
      • getItems

        public Iterator<Item<T>> getItems()
        Returns:
        iterator over item instances that exist as children of this view
      • addItems

        protected void addItems​(Iterator<Item<T>> items)
        Add items to the view. Prior to this all items were removed so every request this function starts from a clean slate.
        Parameters:
        items - item instances to be added to this view