Hello,

What you you expecting from "set the HTML Focus to the title of the
*ModalWindow*"?
It is regular div element

What I did:
1) open http://examples7x.wicket.apache.org/ajax/modal-window?0
2) click "Show modal dialog"
3) in console type: $('.w_caption h3').focus()

in console type:
document.activeElement  ->    <a id="id2" href="javascript:;">Show
modal dialog with panel</a>

4) manually add <input type="text"/> to Title
5) in console type: $('.w_caption h3 input').focus()

in console type:
document.activeElement  ->    <input type="text"/>

I believe you need to check your expectation first :)

On Thu, Feb 22, 2018 at 4:15 AM, SeldonCrisis <nmbara...@gmail.com> wrote:
> Hey Everyone,
>
> I'm having some difficulties with *ModalWindow*. I need a way to set the
> HTML Focus to the title of the *ModalWindow *when it pops up, but so far
> nothing has worked for me.
>
> 1. I have tried adding an *AjaxEventBehavior ("onload")* to my modal window,
> but that did not work. Neither did *("onchange")* or *("onblur")*.
>
> 2. I have also tried appending javascript to the target when invoking the
> ModalWindow's *show()* method:
>
>
> ...but unfortunately this.getMarkupId() is referring to the div holding the
> wicket component:
>
>
> ...and not the actual Modal Window itself, which is dynamically creating
> id's like so:
>
>
>
> 3. I have also tried using *AjaxRequestTarget.focusComponent()*:
>
>
> ...where *child()* is simply returning the first component in the hierarchy
> that is not a WebMarkupContainer:
>
>
> Using the Wicket Ajax Debug window, we can see that my 3rd attempt did
> successfully fire some javascript to set focus:
>
>
>
> BUT when I use the Internet Explorer developer tools and run
> *document.activeElement*, I am returned the entire body of the web page,
> meaning there is no focus set.
>
> If anyone can think of a way to set focus on the modal window title, or a
> way to hardcode id's for different parts of the modal window, please help me
> out. Thanks!
>
>
> --
> 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
>



-- 
WBR
Maxim aka solomax

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

Reply via email to