jsr372-experts@javaserverfaces-spec-public.java.net

[jsr372-experts] Re: Handling focus after an Ajax update

From: Josh Juneau <juneau001_at_gmail.com>
Date: Thu, 2 Apr 2015 12:05:14 -0500

+1 - I agree that it would be great to have a solution for this issue.

Josh Juneau
juneau001_at_gmail.com
http://jj-blogger.blogspot.com
https://www.apress.com/index.php/author/author/view/id/1866


On Thu, Apr 2, 2015 at 10:34 AM, Kito Mann <kito.mann_at_virtua.com> wrote:

> Interesting. That won't work with input controls that use JS, HTML, and
> CSS like the PrimeFaces SelectOneMenu, though.
>
>
> On Thursday, April 2, 2015, Bauke Scholtz <balusc_at_gmail.com> wrote:
>
>> Hi,
>>
>> Haven't checked MyFaces, but this problem doesn't occur in Mojarra. I
>> recall that this problem was indeed addressed about two years ago, I only
>> can't find the associated issue report and fix version anymore. The jsf.js
>> was been altered to recognize input elements and then only copy the
>> attributes instead of the whole element.
>>
>> Cheers, Bauke
>>
>>
>> On Thu, Apr 2, 2015 at 10:31 AM, Thomas Andraschko <
>> andraschko.thomas_at_gmail.com> wrote:
>>
>>> Hi,
>>>
>>> in PrimeFaces we do the following:
>>> - remember the current activeElement id before processing the changes
>>> node / replacing or adding elements to the DOM
>>> - replace/add DOM elements
>>> - re-focus last active element
>>>
>>> I'm not sure if it's the perfect solution but it works fine for simple
>>> cases. It might not work when you replace inputs, which are completely new
>>> and has different ids.
>>>
>>> Regards,
>>> Thomas
>>>
>>> 2015-04-02 10:18 GMT+02:00 arjan tijms <arjan.tijms_at_gmail.com>:
>>>
>>>> Hi,
>>>>
>>>> On Thursday, April 2, 2015, Kito Mann <kito.mann_at_virtua.com> wrote:
>>>>
>>>>> Am I really the only one with an opinion on this?
>>>>>
>>>>
>>>> As an application developer I can indeed confirm this is an issue.
>>>> JavaScript/DOM stuff is however not my expertise, so I wouldn't be the best
>>>> candidate on the EG to propose a solution for this, unfortunately.
>>>>
>>>> Kind regards,
>>>> Arjan Tijms
>>>>
>>>>
>>>>>
>>>>> ___
>>>>>
>>>>> Kito D. Mann | @kito99 | Author, JSF in Action
>>>>> Virtua, Inc. | http://www.virtua.com | JSF/Java EE training and
>>>>> consulting
>>>>> http://www.JSFCentral.com | @jsfcentral
>>>>> +1 203-998-0403
>>>>>
>>>>> * Listen to the Enterprise Java Newscast: *http://
>>>>> <http://blogs.jsfcentral.com/JSFNewscast/>enterprisejavanews.com
>>>>> <http://ww.enterprisejavanews.com>*
>>>>> * JSFCentral Interviews Podcast:
>>>>> http://www.jsfcentral.com/resources/jsfcentralpodcasts/
>>>>> * Sign up for the JSFCentral Newsletter:
>>>>> http://oi.vresp.com/?fid=ac048d0e17
>>>>>
>>>>> On Thu, Mar 19, 2015 at 10:20 AM, Kito Mann <kito.mann_at_virtua.com>
>>>>> wrote:
>>>>>
>>>>>> Hello everyone,
>>>>>>
>>>>>> One of the annoying things about Ajax updates with JSF is the fact
>>>>>> that focus can easily get lost. One of my clients actually resorted to
>>>>>> synchronous "Ajax" requests to avoid this problem (to my chagrin). Here's a
>>>>>> good description/solution to the problem:
>>>>>> http://www.knitelius.com/2014/07/15/keeping-focus-on-element-with-jsf-2-ajax-render/
>>>>>> .
>>>>>>
>>>>>> Given that this is a common pain point, shouldn't we provide a
>>>>>> solution out of the box?
>>>>>> ___
>>>>>>
>>>>>> Kito D. Mann | @kito99 | Author, JSF in Action
>>>>>> Virtua, Inc. | http://www.virtua.com | JSF/Java EE training and
>>>>>> consulting
>>>>>> http://www.JSFCentral.com | @jsfcentral
>>>>>> +1 203-998-0403
>>>>>>
>>>>>> * Listen to the Enterprise Java Newscast: *http://
>>>>>> <http://blogs.jsfcentral.com/JSFNewscast/>enterprisejavanews.com
>>>>>> <http://ww.enterprisejavanews.com>*
>>>>>> * JSFCentral Interviews Podcast:
>>>>>> http://www.jsfcentral.com/resources/jsfcentralpodcasts/
>>>>>> * Sign up for the JSFCentral Newsletter:
>>>>>> http://oi.vresp.com/?fid=ac048d0e17
>>>>>>
>>>>>
>>>>>
>>>
>>
>
> --
> ___
>
> Kito D. Mann | @kito99 | Author, JSF in Action
> Virtua, Inc. | http://www.virtua.com | JSF/Java EE training and consulting
> http://www.JSFCentral.com | @jsfcentral
> +1 203-998-0403
>
> * Listen to the Enterprise Java Newscast: *http://
> <http://blogs.jsfcentral.com/JSFNewscast/>enterprisejavanews.com
> <http://ww.enterprisejavanews.com>*
> * JSFCentral Interviews Podcast:
> http://www.jsfcentral.com/resources/jsfcentralpodcasts/
> * Sign up for the JSFCentral Newsletter:
> http://oi.vresp.com/?fid=ac048d0e17
>
>