Package org.apache.wicket.util.string

Examples of org.apache.wicket.util.string.StringValue


    private ReaderTO reader;

    public EditReader(final PageParameters parameters) {
        super(parameters);
        ReaderService readerService = (ReaderService) ApplicationContextProvider.getApplicationContext().getBean("readerService");
        StringValue readerId = parameters.get("readerId");
        if (readerId.isEmpty()) {
            reader = new ReaderTO();
            add(new Label("title", new Model("Create reader")));
        } else {
            reader = readerService.findReaderById(readerId.toLong());
            add(new Label("title", new Model("Edit reader")));
        }

        Form<?> form = new Form("form") {
            @Override
View Full Code Here


            item.add(new Label("reservationDate", dateFormat.format(reservation.getReservationDate())));
            repeating.add(item);
        }

        //delete reservation
        StringValue reservationId = parameters.get("reservationid");
        if (!reservationId.isEmpty()) {
            reservationService.deleteReservation(reservationService.findReservationByID(reservationId.toLong()));
            setResponsePage(ShowAllReservation.class);
        }

        BookmarkablePageLink createLink = new BookmarkablePageLink<>(
                "create", ShowAllReader.class);
View Full Code Here

    PageParameters params = resource.pageParameters;
    assertNotNull(params);
    assertEquals(0, params.getAllNamed().size());
    assertEquals(2, params.getIndexedCount());

    StringValue paramId = params.get(0);
    assertNotNull(paramId);
    assertEquals(1, paramId.toInt());

    StringValue paramName = params.get(1);
    assertNotNull(paramName);
    assertEquals("fred", paramName.toString());
  }
View Full Code Here

    PageParameters params = resource.pageParameters;
    assertNotNull(params);
    assertEquals(3, params.getAllNamed().size());
    assertEquals(2, params.getIndexedCount());

    StringValue paramId = params.get(0);
    assertNotNull(paramId);
    assertEquals(1, paramId.toInt());

    StringValue paramName = params.get(1);
    assertNotNull(paramName);
    assertEquals("fred", paramName.toString());

    List<StringValue> foo = params.getValues("foo");
    assertNotNull(foo.size() == 2);
    assertEquals("bar", foo.get(0).toString(""));
    assertEquals("baz", foo.get(1).toString(""));

    StringValue paramValue = params.get("value");
    assertEquals(12, paramValue.toInt());
  }
View Full Code Here

      // the list that will contain accepted post param values
      List<StringValue> postValues = new ArrayList<StringValue>();

      for (String value : values)
      {
        StringValue val = StringValue.valueOf(value);
        if (queryValues.contains(val))
        {
          // if a query param with this value exists remove it and continue
          queryValues.remove(val);
        }
View Full Code Here

    PageParameters params = resource.pageParameters;
    assertNotNull(params);
    assertEquals(0, params.getAllNamed().size());
    assertEquals(2, params.getIndexedCount());

    StringValue paramId = params.get(0);
    assertNotNull(paramId);
    assertEquals(1, paramId.toInt());

    StringValue paramName = params.get(1);
    assertNotNull(paramName);
    assertEquals("fred", paramName.toString());
  }
View Full Code Here

    PageParameters params = resource.pageParameters;
    assertNotNull(params);
    assertEquals(3, params.getAllNamed().size());
    assertEquals(2, params.getIndexedCount());

    StringValue paramId = params.get(0);
    assertNotNull(paramId);
    assertEquals(1, paramId.toInt());

    StringValue paramName = params.get(1);
    assertNotNull(paramName);
    assertEquals("fred", paramName.toString());

    List<StringValue> foo = params.getValues("foo");
    assertNotNull(foo.size() == 2);
    assertEquals("bar", foo.get(0).toString(""));
    assertEquals("baz", foo.get(1).toString(""));

    StringValue paramValue = params.get("value");
    assertEquals(12, paramValue.toInt());
  }
View Full Code Here

     */
    @Override
    public String getObject()
    {
      // name contains the name of the selected file
      StringValue sourceParam = getPageParameters().get(SOURCE);
      if (Strings.isEmpty(name) && sourceParam.isEmpty())
      {
        return "";
      }

      String source = null;
      InputStream resourceAsStream = null;
      try
      {
        source = (name != null) ? name : sourceParam.toString();
        resourceAsStream = getPageTargetClass().getResourceAsStream(source);
        if (resourceAsStream == null)
        {
          return "Unable to read the source for " + source;
        }
View Full Code Here

    requestHandler = ((RequestSettingRequestHandler)requestHandler).getDelegateHandler();
    assertTrue(requestHandler instanceof RenderPageRequestHandler);

    RenderPageRequestHandler handler = (RenderPageRequestHandler)requestHandler;
    assertEquals(tester.getApplication().getHomePage(), handler.getPageClass());
    StringValue queryParam = handler.getPageParameters().get("named1");
    assertEquals("value1", queryParam.toOptionalString());
  }
View Full Code Here

        // the list that will contain accepted post param values
        List<StringValue> postValues = new ArrayList<StringValue>();

        for (String value : values)
        {
          StringValue val = StringValue.valueOf(value);
          if (queryValues.contains(val))
          {
            // if a query param with this value exists remove it and continue
            queryValues.remove(val);
          }
View Full Code Here

TOP

Related Classes of org.apache.wicket.util.string.StringValue

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.