0

Let's say I have the following checkbox code in my xhtml file.

<h:outputLabel value="Status"/><h:selectBooleanCheckbox id="stat" value="#world.getreality().status}"/>

I would like to use jQuery UI's checkbox instead. I do the following and I can get the JQuery UI button rendered but I have no idea how to get it to talk to my bean.

<script>    
    jQuery( "#display" ).button();
</script>

<div id="display">
    <input type="checkbox" id="stat" /><label for="stat">Status</label>
</div>

Update: Is what I'm asking not standard? Update 2: I'd really like some input on this question. If there's something that is unclear or lacking please make a comment.

TSplk
  • 70
  • 1
  • 6
  • The reasons that I don't answer this: 1) I don't do RichFaces, so I can never be sure if my answers are correct. 2) RichFaces already ships with rich UI out the box, why add another? 3) JSF and HTML code snippets in your question do not comply with each other, too much red herrings. All I can say is that when you want fine-grained control at CSS/JS level with help of jQuery/UI, then you should rather be looking for an action based MVC framework, not a component based one. See also this question http://stackoverflow.com/questions/4421839 – BalusC Feb 16 '11 at 19:00
  • Based on your answer and the lack of responses it seems that I have been going about this the wrong way. I'm new to web development so I assumed I could easily use jQueryUI with my JSF code but it seems this is not standard. The reason I wanted to use jQueryUI is because I simply liked their out of the box widgets and theme roller. – TSplk Feb 16 '11 at 19:27
  • [PrimeFaces](http://www.primefaces.org/showcase/), another JSF component library, uses jQuery/UI and [ThemeRoller](http://www.primefaces.org/themes.html) under the covers. You may find it useful. Note that you need to use `@nickname` to notify others about comment replies on posts which are not their own. See also [How do comment @replies work?](http://meta.stackexchange.com/questions/43019/how-do-comment-replies-work) – BalusC Feb 17 '11 at 00:29

2 Answers2

1

Perhaps Primefaces might help? They use jQuery UI / ThemeRoller as their primary styling method.

jiai
  • 181
  • 1
  • 2
0

All you need to do is simply wire up your checkbox to an event handler like:

$('#stat').click(function(){
 // Do some stuff here
});
Crackerjack
  • 2,154
  • 3
  • 28
  • 36
  • His question is more how to get his button "to talk" with the JSF bean on the server side when writing it as plain vanilla HTML/CSS/jQuery instead of as a fullworthy JSF button component, not how to apply jQuery UI fancyness on the button. – BalusC Feb 16 '11 at 19:09
  • As BalcusC said, that's what I'm looking for. – TSplk Feb 16 '11 at 19:24