Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • Post Reply 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

A4j:Support Problem

 
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All
I have Form In which User is entering his address details
Country State City Area PIN
this all fields are drop down list ( h:selectOneMenu )
When i select county it populates State and on selection of State It populates City so on
I am using a4j:support to call function.
My problem is user should be able to select State or city or pin by using keybord or by mouse
ie two event ( onkeyup and select ) shoud work
How to do it ???

THANKS YOU
 
Saloon Keeper
Posts: 22279
151
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try onchange, instead.
 
Tim Holloway
Saloon Keeper
Posts: 22279
151
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To be more precise, set up an a4j for onchange, create a changeListener for the selectOneMenuItem and prep the SelectItem list in the changeListener method.

I normally just null the cached SelectItem list in the changeListener and populate it in the get SelectItemList method when the cached copy of the list is found to be null.
 
Greenhorn
Posts: 27
Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
It is very easy yaar
put <a4j:support event="onchange" reRender="ID"/>
 
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just curious, can we use multiple tags instead of one to support both keyboard and mouse functionality using below code

<a4j:support event="onchange" reRender="ID"/>
<a4j:support event="onkeyup" reRender="ID"/>
 
Tim Holloway
Saloon Keeper
Posts: 22279
151
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

naveen gupta wrote:Just curious, can we use multiple tags instead of one to support both keyboard and mouse functionality using below code

<a4j:support event="onchange" reRender="ID"/>
<a4j:support event="onkeyup" reRender="ID"/>



Yes, you can.
 
Your mother is a hamster and your father smells of tiny ads!
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic