Re: The AutoCompleteTextField model callback setObject() not working

2020-04-28 Thread kyc
Finally I found out the jquery.js is the reason makes the
AutoCompleteTextField not working.

Thanks Martin and Sven.

--
Sent from: http://apache-wicket.1842946.n4.nabble.com/Users-forum-f1842947.html

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



Re: The AutoCompleteTextField model callback setObject() not working

2020-04-28 Thread kyc
I copied the page to my application to run but still have the problem.  It
may relate to different layout.  But I don't have the WicketExamplePage in
the example.

--
Sent from: http://apache-wicket.1842946.n4.nabble.com/Users-forum-f1842947.html

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



Re: The AutoCompleteTextField model callback setObject() not working

2020-04-28 Thread Sven Meier

Hi,

you find an example page in wicket-examples 
org.apache.wicket.examples.ajax.builtin.AutoCompletePage that works fine.


Could you try it and check the difference to your code please?

Have fun
Sven


On 28.04.20 10:55, kyc wrote:

Dear Martin,

Thank you for your answer.

I upgraded to wicket 7.16 to test my program but the result is the same.  I
checked the browser console / the network console and no error is found.
(WICKET AJAX DEBUG box is also no error)

Please note the model getObject() call back is called normally.  The item
can be selected in the popup list and the selected string is shown in the
textfield.  However, the value will be disappeared after refresh as the
setObject() is not being called.



Brenda

--
Sent from: http://apache-wicket.1842946.n4.nabble.com/Users-forum-f1842947.html

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



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



Re: The AutoCompleteTextField model callback setObject() not working

2020-04-28 Thread kyc
Dear Martin,

Thank you for your answer.

I upgraded to wicket 7.16 to test my program but the result is the same.  I
checked the browser console / the network console and no error is found. 
(WICKET AJAX DEBUG box is also no error)

Please note the model getObject() call back is called normally.  The item
can be selected in the popup list and the selected string is shown in the
textfield.  However, the value will be disappeared after refresh as the
setObject() is not being called.



Brenda

--
Sent from: http://apache-wicket.1842946.n4.nabble.com/Users-forum-f1842947.html

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



Re: The AutoCompleteTextField model callback setObject() not working

2020-04-28 Thread Martin Grigorov
Hi,

On Tue, Apr 28, 2020 at 9:54 AM kyc  wrote:

> I am using wicket 7.14
>

Try to upgrade to 7.16.


>
> The following setObject is not called if I select the item from the list
> showing from AutoCompleteTextField.
> However, it will be called if I type something on the textfield.  I tried
>

If it works when you type something but it doesn't when you select an item
then it looks like a JavaScript error.
Check the browser Dev Tools Console for JS error and Network tab for Ajax
request.


> the wicket example with form surrounding the input tag and add
> AjaxFormSubmitBehavior which was still not working.  I also tried the blur
> event  suggested by some forum which also not work.   I was stuck on the
> problem for many days.
>
>
> final IModel model = new IModel()
> {
> private String value = null;
>
> @Override
> public String getObject()
> {
> return value;
> }
>
> @Override
> public void setObject(String object)
> {
> value = object;
> }
>
> @Override
> public void detach()
> {
> }
> };
>
>
> final AutoCompleteTextField sampleField = new
> AutoCompleteTextField("sample", model, String.class, settings){
> private static final long
> serialVersionUID = -2129392693264844597L;
>
>..
> }
>
> --
> Sent from:
> http://apache-wicket.1842946.n4.nabble.com/Users-forum-f1842947.html
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


The AutoCompleteTextField model callback setObject() not working

2020-04-28 Thread kyc
I am using wicket 7.14

The following setObject is not called if I select the item from the list
showing from AutoCompleteTextField.
However, it will be called if I type something on the textfield.  I tried
the wicket example with form surrounding the input tag and add
AjaxFormSubmitBehavior which was still not working.  I also tried the blur
event  suggested by some forum which also not work.   I was stuck on the
problem for many days.


final IModel model = new IModel()
{
private String value = null;

@Override
public String getObject()
{
return value;
}

@Override
public void setObject(String object)
{
value = object;
}

@Override
public void detach()
{
}
};


final AutoCompleteTextField sampleField = new
AutoCompleteTextField("sample", model, String.class, settings){
private static final long 
serialVersionUID = -2129392693264844597L;

   ..
}

--
Sent from: http://apache-wicket.1842946.n4.nabble.com/Users-forum-f1842947.html

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