• Post Reply Bookmark Topic Watch Topic
  • New Topic

JSF custom component with JQUERI UI Slider  RSS feed

 
Ram Gonela
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am new to JSF and need help from you..

my requirement : Create custom slider component in JSF

I am not able to proceed, how to create slider in JSF custom component, please can you help me on this.

I need to use JQUIRY UI slider(http://jsbin.com/eduren) in custom component.

Regards,
Ram


 
K. Tsang
Bartender
Posts: 3630
16
Firefox Browser Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch.

To my understanding the JSF core tags don't have a slider by default. Yet those other libraries like primefaces, rich faces do.

If you insist to using JQuery UI slider then it's just as simple as in the example from http://jqueryui.com/slider/ (click view source). Some examples on the top right too.
 
Ram Gonela
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Tsang.

I need to achieve JQuery UI Slider functionality with JSF custom component. Please can you suggest me how to create JSF custom component for slider.


Regards,
Rambabu
 
Tim Holloway
Bartender
Posts: 18531
61
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Mr. Tsang is correct. The "h"-namespace tagset is basically a JSF-enhanced version of the stock HTML control tagset. If you cannot do it in vanilla HTML, there's probably not an "h" tag for it.

Creating a custom JSF control is a very messy process and one that is still pretty fragile when migrating between major JSF versions. If at all possible, consider adopting a third-party library containing a pre-debugged functional control. I think the PrimeFaces slider extension tag may be a good fit.
 
Ram Gonela
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Tim,

Can we create JSF Custom component using PrimeFaces slider?. Please suggest me on this.

Regards,
Ram
 
Tim Holloway
Bartender
Posts: 18531
61
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ram Gonela wrote:Thanks Tim,

Can we create JSF Custom component using PrimeFaces slider?. Please suggest me on this.

Regards,
Ram



I'm not expert enough on PrimeFaces to be able to say. However, subclassing JSF core classes is possible, so there is a good chance you could subclass PrimeFaces components.

Fair warning, though: Defining custom components in binary (Java) code is not something I recommend if you can possibly avoid it. The internals of JSF have gone through several sets of (fairly extreme) changes, and may yet do so again (which would break your binary code). Documentation is not all that good and you have to make sure that you don't get confused by referencing obsolete docs on the Internet (this is an especial problem for JSF).

If possible, consider defining your custom control via XML rather than Java code. Better still is if you can employ the existing control.
 
K. Tsang
Bartender
Posts: 3630
16
Firefox Browser Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I agree with Tim on this. Why need to extend Primeface slider or other components when you can just use the the primeface one or JQuery UI one?

If your goal is to control the behavior of the UI slider then AJAX should do the job.
 
Ram Gonela
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Tsang,

My requirement is "need to create custom component for Slider, where we can define values like Interface Type & Bandwidth Range,based on interface type, bandwidth range should change.

Example :
For interface Type abc, bandwidth = 0 - 1000 Mbps, For xyz = 0 - 100 Mbps etc...

Regards,
Rambabu
 
K. Tsang
Bartender
Posts: 3630
16
Firefox Browser Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ram Gonela wrote:Hi Tsang,

My requirement is "need to create custom component for Slider, where we can define values like Interface Type & Bandwidth Range,based on interface type, bandwidth range should change.

Example :
For interface Type abc, bandwidth = 0 - 1000 Mbps, For xyz = 0 - 100 Mbps etc...

Regards,
Rambabu


I doubt you need to customize the slider. AJAX is able to update one variable when another variable is changed.

 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!