Package org.apache.wicket

Examples of org.apache.wicket.Request


        }
    };

    @Test
    public void canInstantiateIfProvideRequest() {
        final Request stubRequest = context.fixture(Fixture_Request_Stub.class).object();
        new AuthenticatedWebSessionForIsis(stubRequest);
    }
View Full Code Here


    if (inputArrayCache == null)
    {
      // this array will aggregate all input names
      ArrayList<String> names = null;

      final Request request = getRequest();
      if (request instanceof IMultipartWebRequest)
      {
        // retrieve the filename->FileItem map from request
        final Map<String, FileItem> itemNameToItem = ((IMultipartWebRequest)request).getFiles();
        Iterator<Entry<String, FileItem>> it = itemNameToItem.entrySet().iterator();
View Full Code Here

   * @return The uploaded file
   */
  public FileUpload getFileUpload()
  {
    // Get request
    final Request request = getRequest();

    // If we successfully installed a multipart request
    if (request instanceof IMultipartWebRequest)
    {
      // Get the item for the path
View Full Code Here

    if (inputArrayCache == null)
    {
      // this array will aggregate all input names
      ArrayList<String> names = null;

      final Request request = getRequest();
      if (request instanceof IMultipartWebRequest)
      {
        // retrieve the filename->FileItem map from request
        final Map<String, FileItem> itemNameToItem = ((IMultipartWebRequest)request).getFiles();
        Iterator<Entry<String, FileItem>> it = itemNameToItem.entrySet().iterator();
View Full Code Here

    if (inputArrayCache == null)
    {
      // this array will aggregate all input names
      ArrayList<String> names = null;

      final Request request = getRequest();
      if (request instanceof IMultipartWebRequest)
      {
        // retrieve the filename->FileItem map from request
        final Map<String, FileItem> itemNameToItem = ((IMultipartWebRequest)request).getFiles();
        Iterator<Entry<String, FileItem>> it = itemNameToItem.entrySet().iterator();
View Full Code Here

  /**
   * @return may return null
   */
  public static WebRequest getWebRequest() {
    final Request request = getRequest();
    return request instanceof WebRequest ? (WebRequest) request : null;
  }
View Full Code Here

  /**
   * @return <code>true</code> if header "Wicket-Ajax" is set
   * @see ServletWebRequest#isAjax()
   */
  public static boolean isAjax() {
    Request req = getRequest();
    if (req instanceof ServletWebRequest) {
      return ((ServletWebRequest) req).isAjax();
    } else {
      return false;
    }
View Full Code Here

   * Handles the event processing during sorting.
   */
  @Override
  protected void respond(final AjaxRequestTarget target) {
    Component component = getComponent();
    Request request;
    if (component != null && (request = component.getRequest()) != null) {
      EventType eventType = EventType.stringToType(request.getParameter(EventType.IDENTIFIER));

      String draggedItemId = request.getParameter("draggedItemId");

      // We need the body of the <li> tag, the component inside it
      ChildrenFinder childrenFinder = new ChildrenFinder(draggedItemId);
      component.getPage().visitChildren(childrenFinder);
      if (childrenFinder.getFoundComponents().size() != 1)
        throw new WicketRuntimeException("this should not happen");
      Component sortedComponent = childrenFinder.getFoundComponents().get(0);

      if (eventType == EventType.STOP) {
        int newPosition = 0;

        try {
          String s = request.getParameter("newPosition");
          newPosition = Integer.parseInt(s);

          if (sortedComponent instanceof ISortable) {
            ((ISortable)sortedComponent).onSorted(target, newPosition);
          }

          onSorted(target, sortedComponent, newPosition);
        } catch (Exception e) {
          // don't process
        }
      }
      else if (eventType == EventType.RECEIVE) {
        String otherSortableId = "";
        int newPosition = 0;

        try {
          String s = request.getParameter("newPosition");

          newPosition = Integer.parseInt(s);
          otherSortableId = request.getParameter("otherSortableId");

          if (sortedComponent instanceof ISortable) {
            ((ISortable)sortedComponent).onReceived(target, newPosition);
          }

View Full Code Here

   * Handles the event processing during resizing.
   */
  @Override
  protected void respond(final AjaxRequestTarget target) {
    Component component = getComponent();
    Request request;
    if (component != null && (request = component.getRequest()) != null) {
      EventType eventType = EventType.stringToType(request.getParameter(EventType.IDENTIFIER));

      String newHeader = "";
      String oldHeader = "";
      String newContent = "";
      String oldContent = "";
      String active = "";

      newHeader = request.getParameter("newHeader");
      oldHeader = request.getParameter("oldHeader");
      newContent = request.getParameter("newContent");
      oldContent = request.getParameter("oldContent");
      active = request.getParameter("active");

      int activeIndex = -1;
      try {
        activeIndex = Integer.parseInt(active);
      } catch (Exception e) {
View Full Code Here

   * handles the event processing during dragging.
   */
  @Override
  protected void respond(final AjaxRequestTarget target) {
    Component component = getComponent();
    Request request;

    if (component != null && (request = component.getRequest()) != null) {
      EventType dragEventType = EventType.stringToType(request.getParameter(EventType.IDENTIFIER));

      if (component instanceof IDraggable) {
        IDraggable draggableComponent = (IDraggable)component;
        if (dragEventType == EventType.DRAG_START)
          draggableComponent.onDragStart(target, new SpecialKeys(request));
View Full Code Here

TOP

Related Classes of org.apache.wicket.Request

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.