swipe and focus on items

Forum rules
Please note that response time for technical support is within 3-5 business days.
Post Reply
spadovan
Posts: 178
Joined: 05 Jun 2013, 12:04

31 Mar 2017, 16:12

If i use this cose for enabling swiping on my pages:

Code: Select all

	<script language="javascript">
			  $( document ).ready(function() {
					$(document.body).swipe({
						swipeLeft: function() {
							$('#form\\:next').click();
						},
						swipeRight: function() {
							$('#form\\:previous').click();
						}
				  });
			  });
		</script>
then the input text items on the page are not clickable and i cannot enter this fields with the mouse....

Any idea ? thank you very much.
Primefaces 12.0.2, Wildfly 24.0.1, JDK 11

mert.sincan
Posts: 5281
Joined: 29 Jun 2013, 12:38

03 Apr 2017, 11:54

Can you please attach a sample page?

spadovan
Posts: 178
Joined: 05 Jun 2013, 12:04

03 Apr 2017, 12:03

Please try to add this code in the (<ui:define name="head"> of) messages.xhtml of the ultima demo application:
Please add "id" to the form tag too (<h:form id="form">)

Code: Select all

<ui:define name="head">

		<script language="javascript">
			  $( document ).ready(function() {
					$(document.body).swipe({
						swipeLeft: function() {
							$('#form\\:submitButton').click();
						},
				  });
			  });
		</script>
...		
The inputs are not clickable anymore...
Thanks
Primefaces 12.0.2, Wildfly 24.0.1, JDK 11

mert.sincan
Posts: 5281
Joined: 29 Jun 2013, 12:38

05 Apr 2017, 11:34

Please add the following mobile check;

Code: Select all

<ui:define name="head">

		<script language="javascript">
			  $( document ).ready(function() {
			  
 if(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ) {
					$(document.body).swipe({
						swipeLeft: function() {
							$('#form\\:submitButton').click();
						}
				  });
		}
			  });
		</script>
...		


spadovan
Posts: 178
Joined: 05 Jun 2013, 12:04

05 Apr 2017, 11:49

Nice, it works !

do i have to test mobile device every time i'd like to use swipe functionality ?

thanks, you're number one !

Simone
Primefaces 12.0.2, Wildfly 24.0.1, JDK 11

spadovan
Posts: 178
Joined: 05 Jun 2013, 12:04

05 Apr 2017, 11:52

can i use

Code: Select all

PrimeFaces.widget.Ultima.isMobileDev 
too ?
Primefaces 12.0.2, Wildfly 24.0.1, JDK 11

mert.sincan
Posts: 5281
Joined: 29 Jun 2013, 12:38

11 Apr 2017, 12:24

do i have to test mobile device every time i'd like to use swipe functionality?
- Yes, swipe functionality is for mobile devices.

mert.sincan
Posts: 5281
Joined: 29 Jun 2013, 12:38

11 Apr 2017, 12:26

spadovan wrote:
05 Apr 2017, 11:52
can i use

Code: Select all

PrimeFaces.widget.Ultima.isMobileDev 
too ?
- Great solution! You can use it.

Post Reply

Return to “Ultima - PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 20 guests