p:spinner - Is it possible to disable manual input

UI Components for JSF
User avatar
bercolax
Posts: 133
Joined: 02 Aug 2009, 13:27
Location: Courtallam, India
Contact:

09 Nov 2011, 07:42

p:spinner - Is it possible to disable manual input? That is force the user to enter value only using the increment and decrement buttons.

(In slider we can set the inputText associated to readonly and it works well. )
PrimeFaces 3.4, Seam Faces 3.0.2.Final, Glassfish v3.1, Mojarra 2.1.10, NetBeans 7.2, Hibernate JPA 2.0, Seam Persistence 3.0.0.Final Theme default HOT-SNEAKS

User avatar
vinnysoft
Posts: 43
Joined: 07 Oct 2011, 23:51

08 Aug 2012, 03:53

Hi bercolax.

I need to disable a p:spinner manual input too. Did you have success?

Thanks!
NetBeans 7.1.2 - Mojarra 2.1.11 - PrimeFaces 3.3.1 - PrimeFaces Extensions 0.5.1 - Apache Tomcat 7.0.29 - Hibernate 4.1.4-Final - MySQL 5.5

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

08 Aug 2012, 18:04

What about disabled attribute?If it's disabling manual input and spinner buttons also then you can raise a request for readOnlyInput attibute just like p:calendar.
Author,Speaker
https://twitter.com/sudheerjonna
Github: https://github.com/sudheerj
Website http://sudheerjonna.com/

___________________
Sudheer Jonna

User avatar
vinnysoft
Posts: 43
Joined: 07 Oct 2011, 23:51

08 Aug 2012, 18:11

Hi sudheer.

I didn't get it. Could you give an example, please?

Thanks!
NetBeans 7.1.2 - Mojarra 2.1.11 - PrimeFaces 3.3.1 - PrimeFaces Extensions 0.5.1 - Apache Tomcat 7.0.29 - Hibernate 4.1.4-Final - MySQL 5.5

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

08 Aug 2012, 18:17

Did you try with disabled="true" attribute?
In p:calender component we can prevent manual data entry in input box using readOnlyInput="true"
Author,Speaker
https://twitter.com/sudheerjonna
Github: https://github.com/sudheerj
Website http://sudheerjonna.com/

___________________
Sudheer Jonna

User avatar
vinnysoft
Posts: 43
Joined: 07 Oct 2011, 23:51

08 Aug 2012, 18:36

If I use readonly="true", neither the input or the spinner buttons works. Using disabled="true", the spinner is all disabled (opaque). I don't see an attribute readOnlyInput on p:spinner.

What I want is only the input to not be enabled, but the spinner buttons have to work.

Thanks!
NetBeans 7.1.2 - Mojarra 2.1.11 - PrimeFaces 3.3.1 - PrimeFaces Extensions 0.5.1 - Apache Tomcat 7.0.29 - Hibernate 4.1.4-Final - MySQL 5.5

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

08 Aug 2012, 18:43

Yes, i know.We don't have readOnlyInput attribute for p:spinner so i advised you raise a request in issuetracker ;)
Author,Speaker
https://twitter.com/sudheerjonna
Github: https://github.com/sudheerj
Website http://sudheerjonna.com/

___________________
Sudheer Jonna

User avatar
vinnysoft
Posts: 43
Joined: 07 Oct 2011, 23:51

08 Aug 2012, 18:53

:) Ok I will do so, thanks!
NetBeans 7.1.2 - Mojarra 2.1.11 - PrimeFaces 3.3.1 - PrimeFaces Extensions 0.5.1 - Apache Tomcat 7.0.29 - Hibernate 4.1.4-Final - MySQL 5.5

User avatar
vinnysoft
Posts: 43
Joined: 07 Oct 2011, 23:51

08 Aug 2012, 18:58

NetBeans 7.1.2 - Mojarra 2.1.11 - PrimeFaces 3.3.1 - PrimeFaces Extensions 0.5.1 - Apache Tomcat 7.0.29 - Hibernate 4.1.4-Final - MySQL 5.5

DarkSupremo
Posts: 1
Joined: 14 Dec 2012, 21:50

14 Dec 2012, 21:52

The easier way to do it:
<p:spinner onkeypress="return false">

That's all... spinner will keep working but manual input will not...

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 16 guests