You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by smallufo <sm...@gmail.com> on 2010/01/21 02:06:47 UTC

Cannot get default invisible TextField's ModelObject ?

I have a form , which contains a radio button.
When user clicks the radio button , a default-invisible textfield is set
visible.
But I cannot get the textfield's Model Object , it is null ....

What's the problem ? Did I miss anything ?

Re: Cannot get default invisible TextField's ModelObject ?

Posted by smallufo <sm...@gmail.com>.
I think it is a bug , and already submitted to JIRA
https://issues.apache.org/jira/browse/WICKET-2694
<https://issues.apache.org/jira/browse/WICKET-2694>

2010/1/21 Chuck Brinkman <ch...@gmail.com>

> I looked some more and found the following:
>
> When it works, with my modification, FormComponent.getInputAsArray tries to
> get parameters for the TextField named "more:moreForm:textfield".  I looked
> in the parameter map or the RequestFacade object and found these:
> wicket:interface, wicket:ignoreIfNotActive, random,
> more:moreForm:textfield,
> radioGroup and more:moreForm:submit.  And it finds the TextField.
>
> The version that fails is looking for TextField named "more:textfield".
>  The
> RequestFacade object has: wicket:interface, wicket:ignoreIfNotActive,
> random, forma_hf_0, radioGroup and more:submit.  Is there a problem with
> "forma_hf_0?
>
>
>
> On Thu, Jan 21, 2010 at 7:35 AM, smallufo <sm...@gmail.com> wrote:
>
> > Yes , indeed , if the form is in the second row (default invisible) , it
> > works , But I cannot get the first row's data (such as radioGroup's model
> > object will become null ).
> > Moreover ,  Form with multiple row , with something visible and something
> > extensible (default invisible), it is not so rare.
> > If the form is not inside a ListView , it will work.
> > But it just fails if it is inside a  ListView.
>

Re: Cannot get default invisible TextField's ModelObject ?

Posted by Chuck Brinkman <ch...@gmail.com>.
I looked some more and found the following:

When it works, with my modification, FormComponent.getInputAsArray tries to
get parameters for the TextField named "more:moreForm:textfield".  I looked
in the parameter map or the RequestFacade object and found these:
wicket:interface, wicket:ignoreIfNotActive, random, more:moreForm:textfield,
radioGroup and more:moreForm:submit.  And it finds the TextField.

The version that fails is looking for TextField named "more:textfield".  The
RequestFacade object has: wicket:interface, wicket:ignoreIfNotActive,
random, forma_hf_0, radioGroup and more:submit.  Is there a problem with
"forma_hf_0?



On Thu, Jan 21, 2010 at 7:35 AM, smallufo <sm...@gmail.com> wrote:

> Yes , indeed , if the form is in the second row (default invisible) , it
> works , But I cannot get the first row's data (such as radioGroup's model
> object will become null ).
> Moreover ,  Form with multiple row , with something visible and something
> extensible (default invisible), it is not so rare.
> If the form is not inside a ListView , it will work.
> But it just fails if it is inside a  ListView.
>
> 2010/1/21 Chuck Brinkman <ch...@gmail.com>
>
> > I stepped through the code and found that the convertedInput is null when
> > processing submit.  I didn't see anything that looked like an error
> message
> > from wicket.    I look forward to seeing what the wicket developers have
> to
> > say.
> >
> > I'm just a new wicket user but was interested in this issue.  I also
> found
> > that if you make the following changes it will work.
> >                    <tr wicket:id="more">
> >                        <td colspan="2">
> >                             *<form wicket:id="moreForm">*
> >                             <input type="text" size="40" value="Please
> > leave
> > comments"
> >                                wicket:id="textfield" />
> >                            <input type="submit" value="Submit"
> > wicket:id="submit" />
> >                            * </form>*
> >                        </td>
> >                    </tr>
> >
> >
> >                *Form<Void> moreForm = new Form<Void>("moreForm");
> >                more.add(moreForm);*
> >                 final TextField<String> textfield = new
> TextField<String>(
> >                        "textfield", new Model<String>());
> >                 *moreForm*.add(textfield);
> >                 AjaxButton button = new AjaxButton("submit") {
> >                    @Override
> >                    protected void onSubmit(AjaxRequestTarget arg0,
> Form<?>
> > form) {
> >                        System.out.println("radioGroup = "
> >                                + radioGroup.getModelObject()
> >                                + " , textfield.getModelObject() = "
> >                                + textfield.getModelObject());
> >                    }
> >                };
> >                 *moreForm*.add(button);
> >
> >
> > On Wed, Jan 20, 2010 at 10:47 PM, smallufo <sm...@gmail.com> wrote:
> >
> > > This is a full functional Page  :
> > >
> > > I found this problem only occurs when the form is in the listView :
> > > If I move the form out of the listView , it works like a charm.
> > > Bug ? I am not sure...
> > >
> > > The link is the screen capture :
> > > http://xs.to/image-B859_4B57CDD0.gif
> > >
> > >
> > > MyPage.html
> > >
> > > <table border="1">
> > >  <tr>
> > >    <th>name</th>
> > >    <th>more ?</th>
> > >  </tr>
> > >  <span wicket:id="listView">
> > >    <form wicket:id="form">
> > >      <tr>
> > >        <td wicket:id="name">[name]</td>
> > >        <td>
> > >          <span wicket:id="radioGroup">
> > >            <input type="radio" wicket:id="yes"/>yes
> > >            <input type="radio" wicket:id="no"/>no
> > >          </span>
> > >        </td>
> > >      </tr>
> > >      <tr wicket:id="more">
> > >        <td colspan="2">
> > >          <input type="text" size="40" value="Please leave comments"
> > > wicket:id="textfield"/>
> > >          <input type="submit" value="Submit" wicket:id="submit"/>
> > >        </td>
> > >      </tr>
> > >    </form>
> > >  </span>
> > > </table>
> > >
> > >
> > > MyPage.java
> > >
> > > package quickstart.ajax;
> > >
> > > import java.util.ArrayList;
> > > import java.util.List;
> > >
> > > import org.apache.wicket.ajax.AjaxEventBehavior;
> > > import org.apache.wicket.ajax.AjaxRequestTarget;
> > > import org.apache.wicket.ajax.markup.html.form.AjaxButton;
> > > import org.apache.wicket.markup.html.WebMarkupContainer;
> > > import org.apache.wicket.markup.html.WebPage;
> > > import org.apache.wicket.markup.html.basic.Label;
> > > import org.apache.wicket.markup.html.form.Form;
> > > import org.apache.wicket.markup.html.form.Radio;
> > > import org.apache.wicket.markup.html.form.RadioGroup;
> > > import org.apache.wicket.markup.html.form.TextField;
> > > import org.apache.wicket.markup.html.list.ListItem;
> > > import org.apache.wicket.markup.html.list.ListView;
> > > import org.apache.wicket.model.Model;
> > >
> > > public class MyPage extends WebPage
> > > {
> > >  private final static List<String> names = new ArrayList<String>();
> > >  static
> > >  {
> > >    names.add("Andy");
> > >    names.add("Brian");
> > >    names.add("Carol");
> > >  }
> > >
> > >  public MyPage()
> > >  {
> > >    ListView<String> listView = new ListView<String>("listView" , names)
> > >    {
> > >      @Override
> > >      protected void populateItem(ListItem<String> item)
> > >      {
> > >
> > >        Form<Void> form = new Form<Void>("form");
> > >        item.add(form);
> > >
> > >        String name = item.getModelObject();
> > >
> > >        form.add(new Label("name" , name));
> > >
> > >        final WebMarkupContainer more = new WebMarkupContainer("more");
> > >        more.setVisible(false);
> > >        more.setOutputMarkupPlaceholderTag(true);
> > >        form.add(more);
> > >
> > >
> > >        final RadioGroup<Boolean> radioGroup = new
> > > RadioGroup<Boolean>("radioGroup" , Model.of(Boolean.FALSE));
> > >        form.add(radioGroup);
> > >
> > >        Radio<Boolean> yes = new Radio<Boolean>("yes" ,
> > > Model.of(Boolean.TRUE));
> > >        Radio<Boolean> no = new Radio<Boolean>("no" ,
> > > Model.of(Boolean.FALSE));
> > >        radioGroup.add(yes);
> > >        radioGroup.add(no);
> > >
> > >        yes.add(new AjaxEventBehavior("onClick")
> > >        {
> > >          @Override
> > >          protected void onEvent(AjaxRequestTarget target)
> > >          {
> > >            more.setVisible(true);
> > >            target.addComponent(more);
> > >          }
> > >        });
> > >
> > >        no.add(new AjaxEventBehavior("onClick")
> > >        {
> > >          @Override
> > >          protected void onEvent(AjaxRequestTarget target)
> > >          {
> > >            more.setVisible(false);
> > >            target.addComponent(more);
> > >          }
> > >        });
> > >
> > >        final TextField<String> textfield = new
> > > TextField<String>("textfield" , new Model<String>());
> > >        more.add(textfield);
> > >        AjaxButton button = new AjaxButton("submit")
> > >        {
> > >          @Override
> > >          protected void onSubmit(AjaxRequestTarget arg0, Form<?> form)
> > >          {
> > >            System.out.println("radioGroup = " +
> > radioGroup.getModelObject()
> > > + " , textfield.getModelObject() = " + textfield.getModelObject());
> > >          }
> > >        };
> > >        more.add(button);
> > >      }
> > >    };
> > >    add(listView);
> > >  }
> > > }
> > >
> >
>

