Hotkey within inputText [showcase]

UI Components for JSF
User avatar
sudheer
PrimeFaces Core Developer
Posts: 4345
Joined: 16 Oct 2011, 19:19
Location: Singapore

26 Aug 2013, 10:13

Good.Thanks for sharing your code.But instead raising old threads create new topic with your solution.

I too used this hotkey component in one of my application.But when coming to the inputtext+hotkey combination I just used javascript handler solution instead jquery.
Author,Speaker
https://twitter.com/sudheerjonna
Github: https://github.com/sudheerj
Website http://sudheerjonna.com/

___________________
Sudheer Jonna

shbn
Posts: 2
Joined: 24 Jan 2013, 12:23

26 Aug 2013, 10:37

sudheer wrote:Good.Thanks for sharing your code.But instead raising old threads create new topic with your solution.

I too used this hotkey component in one of my application.But when coming to the inputtext+hotkey combination I just used javascript handler solution instead jquery.
Well it may be little bit old, but when you google this problem, you will end on this page. Thats the reason, I have added it here (and also because munkee requested it).

kukeltje
Expert Member
Posts: 9605
Joined: 17 Jun 2010, 13:34
Location: Netherlands

26 Aug 2013, 11:04

Shbn

If you would have created a new topic, google would also have found that. You could ave given it a subject with 'solution' in it and reference it from this old post...

ritonglue
Posts: 21
Joined: 04 Jun 2021, 16:52

11 Jul 2023, 12:36

I don't understand this limitation. For example if the user press F9, the form must be saved instead of clicking a button.

I find it hard to explain to the user that it doesn't work if there is a focused input on page.

ritonglue
Posts: 21
Joined: 04 Jun 2021, 16:52

11 Jul 2023, 16:56

Well I removed p:hotkey and did this :

Code: Select all

<p:remoteCommand name="f9remoteCommand" action="#{beanView.modify}" />
<script>
		$(window).keydown(function (event) {
		    if (event.which == 120) {
		    	f9remoteCommand();
		    }
		})
</script>
So for me p:hotkey must be improved.

Melloware
Posts: 3717
Joined: 22 Apr 2013, 15:48

11 Jul 2023, 19:58

See the very last line of the documentation page: https://primefaces.github.io/primefaces ... ?id=hotkey
PrimeFaces Developer | PrimeFaces Extensions Developer
GitHub Profile: https://github.com/melloware
PrimeFaces Elite 13.0.0 / PF Extensions 13.0.0
PrimeReact 9.6.1

Melloware
Posts: 3717
Joined: 22 Apr 2013, 15:48

11 Jul 2023, 20:00

PrimeFaces Developer | PrimeFaces Extensions Developer
GitHub Profile: https://github.com/melloware
PrimeFaces Elite 13.0.0 / PF Extensions 13.0.0
PrimeReact 9.6.1

ritonglue
Posts: 21
Joined: 04 Jun 2021, 16:52

12 Jul 2023, 16:09

I know that the limitation is in the documentation.
But it is not very handy. Imagine you have a lot of input fields, you have to hit the tabulation a lot of time to get out of focus and then trigger the hotkey.

In my case, the users want to be able to validate a form without clicking.

I'm happy with my "workaround" but I would have preferred using p:hotkey.

vrooktreat
Posts: 1
Joined: 17 Jul 2023, 13:26

17 Jul 2023, 13:47

Did anyone solve this issue by writing there own handler?

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 10 guests