Package org.apache.wicket.markup.repeater

Examples of org.apache.wicket.markup.repeater.RepeatingView


    private static final long serialVersionUID = 1L;

    public ShowAllReservation(final PageParameters parameters) {
        super(parameters);

        RepeatingView repeating = new RepeatingView("repeating");
        add(repeating);
        ReservationService reservationService = (ReservationService) ApplicationContextProvider.getApplicationContext().getBean("reservationService");
        SimpleDateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy");
        for (ReservationTO reservation : reservationService.findAllReservations()) {
            AbstractItem item = new AbstractItem(repeating.newChildId());
            PageParameters pageParameters = new PageParameters();
            item.add(new BookmarkablePageLink<Void>("delete", ShowAllReservation.class, pageParameters));
            pageParameters.add("reservationid", reservation.getReservationID());
            item.add(new Label("readerTO", reservation.getReaderTO().toString()));
            item.add(new Label("bookTO", reservation.getBookTO().toString()));
            item.add(new Label("reservationDate", dateFormat.format(reservation.getReservationDate())));
            repeating.add(item);
        }

        //delete reservation
        StringValue reservationId = parameters.get("reservationid");
        if (!reservationId.isEmpty()) {
View Full Code Here


      do
      {
        // Build a row
        Item rowItem = newRowItem(newChildId(), row);
        RepeatingView rowView = new RepeatingView("cols");
        rowItem.add(rowView);
        add(rowItem);

        // Populate the row
        for (int index = 0; index < cols; index++)
        {
          final Item cellItem;
          if (items.hasNext())
          {
            cellItem = (Item)items.next();
          }
          else
          {
            cellItem = newEmptyItem(newChildId(), index);
            populateEmptyItem(cellItem);
          }
          rowView.add(cellItem);
        }

        // increase row
        row++;
View Full Code Here

    private Component buildJSWMSSelect(String id,
            List<String> wmsOutputFormats, List<String> wfsOutputFormats, PreviewLayer layer) {
        Fragment f = new Fragment(id, "menuFragment", MapPreviewPage.this);
        WebMarkupContainer menu = new WebMarkupContainer("menu");
       
        RepeatingView wmsFormats = new RepeatingView("wmsFormats");
        for (int i = 0; i < wmsOutputFormats.size(); i++) {
            String wmsOutputFormat = wmsOutputFormats.get(i);
            String label = translateFormat("format.wms.", wmsOutputFormat);
            // build option with text and value
            Label format = new Label(i + "", label);
            format.add(new AttributeModifier("value", true, new Model(wmsOutputFormat)));
            wmsFormats.add(format);
        }
        menu.add(wmsFormats);
       
        // the vector ones, it depends, we might have to hide them
        boolean vector = layer.groupInfo == null && layer.layerInfo.getType() != LayerInfo.Type.RASTER;
        WebMarkupContainer wfsFormatsGroup = new WebMarkupContainer("wfs");
        RepeatingView wfsFormats = new RepeatingView("wfsFormats");
        if(vector) {
            for (int i = 0; i < wfsOutputFormats.size(); i++) {
                String wfsOutputFormat = wfsOutputFormats.get(i);
                String label = translateFormat("format.wfs.", wfsOutputFormat);
                // build option with text and value
                Label format = new Label(i + "", label);
                format.add(new AttributeModifier("value", true, new Model(wfsOutputFormat)));
                wfsFormats.add(format);
            }
        }
        wfsFormatsGroup.add(wfsFormats);
        menu.add(wfsFormatsGroup);
       
View Full Code Here

      do
      {
        // Build a row
        Item rowItem = newRowItem(newChildId(), row);
        RepeatingView rowView = new RepeatingView("cols");
        rowItem.add(rowView);
        add(rowItem);

        // Populate the row
        for (int index = 0; index < cols; index++)
        {
          final Item cellItem;
          if (items.hasNext())
          {
            cellItem = (Item)items.next();
          }
          else
          {
            cellItem = newEmptyItem(newChildId(), index);
            populateEmptyItem(cellItem);
          }
          rowView.add(cellItem);
        }

        // increase row
        row++;
View Full Code Here

      }
    };
    datagrid.setRowsPerPage(rowsPerPage);
    add(datagrid);

    topToolbars = new RepeatingView("topToolbars")
    {
      private static final long serialVersionUID = 1L;

      public boolean isVisible()
      {
        return size() > 0;
      }

    };

    bottomToolbars = new RepeatingView("bottomToolbars")
    {

      private static final long serialVersionUID = 1L;

      public boolean isVisible()
View Full Code Here

      }
    };
    datagrid.setRowsPerPage(rowsPerPage);
    add(datagrid);

    topToolbars = new RepeatingView("topToolbars")
    {
      private static final long serialVersionUID = 1L;

      @Override
      public boolean isVisible()
      {
        return size() > 0;
      }

    };

    bottomToolbars = new RepeatingView("bottomToolbars")
    {

      private static final long serialVersionUID = 1L;

      @Override
View Full Code Here

      }
    });

    // populate the toolbar with components provided by filtered columns

    RepeatingView filters = new RepeatingView("filters");
    form.add(filters);

    IColumn[] cols = table.getColumns();
    for (int i = 0; i < cols.length; i++)
    {
      WebMarkupContainer item = new WebMarkupContainer(filters.newChildId());
      item.setRenderBodyOnly(true);

      IColumn col = cols[i];
      Component filter = null;

      if (col instanceof IFilteredColumn)
      {
        IFilteredColumn filteredCol = (IFilteredColumn)col;
        filter = filteredCol.getFilter(FILTER_COMPONENT_ID, form);
      }

      if (filter == null)
      {
        filter = new NoFilter(FILTER_COMPONENT_ID);
      }
      else
      {
        if (!filter.getId().equals(FILTER_COMPONENT_ID))
        {
          throw new IllegalStateException(
              "filter component returned  with an invalid component id. invalid component id ["
                  + filter.getId() + "] required component id ["
                  + FILTER_COMPONENT_ID + "] generating column ["
                  + col.toString() + "] ");
        }
      }

      item.add(filter);

      filters.add(item);
    }

  }
