my dog learned polymorphism*
The moose likes JSF and the fly likes jsf 1.2 Facelets - Double clicks on a selectManyListbox Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSF
Reply locked New topic
Author

jsf 1.2 Facelets - Double clicks on a selectManyListbox

Solomon Gnanadurai
Greenhorn

Joined: May 20, 2011
Posts: 24
JSF 1.2 & Facelets -

I have two similar questions listed below.

1. How can I execute a backing bean method when a user double clicks on a selectManyListbox?

I know we can code like ondblclick="document.getElementById('formid').submit()" but I dont have a submit button in my page. And I am not using AJAX.

2. How can I execute a backing bean method when value changes in h:selectBooleanCheckbox without submitting the form?

Thanks.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15961
    
  19

You cannot access a backing bean without doing some form of submit, because submitting is the way that the client talks to the server in HTTP, and HTTP is the underpinning of JSF.

AJAX makes it possible to do a partial page submit/render, but it's still an HTTP submit at heart.

Since you're using JSF 1.2, you are either going to have to pull in a suitable AJAX-friendly extension tagset such as RichFaces or IceFaces. OR you're going to have to employ an AJAX support library like jQuery or Dojo. OR you're going to have to do it the hard way, using raw JavaScript AJAX.


Customer surveys are for companies who didn't pay proper attention to begin with.
Solomon Gnanadurai
Greenhorn

Joined: May 20, 2011
Posts: 24
Tim, thanks for your reply. As you suggested I am going to use RichFaces but I had few issues when deploying in weblogic 10.3.1 and I was able to resolve most of the issues but I am stuck with the below exception when deploying in weblogic. Any help is appreciated.
I am using the below jar files to use RichFaces.
commons-collections-3.2.1
jhighlight-1.0
guava-r09-gwt
guava-r09
richfaces-api-3.3.3.Final
richfaces-impl-3.3.3.Final
richfaces-impl-jsf2-3.3.3.Final
richfaces-ui-3.3.3.Final
commons-digester-2.0
commons-logging-1.1.1

Exception:
java.lang.NullPointerException
at org.apache.commons.digester.Digester.getXMLReader(Digester.java:1058)
at org.apache.commons.digester.Digester.parse(Digester.java:1887)
at org.ajax4jsf.resource.ResourceBuilderImpl.registerConfig(ResourceBuilderImpl.java:211)
at org.ajax4jsf.resource.ResourceBuilderImpl.registerResources(ResourceBuilderImpl.java:155)
at org.ajax4jsf.resource.ResourceBuilderImpl.init(ResourceBuilderImpl.java:226)
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15961
    
  19

Check the RichFaces manual (PDF). In the front of it you should find a listing of the particular needs that different webapp servers have in order to run RichFaces, and that includes WebLogic.
Solomon Gnanadurai
Greenhorn

Joined: May 20, 2011
Posts: 24
Yes after checking their manual I found that I am not using commons-digester-1.8.jar. So using the right version solved the weblogic deployment problem.

Also I am able to execute backing bean method using RichFaces like this


Thanks Tim for all the inputs that you have been giving so far.
Solomon Gnanadurai
Greenhorn

Joined: May 20, 2011
Posts: 24
I am able to use RichFaces Ajax and rerender partial page when the user clicks selectBooleanCheckbox.

But I have one more scenario where I have selectManyListbox and on double clicking should call the bean method and return to the next page based on the <from-outcome> value from that method. FYI, there is no submit button in the page.
Solomon Gnanadurai
Greenhorn

Joined: May 20, 2011
Posts: 24
Opening a new thread as this post seems to be closed
sibeswar bhaumik
Greenhorn

Joined: Jan 17, 2013
Posts: 2
I have a selectManyListbox like this-
<h:selectManyListbox id="AssociatedServiceCode" style="width: 160px" size="6"
value="#{ChannelSpeedBean.selectedAssociatedServiceCode}" label="error">
<f:selectItem id="all" itemLabel="Select All" itemValue="#{ChannelSpeedBean.associatedServiceCode}" />
<f:selectItems value="#{ChannelSpeedBean.associatedServiceCode}"/>
</h:selectManyListbox>
I want if someone double click on this selectManyListbox then all items will be selected.
can anyone help me?
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15961
    
  19

Please do not post the same question more than once. Besides, when you wake up an old dead thread, we call it a "zombie". We would prefer that instead of zombies that people just start their own threads. It keeps things easier to track.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: jsf 1.2 Facelets - Double clicks on a selectManyListbox
 
Similar Threads
Selecting some entries in selectManyListbox
jsf 1.2 Facelets & Richfaces 3.3 - Double clicks on a selectManyListbox
selectManyListBox
Problem with selectManyListbox
selectManyListbox