OnChange() event how does it work and what is the syntax

hi,
i have a field (County) on a form in a jsp page that needs to get all its values from the database and present it to the user also i have another field (year) this also needs to get all its values as a drop down from the database.
i dont have any lib tag available to use and can't afford the time to set this up. so just have to script in jsp or use beans in jsp.
my question is 2fold
Q1. - i was thinking of having a DataAccess (dA) object to run a sql to select * distict couties ...
also have another query in DataAccess select * Distinct year....
and in the jsp instantiate the (dA) and iterate through and fill the select drop down box - how to code this syntax i'm not sure and if this is the correct approach or the only approach would appreciate some sample code that i can mess around with thanks.
- is above approach best way of doing this. - also taking into account Q2.
Q2 - when the user selects county then i need to fire a onChange event - probably using javascript but not sure how this works - bascially i need to then update the year drop down according to the below sql-
again how is this possible - and is this the best approach or will it be too many calls to the database - especially consdering that the forms are all part of a search tool.
SELECT     DISTINCT     v.year
FROM          v_volumes     v
WHERE          v.county     = <the selected county>
OR          (v.county_reference     =
               (SELECT     ca.county_reference
                FROM          county_aliases     ca
                ,          counties     c
                WHERE     ca.county_reference_also_called     = c.county_reference
                AND          c.county     = <the selected county>)
ORDER BY v.year

Sorry to rain on your parade, but its not going to be quite that simple.
Populating a second dropdown depending on the first one, has been discussed quite in depth on this forum, I suggest you do a search to look at older posts.
Javascript code cannot call java/database code from an onclick event.
The best it can do is trigger a form submission, which reloads the page
running any java/sql code that displaying the page entails.
So onlick event on the first dropdown triggers a form submit, which loads the page with the correct values in the second dropdown.
con: requires a page request
The other approach is to download ALL possible values to the jsp page, and have javascript handle the swapping of values.
pro: no page refresh needed
con: must have all data available on the page. javascript is a bit more complicated.
Hope this helps,
evnafets

Similar Messages

  • My iPhone was stolen and I have contacted the police who are using the meid number to locate.  How does this work and what are my chances of getting the phone back?

    My iPhone was stolen.  I used Find My iPhone app to lock it and display a message.  The phone has not connected to the internet to locate it.  I contacted the police and they have taken my meid number.  How does this work and what are my chances of getting the phone back?  Are there other ways the theif can use it.  I was told once they put in a new sim card and use it, whatever software the police have, it will show up.

    Honestly? In the US (I can't speak to other countries, though I doubt it works much differently in a lot of the world) The police took your report and filed it either in their computers or, on paper. They will now not think of this again. The only time it will cross anyones mind is if, in the course of entering information into evidence about items recovered or seized at a crime scene, the serial number of an iPhone that was found/seized happens to match yours, in which case you will be contacted.
    The police in the US can and will do nothing to 'blok' the phone and it's not worth their time to try and locate it unless you know for a fact that it was stolen by a big time drug lord, master criminal, or some other such prime target and they can get a court order to track the location of the phone in order to locate this individual for your own purposes.  If they do that, they'll probably keep him under surveilance for a year or so before they act.
    Basically, the police don't care about your phone. If they find it, they will give it back to you. They are not, however, going to go looking for it. They have better things to do.
    I'm sorry, but that's the way it is.

  • I'm still confused!!! How does it work and what happens to...

    I have spoken to peeps in apple store as well as apple support but its like talking to geekbots. I have a mess of a music collection on at least two devices and a hard drive. If I purchase iTunes Match what exactly happens?
    Do I sign up on my m/mini then later log in from macbook and iT/Match will automatically find the additional songs that are on Macbook and upload them too increasing my overall collection?
    How does it improve the rate to 256? Is that only when lstening to streamed music or does it upgrade the songs on my hard drive?
    It feels like something that was thrown out there but not fully explained, no wonder I don't know a single person that has subscribed

    yerpal wrote:
    Do I sign up on my m/mini then later log in from macbook and iT/Match will automatically find the additional songs that are on Macbook and upload them too increasing my overall collection?
    Yes. Be sure and do one computer at a time and do not enable iTM on any iOS devices until both computers are finished with the initial scans.
    yerpal wrote:
    How does it improve the rate to 256? Is that only when lstening to streamed music or does it upgrade the songs on my hard drive?
    If the song is "matched" then you delete the version that is your iTunes library, but not from the cloud, and download the matched file. Nothing is done automatically.
    yerpal wrote:
    It feels like something that was thrown out there but not fully explained, no wonder I don't know a single person that has subscribed
    See this page on the Apple web site for more info: http://www.apple.com/itunes/itunes-match/

  • How does iPhoto work? What are the guts?

    I am a recent switcher from Windows and have been running OSX since the black MacBooks have come out. I used and loved Picasa on windows for pics. I have been using iPhoto and have run into problems.
    I am trying to get my head around just how iPhoto works. I am interested in how iPhoto imports, stores and works with photo libraries and photos. It seems extremely convoluted to me. Here is an example.
    In my 'Pictures' folder, I have folders: 'Personal 2000' , 'Personal 2001' , 'Personal 2002' , etc, etc
    - I open iPhoto and choose 'Import to Library...' I choose to import a single folder from 'Personal 2002' titled 'xmas'
    - I now have in that same 'Pictures' folder a folder called: 'iPhoto Library'
    - in the 'iPhoto Library' folder are now folders called:
    - 'Data'
    - 'Modified'
    - 'Originals'
    - In each of these new folders (data, modified, originals) are now folders with just years
    -'2002'
    - and then in '2002' in each of those folders there is a folder called 'xmas'
    - and in each xmas folder there are now four copies of my original photo
    So I have gone from one original photo to four photo in four different places. This is crazy! I am trying to get my head around things and understand how to work with iPhoto and organize things but I could use some help.
    Please help me understand. Does the book iPhoto 6 the missing manual help explain????

    Mike
    The point of iPhoto is that it does the file management for you.
    It's a database, with built in image viewer and lightweight editing. The database is designed (like all databases) so that you interact with the data via the application, not the Finder.
    So in your iPhoto Library Folder you will find various files that make up the Library, plus three Folders.
    Originals: This contains the photos as they were downloaded from your camera (or scanner)
    Modified: This contains the photos that you have edited or altered in any way - fixed red-eye, rotated, whatever. This allows you to use the Photos -> Revert To Originall command - which allows you to dump changes that you may not like.
    The data folder contains the thumbnails that the app uses to display the pics in the iPhoto WIndow . SO you can see there is no actual duplication, but apparently much!
    If you use iPhoto to do the file management then your folders become irrelevant, and once your content that the photos are safe in iPhoto you can trash them.
    You can keep your own folders and do your own file management (go Preferences -> Advanced and uncheck Importing - Copy Files to iPhoto Library Folder ...) and then iPhoto will leave your file structure alone, However it will still make the data and Modifieds folders.
    Through the iPhoto WIndow you can do everything you need to do with the photos. You can make slide shows and albums, keyword for fast searching, make smart self-updating albums, effortlessly export the files. Evne just drag and drop one to the desktop. In all caes iPhoto works with a COPY of the file, so that your original remains safe and sound. And of course, you can completlely recreate your folder organisation in the iPhoto WIndow .
    I hope that's clear, if you have further questions feel free to ask more.
    Regards
    TD

  • How does Xsan work, and what do I need?

    Hi,
    I want to run one copy of Logic Express on around 15 iMac's. The storage for Logic is going to be on and XServes, but teh actual music will be stored on the school network. What would i Need? (hardware wise?)
    Thanks,
    James

    If you're going to use iMacs, you don't really need Xsan, because it uses fibre channel for storage and you can't put a fibre channel card in an iMac.
    Probably you want an Xserve + Xserve RAID set up as a file server.

  • How does charging work? What are the rates?

    Just signed up for STG. Before I get going with it, just want to make sure I fully understand it.
    - I call the local number assigned to the out of country one
    - I'm charged local rates for the call (uses my normal cell minutes)
    - My Skype account is charged for the call - same rates as when I use the software?
    Thanks.

    od1 wrote:
    - I call the local number assigned to the out of country one
    - I'm charged local rates for the call (uses my normal cell minutes)
    - My Skype account is charged for the call - same rates as when I use the software?
    Hello,
    1. Yes.
    2. No. Your Skype account is charged with the cost of the call at the prevailing Skype call rate to wherever you are calling. You can use either a Call Plan or Skype Credit.
    3. Yes.
    Skype To Go number call costs break down into two parts:
    1. Operator costs
    Dialing your Skype To Go number is a local call in most cases. This may be included in the free minutes you get
    from your operator.
    2. Skype costs
    The call is charged at Skype's low rates, the same as when
    calling phones from Skype on your computer.
    Effectively - for the cost of accessing your local STG # (it may be free within your cellphone Plan) you have the freedom of calling
    anywhere at Skype rates using your cellphone or landline.
    TIME ZONE - US EASTERN. LOCATION - PHILADELPHIA, PA, USA.
    I recommend that you always run the latest Skype version: Windows & Mac
    If my advice helped to fix your issue please mark it as a solution to help others.
    Please note that I generally don't respond to unsolicited Private Messages. Thank you.

  • I am using firefox 3.6.17 i upgraded it to 4.1.but it does not work properly sometimes it opens every website and most of the time it does not work . so what is the problem please help . thank you

    i am using firefox 3.6.17 i upgraded it to 4.1.but it does not work properly sometimes it opens every website and most of the time it does not work . so what is the problem please help . thank you

    Did you check your security software (firewall)?
    A possible cause is security software (firewall) that blocks or restricts Firefox or the plugin-container process without informing you, possibly after detecting changes (update) to the Firefox program.
    Remove all rules for Firefox from the permissions list in the firewall and let your firewall ask again for permission to get full unrestricted access to internet for Firefox and the plugin-container process.
    See:
    * [[Server not found]]
    * [[Firewalls]]

  • Past from 1year am using 4s in India...if we carry this phone to Australia does this phone work...If its does not work Then what is the procedure..???

    Past from 1year am using 4s in India...if we carry this phone to Australia does this phone work...
    If its does not work Then what is the procedure..???

    Call AppleCare and tell them you just want to know if your iPhone is unlocked and if not, who is it locked with. If it is locked contact the cell provider and ask them what their unlock process is and complete it if you qualify.

  • Dear Sirs,when i use the computer updating my iphone to ios 7.1,suddenly black out.The computer has no power and my iphone does not work and keep display the screen that connect to itunes. so when i connect my iphone to iTunes, it says"itunes has detected

    Dear Sirs,when i use the computer updating my iphone to ios 7.1,suddenly black out.The computer has no power and my iphone does not work and keep display the screen saying the iphone need to connect to itunes. So when i connect my iphone to iTunes, the computer says"itunes has detected an iphone in recovery mode. you must restore this iphone before it can be used with itunes"
    So my question is if I click OK(restore the iphone),will i lose all my data and whatsapp??
    Thank you for your help and time.
    Regards,
    hopeless

    If you didn't back up the phone to iCloud or iTunes (on your computer) BEFORE attempting the update, the data will be lost.

  • How does Index fragmentation and statistics affect the sql query performance

    Hi,
    How does Index fragmentation and statistics affect the sql query performance
    Thanks
    Shashikala
    Shashikala

    How does Index fragmentation and statistics affect the sql query performance
    Very simple answer, outdated statistics will lead optimizer to create bad plans which in turn will require more resources and this will impact performance. If index is fragmented ( mainly clustered index,holds true for Non clustred as well) time spent in finding
    the value will be more as query would have to search fragmented index to look for data, additional spaces will increase search time.
    Please mark this reply as the answer or vote as helpful, as appropriate, to make it useful for other readers
    My TechNet Wiki Articles

  • Can any guide me how to gather requirements and what r the approaches!

    HI
    Can any guide me how to gather requirements and what r the approaches and documents.
    Regards
    VSM

    Modeling approach:
    Top down - Try and find out what kind of reports the users need. Based o that you can determine your granularity of data.
    Have to find out what the sources are. Then decide if you have standard content or if you need to enhance or develop new objects.
    Try and see if standard reports are enough.
    If they ned aggregated data, decide on cubes. Then decide what all business areas the reports encompass. Based on that u can decide to build multiproviders or infosets depending on requirement.
    try to incorporate all the keyfigures  and characteristics in your data model.
    then decide how many layer ODS's you might need.
    then come up with a data model accordingly.

  • Was told a USB device would create a PDF automatically from the data contained within when plugged into my USB port. Doesn't seem to work. How does this work and how can I fix the device I received?

    Acrobat is not on the USB device - only Adobe Reader needed on the PC. How does this work? How can I fix this device if at all?

    You need to ask the people who sold it to you. Doesn't sound like it has anything to do with Reader.
    However, you should be wary of devices that automatically try to open files when plugged in. They can also infect your computers with all kinds of viruses or malware.

  • I have an iPhone4s,and it gets heated when i use it,(when I start using the internet)?why does this happen and what is the solution to this.Please Help.

    I had bought an iPhone 4S just few days back.And I have noticed that the phone gets quite hot while i am using internet.Can u guys tell me why this happens and what is the solution to this.

    Hi, I take it its not just a bit warm?

  • Genius - How does it work and why doesn't it often?

    This is just to ask fellow users to bring some light in how Genius works, and help the builders/designers to get it better. I often find some strange anamolies in the results, and I just would like to know what could be behind those...
    So for starters: The Beatles - Maxwell's Silver Hammer
    Not the most populair Beatles song, but still probably on the iPods and iPhones of thousands of users. So how come it won't come up with a possible playlist? Which tags are used? Does it have to do with the fact that songs are only officially available since a month or so? Why doesn't it take songs from the same period or style anyway, using the tags? Why do other Beatles songs come up with results? Why doesn't it take other songs from the same album, as that always should "fit"?

    StaceyR
    Posts: 12
    From: USA
    Registered: Feb 17, 2008
    Genius Playlist
    Posted: Dec 9, 2010 11:33 AM Reply Email
    I'm curious if anyone knows why Genius playlists can't be generated for some songs that do show related songs in the Ping/Genius sidebar. It just seems like if Genius knows enough about the song to suggest other songs in the sidebar, it would know enough about it to generate a playlist. I'm getting the message "Genius is unavailable...." NOT "Genius does not have enought related songs...."
    HP Pavilion Windows XP
    Jeremy Banana
    Posts: 2
    From: Cambodia
    Registered: Dec 19, 2010
    New! Re: Genius Playlist
    Posted: Dec 19, 2010 8:24 PM in response to: StaceyR Reply Email
    Yeah. I got the message when I tried it on "Imagine" by John Lennon.
    Pentium 5 Windows ME

  • How does google work out what country you are browsing from?

    Hi,
    Does anyone know how sites like google know what country you are browsing from and automatically forwards you to the local country site? I would like to do something similar with an ApEx application I am writing, showing country-specific things without prompting the user for their country.
    Thanks,
    Bill
    Message was edited by:
    user497072

    Google for keywords like geolocation IP address
    See
    http://linuxjournal.com/article/7856
    Read all the comments people have written for that article, they are very informative.
    I found http://www.dnsstuff.com/tools/city.ch to be uncannily accurate!
    See http://www.ip2location.com/

Maybe you are looking for

  • PHP Debugging in DW?

    Sorry if this has been asked before, but what is the level of sophistication when debugging PHP in DW? Is this possible? I'm considering purchasing the Zend package in order to get a "professional debugger," but if DW can at least work for some basic

  • Whenever i want to use the store i get a message sorry cannot connect you to the store?

    whenever i want to get connected to the store i get a message sorry we cannot connect you try again later? **** frustrating

  • Restrict the number of rows in XML publisher

    Hi All, I have report which has header and lines. I want to display all the lines corresponding to an header in one page in xml publisher. Please suggest. Thanks and Regards, Mahesh

  • [SOLVED] ath9k_htc not loading

    I just built a needed wireless driver (ath9k_htc) from AUR.  I thought that installing it from pacman would place it in the correct location for loading, but after reboot, 'lspci -k' showed the module hadn't been loaded, even though I'd set up a conf

  • IPhone not charging via USB

    I just got this weird problem today. I have a 2G iPhone running 2.2 1. iPhone is not charging with the USB cable to my MacBook and not recognizing by iTunes, thus I can't sync anymore. 2. I can use the same USB cable to charge the iTouch from my MacB