Oops, No..I am not using a Form!

James Carman wrote:
Are you using a form?

On Sun, Jan 24, 2010 at 9:07 PM, Ashika Umanga Umagiliya
<[email protected]> wrote:
Greetings ,

I have placed a TextField and a Link(Html submit button) in my page.I want
to get the value of the TextField when the button is pressed(onClick()).
But in the following code, I dont get the value the user typed in.

What I am doing wrong?


My HTML is:

<div class="comment"> Search Nihonbare:
    <input wicket:id="txtSearchQuery" type="text" name="search"
class="search" />
    <input wicket:id="searchButton" type="submit" value="Search"
class="submit" />
</div>

Java Code:

     final TextField queryText=new TextField("txtSearchQuery",new
Model<String>(""));
  add(queryText);
  add(new Link("advancedSearchPage") {

      @Override
      public void onClick() {
          setResponsePage(new SearchResultsPage());
                }
  });

  add(new Link("searchButton") {

      @Override
      public void onClick() {
          System.out.println("QUERY Text: "+
queryText.getModel().getObject());
                }
  });





---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]


Reply via email to