View Full Code Here

      do
      {
        // Build a row
        Item rowItem = newRowItem(newChildId(), row);
        RepeatingView rowView = new RepeatingView("cols");
        rowItem.add(rowView);
        add(rowItem);

        // Populate the row
        for (int index = 0; index < cols; index++)
        {
          final Item cellItem;
          if (items.hasNext())
          {
            cellItem = (Item)items.next();
          }
          else
          {
            cellItem = newEmptyItem(newChildId(), index);
            populateEmptyItem(cellItem);
          }
          rowView.add(cellItem);
        }

        // increase row
        row++;
View Full Code Here

        final ObjectAdapter adapter = entityModel.getObject();
        final ObjectSpecification objSpec = adapter.getSpecification();

        final List<ObjectAssociation> associations = visibleProperties(adapter, objSpec, Where.OBJECT_FORMS);

        final RepeatingView memberGroupRv = new RepeatingView(ID_MEMBER_GROUP);
        markupContainer.add(memberGroupRv);

        Map<String, List<ObjectAssociation>> associationsByGroup = ObjectAssociation.Util.groupByMemberOrderName(associations);
       
        final List<String> groupNames = ObjectSpecifications.orderByMemberGroups(objSpec, associationsByGroup.keySet(), hint);
       
        for(String groupName: groupNames) {
            final List<ObjectAssociation> associationsInGroup = associationsByGroup.get(groupName);
            if(associationsInGroup==null) {
                continue;
            }

            final WebMarkupContainer memberGroupRvContainer = new WebMarkupContainer(memberGroupRv.newChildId());
            memberGroupRv.add(memberGroupRvContainer);
            memberGroupRvContainer.add(new Label(ID_MEMBER_GROUP_NAME, groupName));

            final RepeatingView propertyRv = new RepeatingView(ID_PROPERTIES);
            memberGroupRvContainer.add(propertyRv);

            @SuppressWarnings("unused")
            Component component;
            for (final ObjectAssociation association : associationsInGroup) {
                final WebMarkupContainer propertyRvContainer = new UiHintPathSignificantWebMarkupContainer(propertyRv.newChildId());
                propertyRv.add(propertyRvContainer);
                addPropertyToForm(entityModel, association, propertyRvContainer);
            }
        }
       
        addClassForSpan(markupContainer, span);
View Full Code Here

        private void addParameters() {
            final ActionModel actionModel = getActionModel();
            List<ActionParameterMemento> parameterMementos = actionModel.primeArgumentModels();
           
            final RepeatingView rv = new RepeatingView(ID_ACTION_PARAMETERS);
            add(rv);
           
            paramPanels.clear();
            for (final ActionParameterMemento apm : parameterMementos) {
                final WebMarkupContainer container = new WebMarkupContainer(rv.newChildId());
                rv.add(container);

                final ScalarModel argumentModel = actionModel.getArgumentModel(apm);
                argumentModel.setActionArgsHint(actionModel.getArgumentsAsArray());
                final Component component = getComponentFactoryRegistry().addOrReplaceComponent(container, ComponentType.SCALAR_NAME_AND_VALUE, argumentModel);
                final ScalarPanelAbstract paramPanel = component instanceof ScalarPanelAbstract ? (ScalarPanelAbstract) component : null;
View Full Code Here

TOP

Related Classes of org.apache.wicket.markup.repeater.RepeatingView

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.