Package org.apache.wicket.ajax

Examples of org.apache.wicket.ajax.AjaxRequestTarget.addComponent()


        super.onItemSelectionChanged(item, newValue);

        // when item selection changes the label showing selected items needs to be
        // refreshed
        AjaxRequestTarget target = AjaxRequestTarget.get();
        target.addComponent(selectionLabel);
      }
    };
    add(grid);

    grid.setCleanSelectionOnPageChange(false);
View Full Code Here


      public void onItemSelectionChanged(IModel item, boolean newValue) {
        super.onItemSelectionChanged(item, newValue);
       
        // refresh the selection label when an item gets selected/deselected.
        AjaxRequestTarget target = AjaxRequestTarget.get();
        target.addComponent(selectionLabel);
      }
    };
   
    grid.setAllowSelectMultiple(true);
    grid.setClickRowToSelect(true);
View Full Code Here

    AjaxRequestTarget target = AjaxRequestTarget.get();
    if (target != null) {
      String createDiv = "(function(){var c=document.createElement('div');c.id='%s';Wicket.$('%s').appendChild(c)})();";
      target.prependJavascript(String.format(createDiv, yuiPanel.getMarkupId(), getMarkupId()));
      target.addComponent(yuiPanel);
      // TODO: find out why javascript of yuiPanel's header contributor
      // fails during the AJAX update in FireFox, works fine in IE.
    }

    return yuiPanel.getId();
View Full Code Here

   */
  @Override
  public void update() {
    AjaxRequestTarget target = AjaxRequestTarget.get();
    if (dirtyItems == DIRTY_ALL) {
      target.addComponent(this);
    } else if (dirtyItems != null) {
      WebMarkupContainer body = (WebMarkupContainer) get("form:bodyContainer:body:row");
      if (body != null) {
        for (Iterator<?> i = body.iterator(); i.hasNext();) {
          Component component = (Component) i.next();
View Full Code Here

      if (body != null) {
        for (Iterator<?> i = body.iterator(); i.hasNext();) {
          Component component = (Component) i.next();
          IModel model = component.getDefaultModel();
          if (dirtyItems.contains(model)) {
            target.addComponent(component);
          }
        }
      }
    }
    dirtyItems = null;
View Full Code Here

        final DataGrid grid = new DataGrid("grid", dataSource, columns) {
            @Override
            public void onItemSelectionChanged(IModel item, boolean newValue) {
                AjaxRequestTarget target = AjaxRequestTarget.get();
                if (target != null) {
                    target.addComponent(removeSelected);
                }
                super.onItemSelectionChanged(item, newValue);
            }
        };
        grid.setRowsPerPage(Integer.MAX_VALUE);
View Full Code Here

        final DataGrid grid = new DataGrid("grid", dataSource, columns) {
            @Override
            public void onItemSelectionChanged(IModel item, boolean newValue) {
                AjaxRequestTarget target = AjaxRequestTarget.get();
                if (target != null) {
                    target.addComponent(removeSelected);
                }
                super.onItemSelectionChanged(item, newValue);
            }
        };
View Full Code Here

                columns) {
            @Override
            public void onItemSelectionChanged(IModel<Entry> item, boolean newValue) {
                AjaxRequestTarget target = AjaxRequestTarget.get();
                if (target != null) {
                    target.addComponent(delete);
                }
                super.onItemSelectionChanged(item, newValue);
            }
        };
        add(grid);
View Full Code Here

                }
                node.save();
                grid.markAllItemsDirty();
                grid.update();
                grid.resetSelectedItems();
                target.addComponent(this);
            }

            @Override
            public boolean isEnabled() {
                return grid.getSelectedItems().isEmpty() == false;
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.