Re: S2: Autocompleter and focus
var TEAM_LOOKUP = 2; function onbodyload() { var f = document.getElementById('mainForm'); var t = f.elements[TEAM_LOOKUP]; t.value = parent.originalValue; t.focus(); // this does not work! why? } Scott --- jdmr [EMAIL PROTECTED] wrote: Would you mind posting the onload script? I'm having trouble with it... Thanks... David M. Scott Nesbitt wrote: I am having trouble setting the focus on an autocompleter field. When I print out all the fields in my overlay, I see three for the sports team autocompleter: sportsTeam sportsTeamKey (one with no name) (why does it have no name?) Here is how it is declared: s:autocompleter name=sportsTeam id=sportsTeam keyName=sportsTeamKey theme=ajax formId=mainForm href=%{#autosportsteam} cssStyle=width: 430px; dropdownHeight=180; loadMinimumCount=2 loadOnTextChange=true autoComplete=false showDownArrow=false delay=100 searchType=substring forceValidOption=true/ In my onbodyload() function I set the value of the field with no name and it works. However, when I try to set the focus on the one with no name it ignores it and none of the overlay fields has focus. I tried adding dataFieldName but despite the documentation it says the attribute is not recognized. Any suggestions? Thanks, Scott __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/S2%3A-Autocompleter-and-focus-tf3601635.html#a10221734 Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: S2: Autocompleter and focus
There are 3 input for each autocompleter, the one with the value, and the one with the key are hidden, so setting the focus on them won't work, you need to use the visible one. regards musachy On 5/2/07, Scott Nesbitt [EMAIL PROTECTED] wrote: var TEAM_LOOKUP = 2; function onbodyload() { var f = document.getElementById('mainForm'); var t = f.elements[TEAM_LOOKUP]; t.value = parent.originalValue; t.focus(); // this does not work! why? } Scott --- jdmr [EMAIL PROTECTED] wrote: Would you mind posting the onload script? I'm having trouble with it... Thanks... David M. Scott Nesbitt wrote: I am having trouble setting the focus on an autocompleter field. When I print out all the fields in my overlay, I see three for the sports team autocompleter: sportsTeam sportsTeamKey (one with no name) (why does it have no name?) Here is how it is declared: s:autocompleter name=sportsTeam id=sportsTeam keyName=sportsTeamKey theme=ajax formId=mainForm href=%{#autosportsteam} cssStyle=width: 430px; dropdownHeight=180; loadMinimumCount=2 loadOnTextChange=true autoComplete=false showDownArrow=false delay=100 searchType=substring forceValidOption=true/ In my onbodyload() function I set the value of the field with no name and it works. However, when I try to set the focus on the one with no name it ignores it and none of the overlay fields has focus. I tried adding dataFieldName but despite the documentation it says the attribute is not recognized. Any suggestions? Thanks, Scott __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/S2%3A-Autocompleter-and-focus-tf3601635.html#a10221734 Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Hey you! Would you help me to carry the stone? Pink Floyd
Re: S2: Autocompleter and focus
Would you mind posting the onload script? I'm having trouble with it... Thanks... David M. Scott Nesbitt wrote: I am having trouble setting the focus on an autocompleter field. When I print out all the fields in my overlay, I see three for the sports team autocompleter: sportsTeam sportsTeamKey (one with no name) (why does it have no name?) Here is how it is declared: s:autocompleter name=sportsTeam id=sportsTeam keyName=sportsTeamKey theme=ajax formId=mainForm href=%{#autosportsteam} cssStyle=width: 430px; dropdownHeight=180; loadMinimumCount=2 loadOnTextChange=true autoComplete=false showDownArrow=false delay=100 searchType=substring forceValidOption=true/ In my onbodyload() function I set the value of the field with no name and it works. However, when I try to set the focus on the one with no name it ignores it and none of the overlay fields has focus. I tried adding dataFieldName but despite the documentation it says the attribute is not recognized. Any suggestions? Thanks, Scott __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/S2%3A-Autocompleter-and-focus-tf3601635.html#a10221734 Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: S2: Autocompleter and focus
Hello, i´m testing s:autocompleter (struts 2.0.6), but is not working, dojo is showing an error, is not finding the file struts/struts.js. Any ideas?? Thanks. 2007/4/19, Musachy Barroso [EMAIL PROTECTED]: IMO you might get better help on the Dojo forum. You should also check Dojo's code for ComboBox as I know they are hooking listeners to the focus events. Another suggestion is to try what you are doing on a simple page using Dojo's widget, without Struts, that way you will know if it is a Dojo or an Struts problem. musachy On 4/19/07, Scott Nesbitt [EMAIL PROTECTED] wrote: I do use the visible, nameless one to hold the value. However, though I can set the value on it, it ignores my request for focus(). So are you are saying I should ask this in the Dojo area? Thanks, Scott --- Musachy Barroso [EMAIL PROTECTED] wrote: One has the ${name} you entered in the name attribute, and it will have the value entered on the visible input. The one with the name ${name}Key has the key for the selected value, and the visible one (the one with no name) is for typing. Why not use the visible one as the one holding the value? It is a Dojo thing and I'm not sure why, but there is probably a good reason :). The focus should be set on the visible one. musachy On 4/18/07, Scott Nesbitt [EMAIL PROTECTED] wrote: I am having trouble setting the focus on an autocompleter field. When I print out all the fields in my overlay, I see three for the sports team autocompleter: sportsTeam sportsTeamKey (one with no name) (why does it have no name?) Here is how it is declared: s:autocompleter name=sportsTeam id=sportsTeam keyName=sportsTeamKey theme=ajax formId=mainForm href=%{#autosportsteam} cssStyle=width: 430px; dropdownHeight=180; loadMinimumCount=2 loadOnTextChange=true autoComplete=false showDownArrow=false delay=100 searchType=substring forceValidOption=true/ In my onbodyload() function I set the value of the field with no name and it works. However, when I try to set the focus on the one with no name it ignores it and none of the overlay fields has focus. I tried adding dataFieldName but despite the documentation it says the attribute is not recognized. Any suggestions? Thanks, Scott __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Hey you! Would you help me to carry the stone? Pink Floyd __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Hey you! Would you help me to carry the stone? Pink Floyd
Re: S2: Autocompleter and focus
I do use the visible, nameless one to hold the value. However, though I can set the value on it, it ignores my request for focus(). So are you are saying I should ask this in the Dojo area? Thanks, Scott --- Musachy Barroso [EMAIL PROTECTED] wrote: One has the ${name} you entered in the name attribute, and it will have the value entered on the visible input. The one with the name ${name}Key has the key for the selected value, and the visible one (the one with no name) is for typing. Why not use the visible one as the one holding the value? It is a Dojo thing and I'm not sure why, but there is probably a good reason :). The focus should be set on the visible one. musachy On 4/18/07, Scott Nesbitt [EMAIL PROTECTED] wrote: I am having trouble setting the focus on an autocompleter field. When I print out all the fields in my overlay, I see three for the sports team autocompleter: sportsTeam sportsTeamKey (one with no name) (why does it have no name?) Here is how it is declared: s:autocompleter name=sportsTeam id=sportsTeam keyName=sportsTeamKey theme=ajax formId=mainForm href=%{#autosportsteam} cssStyle=width: 430px; dropdownHeight=180; loadMinimumCount=2 loadOnTextChange=true autoComplete=false showDownArrow=false delay=100 searchType=substring forceValidOption=true/ In my onbodyload() function I set the value of the field with no name and it works. However, when I try to set the focus on the one with no name it ignores it and none of the overlay fields has focus. I tried adding dataFieldName but despite the documentation it says the attribute is not recognized. Any suggestions? Thanks, Scott __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Hey you! Would you help me to carry the stone? Pink Floyd __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: S2: Autocompleter and focus
IMO you might get better help on the Dojo forum. You should also check Dojo's code for ComboBox as I know they are hooking listeners to the focus events. Another suggestion is to try what you are doing on a simple page using Dojo's widget, without Struts, that way you will know if it is a Dojo or an Struts problem. musachy On 4/19/07, Scott Nesbitt [EMAIL PROTECTED] wrote: I do use the visible, nameless one to hold the value. However, though I can set the value on it, it ignores my request for focus(). So are you are saying I should ask this in the Dojo area? Thanks, Scott --- Musachy Barroso [EMAIL PROTECTED] wrote: One has the ${name} you entered in the name attribute, and it will have the value entered on the visible input. The one with the name ${name}Key has the key for the selected value, and the visible one (the one with no name) is for typing. Why not use the visible one as the one holding the value? It is a Dojo thing and I'm not sure why, but there is probably a good reason :). The focus should be set on the visible one. musachy On 4/18/07, Scott Nesbitt [EMAIL PROTECTED] wrote: I am having trouble setting the focus on an autocompleter field. When I print out all the fields in my overlay, I see three for the sports team autocompleter: sportsTeam sportsTeamKey (one with no name) (why does it have no name?) Here is how it is declared: s:autocompleter name=sportsTeam id=sportsTeam keyName=sportsTeamKey theme=ajax formId=mainForm href=%{#autosportsteam} cssStyle=width: 430px; dropdownHeight=180; loadMinimumCount=2 loadOnTextChange=true autoComplete=false showDownArrow=false delay=100 searchType=substring forceValidOption=true/ In my onbodyload() function I set the value of the field with no name and it works. However, when I try to set the focus on the one with no name it ignores it and none of the overlay fields has focus. I tried adding dataFieldName but despite the documentation it says the attribute is not recognized. Any suggestions? Thanks, Scott __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Hey you! Would you help me to carry the stone? Pink Floyd __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Hey you! Would you help me to carry the stone? Pink Floyd
Re: S2: Autocompleter and focus
One has the ${name} you entered in the name attribute, and it will have the value entered on the visible input. The one with the name ${name}Key has the key for the selected value, and the visible one (the one with no name) is for typing. Why not use the visible one as the one holding the value? It is a Dojo thing and I'm not sure why, but there is probably a good reason :). The focus should be set on the visible one. musachy On 4/18/07, Scott Nesbitt [EMAIL PROTECTED] wrote: I am having trouble setting the focus on an autocompleter field. When I print out all the fields in my overlay, I see three for the sports team autocompleter: sportsTeam sportsTeamKey (one with no name) (why does it have no name?) Here is how it is declared: s:autocompleter name=sportsTeam id=sportsTeam keyName=sportsTeamKey theme=ajax formId=mainForm href=%{#autosportsteam} cssStyle=width: 430px; dropdownHeight=180; loadMinimumCount=2 loadOnTextChange=true autoComplete=false showDownArrow=false delay=100 searchType=substring forceValidOption=true/ In my onbodyload() function I set the value of the field with no name and it works. However, when I try to set the focus on the one with no name it ignores it and none of the overlay fields has focus. I tried adding dataFieldName but despite the documentation it says the attribute is not recognized. Any suggestions? Thanks, Scott __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Hey you! Would you help me to carry the stone? Pink Floyd