Re: Cannot get default invisible TextField's ModelObject ?

Posted by smallufo <sm...@gmail.com>.
Yes , indeed , if the form is in the second row (default invisible) , it
works , But I cannot get the first row's data (such as radioGroup's model
object will become null ).
Moreover ,  Form with multiple row , with something visible and something
extensible (default invisible), it is not so rare.
If the form is not inside a ListView , it will work.
But it just fails if it is inside a  ListView.

2010/1/21 Chuck Brinkman <ch...@gmail.com>

> I stepped through the code and found that the convertedInput is null when
> processing submit.  I didn't see anything that looked like an error message
> from wicket.    I look forward to seeing what the wicket developers have to
> say.
>
> I'm just a new wicket user but was interested in this issue.  I also found
> that if you make the following changes it will work.
>                    <tr wicket:id="more">
>                        <td colspan="2">
>                             *<form wicket:id="moreForm">*
>                             <input type="text" size="40" value="Please
> leave
> comments"
>                                wicket:id="textfield" />
>                            <input type="submit" value="Submit"
> wicket:id="submit" />
>                            * </form>*
>                        </td>
>                    </tr>
>
>
>                *Form<Void> moreForm = new Form<Void>("moreForm");
>                more.add(moreForm);*
>                 final TextField<String> textfield = new TextField<String>(
>                        "textfield", new Model<String>());
>                 *moreForm*.add(textfield);
>                 AjaxButton button = new AjaxButton("submit") {
>                    @Override
>                    protected void onSubmit(AjaxRequestTarget arg0, Form<?>
> form) {
>                        System.out.println("radioGroup = "
>                                + radioGroup.getModelObject()
>                                + " , textfield.getModelObject() = "
>                                + textfield.getModelObject());
>                    }
>                };
>                 *moreForm*.add(button);
>
>
> On Wed, Jan 20, 2010 at 10:47 PM, smallufo <sm...@gmail.com> wrote:
>
> > This is a full functional Page  :
> >
> > I found this problem only occurs when the form is in the listView :
> > If I move the form out of the listView , it works like a charm.
> > Bug ? I am not sure...
> >
> > The link is the screen capture :
> > http://xs.to/image-B859_4B57CDD0.gif
> >
> >
> > MyPage.html
> >
> > <table border="1">
> >  <tr>
> >    <th>name</th>
> >    <th>more ?</th>
> >  </tr>
> >  <span wicket:id="listView">
> >    <form wicket:id="form">
> >      <tr>
> >        <td wicket:id="name">[name]</td>
> >        <td>
> >          <span wicket:id="radioGroup">
> >            <input type="radio" wicket:id="yes"/>yes
> >            <input type="radio" wicket:id="no"/>no
> >          </span>
> >        </td>
> >      </tr>
> >      <tr wicket:id="more">
> >        <td colspan="2">
> >          <input type="text" size="40" value="Please leave comments"
> > wicket:id="textfield"/>
> >          <input type="submit" value="Submit" wicket:id="submit"/>
> >        </td>
> >      </tr>
> >    </form>
> >  </span>
> > </table>
> >
> >
> > MyPage.java
> >
> > package quickstart.ajax;
> >
> > import java.util.ArrayList;
> > import java.util.List;
> >
> > import org.apache.wicket.ajax.AjaxEventBehavior;
> > import org.apache.wicket.ajax.AjaxRequestTarget;
> > import org.apache.wicket.ajax.markup.html.form.AjaxButton;
> > import org.apache.wicket.markup.html.WebMarkupContainer;
> > import org.apache.wicket.markup.html.WebPage;
> > import org.apache.wicket.markup.html.basic.Label;
> > import org.apache.wicket.markup.html.form.Form;
> > import org.apache.wicket.markup.html.form.Radio;
> > import org.apache.wicket.markup.html.form.RadioGroup;
> > import org.apache.wicket.markup.html.form.TextField;
> > import org.apache.wicket.markup.html.list.ListItem;
> > import org.apache.wicket.markup.html.list.ListView;
> > import org.apache.wicket.model.Model;
> >
> > public class MyPage extends WebPage
> > {
> >  private final static List<String> names = new ArrayList<String>();
> >  static
> >  {
> >    names.add("Andy");
> >    names.add("Brian");
> >    names.add("Carol");
> >  }
> >
> >  public MyPage()
> >  {
> >    ListView<String> listView = new ListView<String>("listView" , names)
> >    {
> >      @Override
> >      protected void populateItem(ListItem<String> item)
> >      {
> >
> >        Form<Void> form = new Form<Void>("form");
> >        item.add(form);
> >
> >        String name = item.getModelObject();
> >
> >        form.add(new Label("name" , name));
> >
> >        final WebMarkupContainer more = new WebMarkupContainer("more");
> >        more.setVisible(false);
> >        more.setOutputMarkupPlaceholderTag(true);
> >        form.add(more);
> >
> >
> >        final RadioGroup<Boolean> radioGroup = new
> > RadioGroup<Boolean>("radioGroup" , Model.of(Boolean.FALSE));
> >        form.add(radioGroup);
> >
> >        Radio<Boolean> yes = new Radio<Boolean>("yes" ,
> > Model.of(Boolean.TRUE));
> >        Radio<Boolean> no = new Radio<Boolean>("no" ,
> > Model.of(Boolean.FALSE));
> >        radioGroup.add(yes);
> >        radioGroup.add(no);
> >
> >        yes.add(new AjaxEventBehavior("onClick")
> >        {
> >          @Override
> >          protected void onEvent(AjaxRequestTarget target)
> >          {
> >            more.setVisible(true);
> >            target.addComponent(more);
> >          }
> >        });
> >
> >        no.add(new AjaxEventBehavior("onClick")
> >        {
> >          @Override
> >          protected void onEvent(AjaxRequestTarget target)
> >          {
> >            more.setVisible(false);
> >            target.addComponent(more);
> >          }
> >        });
> >
> >        final TextField<String> textfield = new
> > TextField<String>("textfield" , new Model<String>());
> >        more.add(textfield);
> >        AjaxButton button = new AjaxButton("submit")
> >        {
> >          @Override
> >          protected void onSubmit(AjaxRequestTarget arg0, Form<?> form)
> >          {
> >            System.out.println("radioGroup = " +
> radioGroup.getModelObject()
> > + " , textfield.getModelObject() = " + textfield.getModelObject());
> >          }
> >        };
> >        more.add(button);
> >      }
> >    };
> >    add(listView);
> >  }
> > }
> >
>

