0

I need to use PrimeFaces.current().focus() for a UI component that is not visible for the user. However, as I understood from

https://stackoverflow.com/a/57111323/1925356

it is specifically designed to work only on enabled input fields, that are not buttons.

My case is a very special one, and I need to show a message for a component that is not physically visible to the user, but is actually an enabled input element.

I tried with this:

 <div class="ui-g-12">
     <h:inputText style ="display:none;" id="fakeInputId"/>
     <p:message for="fakeInputId">
        <p:autoUpdate/>
     </p:message>
 </div>

but this did not put a focus on the "fakeInputId". Is there some CSS trick to apply to h:inputText so that it is both enabled, but invisible to the user and is able to get the focus set by the mentioned method?

Alex Mi
  • 1,409
  • 2
  • 21
  • 35

0 Answers0