Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

jsf 1.2 Facelets - Double clicks on a selectManyListbox

 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
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.
 
Saloon Keeper
Posts: 28424
210
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
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.
 
Solomon Gnanadurai
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
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
Posts: 28424
210
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
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
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
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
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
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
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Opening a new thread as this post seems to be closed
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
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
Posts: 28424
210
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
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.
 
We can fix it! We just need some baling wire, some WD-40, a bit of duct tape and this tiny ad:
New web page for Paul's Rocket Mass Heaters movies
https://coderanch.com/t/785239/web-page-Paul-Rocket-Mass
    Bookmark Topic Watch Topic
  • New Topic