You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by pureza <pu...@gmail.com> on 2014/12/10 11:27:13 UTC

AutoCompleteTextField with position: fixed

Hi,

I need to have an AutoCompleteTextField with position: fixed, because it
sits inside a fixed Modal. However, Wicket calculates the position
coordinates based on the top of the document and not the top of the screen,
so the dropdown doesn't show up in the right place when there is a
scrollbar.

To fix this, I tried to add custom JavaScript code to the
AutoCompleteBehavior, by overriding updateAjaxAttributes and adding my own
AjaxCallListener. However, this didn't work because AutoCompleteBehavior
seems to ignore any AjaxCallListener, as reported here:
http://mail-archives.apache.org/mod_mbox/wicket-users/201301.mbox/%3C1358755750041-4655560.post@n4.nabble.com%3E.

Could you tell me what's the best way of achieving this?

Thank you,

Luis Pureza

--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/AutoCompleteTextField-with-position-fixed-tp4668713.html
Sent from the Users forum mailing list archive at Nabble.com.

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


Re: AutoCompleteTextField with position: fixed

Posted by Bertrand Guay-Paquet <be...@step.polymtl.ca>.
Hello,

Your issue seems to be related to css and not to Wicket itself.

 From the css spec for "position: fixed" :
The box's position is calculated according to the 'absolute' model, but 
in addition, the box is fixed with respect to some reference. [...] the 
box is fixed with respect to the viewport and does not move when scrolled.

I'm not trying to be condescending here, especially since I don't fully 
understand your issue, but maybe looking up a tutorial on css 
positioning might give you the answer. I'm not convinced you need any 
javascript to fix this.

Regards,
Bertrand

On 10/12/2014 5:27 AM, pureza wrote:
> Hi,
>
> I need to have an AutoCompleteTextField with position: fixed, because it
> sits inside a fixed Modal. However, Wicket calculates the position
> coordinates based on the top of the document and not the top of the screen,
> so the dropdown doesn't show up in the right place when there is a
> scrollbar.
>
> To fix this, I tried to add custom JavaScript code to the
> AutoCompleteBehavior, by overriding updateAjaxAttributes and adding my own
> AjaxCallListener. However, this didn't work because AutoCompleteBehavior
> seems to ignore any AjaxCallListener, as reported here:
> http://mail-archives.apache.org/mod_mbox/wicket-users/201301.mbox/%3C1358755750041-4655560.post@n4.nabble.com%3E.
>
> Could you tell me what's the best way of achieving this?
>
> Thank you,
>
> Luis Pureza
>
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/AutoCompleteTextField-with-position-fixed-tp4668713.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>


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