Re: Cannot get default invisible TextField's ModelObject ?

Posted by Chuck Brinkman <ch...@gmail.com>.
I stepped through the code and found that the convertedInput is null when
processing submit.  I didn't see anything that looked like an error message
from wicket.    I look forward to seeing what the wicket developers have to
say.

I'm just a new wicket user but was interested in this issue.  I also found
that if you make the following changes it will work.
                   <tr wicket:id="more">
                        <td colspan="2">
                            *<form wicket:id="moreForm">*
                            <input type="text" size="40" value="Please leave
comments"
                                wicket:id="textfield" />
                            <input type="submit" value="Submit"
wicket:id="submit" />
                           * </form>*
                        </td>
                    </tr>


                *Form<Void> moreForm = new Form<Void>("moreForm");
                more.add(moreForm);*
                final TextField<String> textfield = new TextField<String>(
                        "textfield", new Model<String>());
                *moreForm*.add(textfield);
                AjaxButton button = new AjaxButton("submit") {
                    @Override
                    protected void onSubmit(AjaxRequestTarget arg0, Form<?>
form) {
                        System.out.println("radioGroup = "
                                + radioGroup.getModelObject()
                                + " , textfield.getModelObject() = "
                                + textfield.getModelObject());
                    }
                };
                *moreForm*.add(button);


