Return-Path: Delivered-To: apmail-struts-user-archive@www.apache.org Received: (qmail 14037 invoked from network); 6 Apr 2005 15:23:57 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 6 Apr 2005 15:23:57 -0000 Received: (qmail 18936 invoked by uid 500); 6 Apr 2005 15:23:40 -0000 Delivered-To: apmail-struts-user-archive@struts.apache.org Received: (qmail 18909 invoked by uid 500); 6 Apr 2005 15:23:39 -0000 Mailing-List: contact user-help@struts.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Struts Users Mailing List" Reply-To: "Struts Users Mailing List" Delivered-To: mailing list user@struts.apache.org Received: (qmail 18893 invoked by uid 99); 6 Apr 2005 15:23:39 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from maui.ebi.ac.uk (HELO maui.ebi.ac.uk) (193.62.196.100) by apache.org (qpsmtpd/0.28) with ESMTP; Wed, 06 Apr 2005 08:23:38 -0700 Received: from ebi.ac.uk (pinky.ebi.ac.uk [172.22.8.152]) by maui.ebi.ac.uk (8.11.7+Sun/8.11.7) with ESMTP id j36FNXm23949; Wed, 6 Apr 2005 16:23:33 +0100 (BST) Message-ID: <4253FEF5.3030806@ebi.ac.uk> Date: Wed, 06 Apr 2005 16:23:33 +0100 From: Anja Friedrichsen User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7b) Gecko/20040329 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Struts Users Mailing List , mark_benussi@hotmail.com Subject: Re: change selected item in drop down list References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-EBI-Information: This email is scanned using www.mailscanner.info. X-EBI: Found to be clean X-EBI-SpamCheck: not spam, SpamAssassin (score=0, required 5) X-Virus-Checked: Checked X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Thanks for your answer Mark, I am new with JavaScripts and I tried your example, but it does not really work... I tried to do alert(options); after var options = form.elements['select'].options[i]; but nothing happend. What exactly is that line doing? Thanks, Anja Mark Benussi wrote: >Yes you can select an option in a selection, but you would need to know the >index of the option. > >form.elements['select'].options[i].selected = true; > >When generating the select using the html:options argument your presentation >layer wont have much knowledge of the data passed so you will have to >recurse the options until you find one that matches your selection on the >map. > >function somethingHappened(mapSelection) { > var options = form.elements['select'].options[i]; > for(var i = 0; i < options.length; i++) { > var option = options[i]; > if(option.value == mapSelection) { > option.selected = true; > break; > } > } >} >-----Original Message----- >From: Anja Friedrichsen [mailto:afrie@ebi.ac.uk] >Sent: 06 April 2005 11:20 >To: Struts Users Mailing List >Subject: change selected item in drop down list > >Hi! > >My application is based on stuts and contains among other thing a >dropdown list and a graph. What I want to do, is to change the selected >item in the drop down list, when clicking on the corresponding node in >the graph. >Is it possible to change the selected item in a dropdown list? > >My drop down list looks like that: > > > property="shortlabel" labelProperty="shortlabel" /> > > >Thanks in advanced! > >Anja > >--------------------------------------------------------------------- >To unsubscribe, e-mail: user-unsubscribe@struts.apache.org >For additional commands, e-mail: user-help@struts.apache.org > > >--------------------------------------------------------------------- >To unsubscribe, e-mail: user-unsubscribe@struts.apache.org >For additional commands, e-mail: user-help@struts.apache.org > > > --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@struts.apache.org For additional commands, e-mail: user-help@struts.apache.org