I am evaluating the use of PrimeFaces for a new project and am particularly interested in the slider component.
While testing the slider I find that whilst I can set an initial value of 0, once activated the lowest figure I can adjust the slider to is 1 and negative numbers do not appear to be allowed.
I am interested in a slider control that will allow numbers from -100 to 100 - is this possible?
Slider
-
- Prime
- Posts: 18616
- Joined: 05 Jan 2009, 00:21
- Location: Cybertron
- Contact:
left and right property is used for that.
left=-100 right=100 should do it.
http://primefaces.prime.com.tr/docs/tld ... lider.html
left=-100 right=100 should do it.
http://primefaces.prime.com.tr/docs/tld ... lider.html
-
- Prime
- Posts: 18616
- Joined: 05 Jan 2009, 00:21
- Location: Cybertron
- Contact:
Yigit add some new features to the slider, now slider can move to negative values as well. An example;
You can grab this feature from the 0.8.3-SNAPSHOT which is at;
http://repository.prime.com.tr/org/prim ... -SNAPSHOT/
Code: Select all
<h:inputText id="txt2" value="#{sliderBean.number2}"></h:inputText>
<p:slider left="-100" right="100" for="txt2" />
http://repository.prime.com.tr/org/prim ... -SNAPSHOT/
Slider allows negative values, but you can't enter a negative value into the associated input text field. For example I can't set the temperature as -25 in the textbox in the example below (although I can set it with the slider). The textbox only allows digits.
Code: Select all
<h:panelGrid columns="1" style="margin-bottom:10px">
<p:inputText id="txt4" value="#{sliderBean.number4}"/>
<p:slider for="txt4" minValue="-40" maxValue="212" />
</h:panelGrid>
PrimeFaces 4.0 | PFE 1.2.1. | GlassFish 4.0 | Mojarra 2.2.6
NetBeans 8.0 | JDK 8
NetBeans 8.0 | JDK 8
Yes indeed. I have the same problem. I tried to set the inputtext to but that did not help. Has an issue being created yet?
Code: Select all
<f:convertNumber integerOnly="true" />
-
- Information
-
Who is online
Users browsing this forum: No registered users and 67 guests