Uploaded image for project: 'Wicket'
  1. Wicket
  2. WICKET-2267

Type safe component path support for listviews, improve coding efficiency by 60%

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Later
    • 1.4-RC2
    • None
    • wicket
    • None

    Description

      I suggest that the following methods be added into formTester:

      1. formTester.setValue(Component component, String value); // Instead of just the String path version

      2. formTester.submit(IFormSubmittingComponent button (or suitable superclass)); // Instead of just the String path version

      Furthermore, I suggest incorporating the following abstract ListView implementation:

      public abstract class TestableListView<ListItemType extends ListItem<ItemType>, ItemType> extends ListView<ItemType> {
      public TestableListView(String id, IModel<List<ItemType>> model)

      { super(id, model); }

      public TestableListView(String id, List<ItemType> list)

      { super(id, list); }

      public TestableListView(String id)

      { super(id); }

      @Override
      protected final void populateItem(ListItem<ItemType> item)

      { // do nothing here }

      @Override
      protected abstract ListItemType newItem(int index);

      @Override
      public Iterator<ListItemType> iterator()

      { return (Iterator<ListItemType>) super.iterator(); }

      }

      For more details, see attached quickstart.

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            Unassigned Unassigned
            mmakundi Martin Terra
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 5h
                5h
                Remaining:
                Remaining Estimate - 5h
                5h
                Logged:
                Time Spent - Not Specified
                Not Specified

                Slack

                  Issue deployment