On Wed, Jan 20, 2010 at 10:47 PM, smallufo <sm...@gmail.com> wrote:

> This is a full functional Page  :
>
> I found this problem only occurs when the form is in the listView :
> If I move the form out of the listView , it works like a charm.
> Bug ? I am not sure...
>
> The link is the screen capture :
> http://xs.to/image-B859_4B57CDD0.gif
>
>
> MyPage.html
>
> <table border="1">
>  <tr>
>    <th>name</th>
>    <th>more ?</th>
>  </tr>
>  <span wicket:id="listView">
>    <form wicket:id="form">
>      <tr>
>        <td wicket:id="name">[name]</td>
>        <td>
>          <span wicket:id="radioGroup">
>            <input type="radio" wicket:id="yes"/>yes
>            <input type="radio" wicket:id="no"/>no
>          </span>
>        </td>
>      </tr>
>      <tr wicket:id="more">
>        <td colspan="2">
>          <input type="text" size="40" value="Please leave comments"
> wicket:id="textfield"/>
>          <input type="submit" value="Submit" wicket:id="submit"/>
>        </td>
>      </tr>
>    </form>
>  </span>
> </table>
>
>
> MyPage.java
>
> package quickstart.ajax;
>
> import java.util.ArrayList;
> import java.util.List;
>
> import org.apache.wicket.ajax.AjaxEventBehavior;
> import org.apache.wicket.ajax.AjaxRequestTarget;
> import org.apache.wicket.ajax.markup.html.form.AjaxButton;
> import org.apache.wicket.markup.html.WebMarkupContainer;
> import org.apache.wicket.markup.html.WebPage;
> import org.apache.wicket.markup.html.basic.Label;
> import org.apache.wicket.markup.html.form.Form;
> import org.apache.wicket.markup.html.form.Radio;
> import org.apache.wicket.markup.html.form.RadioGroup;
> import org.apache.wicket.markup.html.form.TextField;
> import org.apache.wicket.markup.html.list.ListItem;
> import org.apache.wicket.markup.html.list.ListView;
> import org.apache.wicket.model.Model;
>
> public class MyPage extends WebPage
> {
>  private final static List<String> names = new ArrayList<String>();
>  static
>  {
>    names.add("Andy");
>    names.add("Brian");
>    names.add("Carol");
>  }
>
>  public MyPage()
>  {
>    ListView<String> listView = new ListView<String>("listView" , names)
>    {
>      @Override
>      protected void populateItem(ListItem<String> item)
>      {
>
>        Form<Void> form = new Form<Void>("form");
>        item.add(form);
>
>        String name = item.getModelObject();
>
>        form.add(new Label("name" , name));
>
>        final WebMarkupContainer more = new WebMarkupContainer("more");
>        more.setVisible(false);
>        more.setOutputMarkupPlaceholderTag(true);
>        form.add(more);
>
>
>        final RadioGroup<Boolean> radioGroup = new
> RadioGroup<Boolean>("radioGroup" , Model.of(Boolean.FALSE));
>        form.add(radioGroup);
>
>        Radio<Boolean> yes = new Radio<Boolean>("yes" ,
> Model.of(Boolean.TRUE));
>        Radio<Boolean> no = new Radio<Boolean>("no" ,
> Model.of(Boolean.FALSE));
>        radioGroup.add(yes);
>        radioGroup.add(no);
>
>        yes.add(new AjaxEventBehavior("onClick")
>        {
>          @Override
>          protected void onEvent(AjaxRequestTarget target)
>          {
>            more.setVisible(true);
>            target.addComponent(more);
>          }
>        });
>
>        no.add(new AjaxEventBehavior("onClick")
>        {
>          @Override
>          protected void onEvent(AjaxRequestTarget target)
>          {
>            more.setVisible(false);
>            target.addComponent(more);
>          }
>        });
>
>        final TextField<String> textfield = new
> TextField<String>("textfield" , new Model<String>());
>        more.add(textfield);
>        AjaxButton button = new AjaxButton("submit")
>        {
>          @Override
>          protected void onSubmit(AjaxRequestTarget arg0, Form<?> form)
>          {
>            System.out.println("radioGroup = " + radioGroup.getModelObject()
> + " , textfield.getModelObject() = " + textfield.getModelObject());
>          }
>        };
>        more.add(button);
>      }
>    };
>    add(listView);
>  }
> }
>

Re: Cannot get default invisible TextField's ModelObject ?

Posted by smallufo <sm...@gmail.com>.
This is a full functional Page  :

I found this problem only occurs when the form is in the listView :
If I move the form out of the listView , it works like a charm.
Bug ? I am not sure...

The link is the screen capture :
http://xs.to/image-B859_4B57CDD0.gif


MyPage.html

<table border="1">
  <tr>
    <th>name</th>
    <th>more ?</th>
  </tr>
  <span wicket:id="listView">
    <form wicket:id="form">
      <tr>
        <td wicket:id="name">[name]</td>
        <td>
          <span wicket:id="radioGroup">
            <input type="radio" wicket:id="yes"/>yes
            <input type="radio" wicket:id="no"/>no
          </span>
        </td>
      </tr>
      <tr wicket:id="more">
        <td colspan="2">
          <input type="text" size="40" value="Please leave comments"
wicket:id="textfield"/>
          <input type="submit" value="Submit" wicket:id="submit"/>
        </td>
      </tr>
    </form>
  </span>
</table>


MyPage.java

package quickstart.ajax;

import java.util.ArrayList;
import java.util.List;

import org.apache.wicket.ajax.AjaxEventBehavior;
import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.ajax.markup.html.form.AjaxButton;
import org.apache.wicket.markup.html.WebMarkupContainer;
import org.apache.wicket.markup.html.WebPage;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.form.Form;
import org.apache.wicket.markup.html.form.Radio;
import org.apache.wicket.markup.html.form.RadioGroup;
import org.apache.wicket.markup.html.form.TextField;
import org.apache.wicket.markup.html.list.ListItem;
import org.apache.wicket.markup.html.list.ListView;
import org.apache.wicket.model.Model;

public class MyPage extends WebPage
{
  private final static List<String> names = new ArrayList<String>();
  static
  {
    names.add("Andy");
    names.add("Brian");
    names.add("Carol");
  }

