Package org.apache.wicket

Examples of org.apache.wicket.PageParameters


          BookmarkablePageLink.class.getDeclaredField("parameters");
          Method getParametersMethod = BookmarkablePageLink.class.getDeclaredMethod(
            "getPageParameters", (Class<?>[])null);
          getParametersMethod.setAccessible(true);

          PageParameters parameters = (PageParameters)getParametersMethod.invoke(
            bookmarkablePageLink, (Object[])null);
          setParametersForNextRequest(parameters.toRequestParameters());
        }
        catch (Exception e)
        {
          fail("Internal error in WicketTester. "
            + "Please report this in Wickets Issue Tracker.");
View Full Code Here


    }

    // WICKET-1912
    // If the form is stateless page parameters contain all form component
    // values. We need to remove those otherwise they get appended to action URL
    final PageParameters parameters = page.getPageParameters();
    if (parameters != null)
    {
      visitFormComponents(new FormComponent.IVisitor()
      {
        public Object formComponent(IFormVisitorParticipant formComponent)
        {
          if (formComponent instanceof FormComponent)
          {
            parameters.remove(((FormComponent<?>)formComponent).getInputName());
          }

          return Component.IVisitor.CONTINUE_TRAVERSAL;
        }
      });
      parameters.remove(getHiddenFieldId());
    }
  }
View Full Code Here

    }

    // WICKET-1912
    // If the form is stateless page parameters contain all form component
    // values. We need to remove those otherwise they get appended to action URL
    final PageParameters parameters = page.getPageParameters();
    if (parameters != null)
    {
      visitFormComponents(new FormComponent.IVisitor()
      {
        public Object formComponent(IFormVisitorParticipant formComponent)
        {
          if (formComponent instanceof FormComponent)
          {
            parameters.remove(((FormComponent<?>)formComponent).getInputName());
          }

          return Component.IVisitor.CONTINUE_TRAVERSAL;
        }
      });
      parameters.remove(getHiddenFieldId());
    }
  }
View Full Code Here

    this.setPopupSettings(ISIApplication.authoredPopupSettings);
  }

  @Override
  public void onClick() {
    PageParameters pageParameters = new PageParameters();
    String callingPageDetail = ((ISIStandardPage)getPage()).getPageName();
    pageParameters.add("callingPageDetail", callingPageDetail);
    AuthoredPopup authoredPopup = new AuthoredPopup(pageParameters, xmlId, mSection);
    setResponsePage(authoredPopup);
  }
View Full Code Here

                  public void onClick() {
                    SectionStatus stat = getUserSectionStatus(student, sec);
                    ISIXmlSection targetSection = new SectionLinkFactory().sectionLinkDest(sec);
                    Class<? extends ISIStandardPage> pageType = ISIApplication.get().getReadingPageClass();
                    ISISession.get().setStudentModel(new HibernateObjectModel<User>(student));
                    PageParameters param = new PageParameters();

                    // TODO: This first statement is a hack.  For some reason, getUnreadStudentMessages()
                    // is able to be out of sync with FeedbackMessage.isUnread() flag and is displaying
                    // the wrong icon on the page.  See ISIApplication.statusIconFor() as well.
                    String s = null;
                    if (stat != null && stat.getUnreadStudentMessages() > 0 && (s = responseService.locationOfFirstUnreadMessage(student, sec)) != null) {
                      param.put("loc", s);
                    } else if (stat != null && stat.getCompleted() && !stat.getReviewed()){
                      ISIXmlSection section = targetSection.getSectionAncestor().firstPageWithResponseGroup();
                      if (section != null)
                        param.put("loc", (new ContentLoc(section).getLocation()));
                      else
                        throw new IllegalStateException("Section without response areas marked Ready For Review - should automatically be reviewed.");
                    } else {
                      param.put("loc", (new ContentLoc(targetSection)).getLocation());
                    }
                    setResponsePage(pageType, param);                   
                  }
                };
View Full Code Here

    // check if the page number is valid
    if (ISIApplication.get().getPageNum(pageNum) == null)
      pageNum = -1;
   
    if (pageNum != -1) {
      PageParameters param = new PageParameters();
      param.add("pageNum", String.valueOf(pageNum));
      setResponsePage(ISIApplication.get().getReadingPageClass(), param);
    }
  } 
View Full Code Here

        super.onSubmit();
        // only reload the page if the user has selected a new chapter
        ContentLoc newLoc = new ContentLoc((ISIXmlSection)chapterChoice.getModelObject());
        if (!newLoc.equals(currentChapterLoc)) {
          currentLoc = newLoc;
          PageParameters param = new PageParameters();
          param.add("loc", currentLoc.getLocation());
          setResponsePage(ISIApplication.get().getNotebookPageClass(), param);
        }
      }     
    };
    add(chapterSelectForm);   
View Full Code Here

   
    @Override
    public void onClick() {
      if (bookmark == null)
        bookmark = ISIApplication.get().getBookmarkLoc();
      PageParameters ppar = new PageParameters();
      ppar.add("loc", bookmark.getLocation());
      setResponsePage(ISIApplication.get().getReadingPageClass(), ppar);
    }
View Full Code Here

        private static final long serialVersionUID = 1L;

        @Override
        protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
          String newWord = WordCard.normalizeWord(mWord.getObject());
          PageParameters param = new PageParameters();
         
          if (ISIApplication.get().getGlossary().getEntryByForm(newWord) == null) { // TODO should this get by headword only?
            IModel<WordCard> wc = WordService.get().getWordCardCreate(newWord, ISISession.get().getUser(), false);
            param.add("wc", wc.getObject().getId().toString());
          } else {
            // word is already in the glossary
            param.add("word", newWord);
          }
          this.setResponsePage(ISIApplication.get().getGlossaryPageClass(), param);
        }
      });                 
      add(feedback = new FeedbackPanel("feedback", new ContainerFeedbackMessageFilter(NewWordForm.this)));
View Full Code Here

   
  }

  @Override
  public void reloadForPeriodStudentChange(final PageParameters parameters) {
    PageParameters newParams = new PageParameters(parameters);
    IModel<User> targetUserModel = ISISession.get().getTargetUserModel();
    List<String> collectionNames = getCollectionNames(targetUserModel);
    if (!(collectionNames.contains(paramCollectionName)))
      newParams.remove("name");
    super.reloadForPeriodStudentChange(newParams);
  }     
View Full Code Here

TOP

Related Classes of org.apache.wicket.PageParameters

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.