  public MyPage()
  {
    ListView<String> listView = new ListView<String>("listView" , names)
    {
      @Override
      protected void populateItem(ListItem<String> item)
      {

        Form<Void> form = new Form<Void>("form");
        item.add(form);

        String name = item.getModelObject();

        form.add(new Label("name" , name));

        final WebMarkupContainer more = new WebMarkupContainer("more");
        more.setVisible(false);
        more.setOutputMarkupPlaceholderTag(true);
        form.add(more);


        final RadioGroup<Boolean> radioGroup = new
RadioGroup<Boolean>("radioGroup" , Model.of(Boolean.FALSE));
        form.add(radioGroup);

        Radio<Boolean> yes = new Radio<Boolean>("yes" ,
Model.of(Boolean.TRUE));
        Radio<Boolean> no = new Radio<Boolean>("no" ,
Model.of(Boolean.FALSE));
        radioGroup.add(yes);
        radioGroup.add(no);

        yes.add(new AjaxEventBehavior("onClick")
        {
          @Override
          protected void onEvent(AjaxRequestTarget target)
          {
            more.setVisible(true);
            target.addComponent(more);
          }
        });

        no.add(new AjaxEventBehavior("onClick")
        {
          @Override
          protected void onEvent(AjaxRequestTarget target)
          {
            more.setVisible(false);
            target.addComponent(more);
          }
        });

        final TextField<String> textfield = new
TextField<String>("textfield" , new Model<String>());
        more.add(textfield);
        AjaxButton button = new AjaxButton("submit")
        {
          @Override
          protected void onSubmit(AjaxRequestTarget arg0, Form<?> form)
          {
            System.out.println("radioGroup = " + radioGroup.getModelObject()
+ " , textfield.getModelObject() = " + textfield.getModelObject());
          }
        };
        more.add(button);
      }
    };
    add(listView);
  }
}

Re: Cannot get default invisible TextField's ModelObject ?

Posted by Jered Myers <je...@maplewoodsoftware.com>.
What do you mean by "cannot get their values"?  I am wondering if the 
model's value is not showing in the TextField when it become visible or 
if the model's value is not getting set based on what you type into the 
TextField.  If your problem is that the value you type into the 
TextField is not getting to the model, check to make sure the Form that 
the TextField is in is reaching the Form's onSubmit method when you 
submit the form.  Wicket does not push the TextField value to the model 
until it has checked for required fields, converted the input, and 
validated the converted input.  If you can copy in the related code to 
this thread, that may help.

-Jered

On 1/20/2010 5:14 PM, smallufo wrote:
> To make it more clear :
> When the radio button is clicked , by implement AjaxEventBehavior("onClick")
>
> , a default-invisible WebMarkupContainer is set visible ,
> The WebMarkupContainer  contains other TextFields , which I cannot get their
> values at all ....
> I've stuck with this problems for half day , searching but found no anwser
> ...
> I need help....
>
> Wicket 1.4.5
>
>
> 2010/1/21 smallufo<sm...@gmail.com>
>
>    
>> I have a form , which contains a radio button.
>> When user clicks the radio button , a default-invisible textfield is set
>> visible.
>> But I cannot get the textfield's Model Object , it is null ....
>>
>> What's the problem ? Did I miss anything ?
>>
>>      
>    

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Cannot get default invisible TextField's ModelObject ?

Posted by smallufo <sm...@gmail.com>.
To make it more clear :
When the radio button is clicked , by implement AjaxEventBehavior("onClick")

, a default-invisible WebMarkupContainer is set visible ,
The WebMarkupContainer  contains other TextFields , which I cannot get their
values at all ....
I've stuck with this problems for half day , searching but found no anwser
...
I need help....

Wicket 1.4.5


2010/1/21 smallufo <sm...@gmail.com>

> I have a form , which contains a radio button.
> When user clicks the radio button , a default-invisible textfield is set
> visible.
> But I cannot get the textfield's Model Object , it is null ....
>
> What's the problem ? Did I miss anything ?
>