473,322 Members | 1,846 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Setting Select box using struts2 tag

9
Hi I have 2 combo boxes in a form.

When the one combo box say COMBO1 is changed, onchange event runs with the option selected being appended to the url and the action associated with that action called (refreshing the page).
Based on the URL, COMBO2 is set.

Now my problem is when page refreshes, COMBO1 is getting the same value as before ie Option1 remains selected.

I should mention at this time I am using Struts2 tag for the combo box.

I wanted to know if there is anyway of setting the value using struts2.
Oct 16 '08 #1
2 8876
Dököll
2,364 Expert 2GB
In your case I think you'd do rather well if you posted your code. Looks like I like of information is included. Might I suggest you post it just to see if anyone can help with Struts...

How's that for a deal?
Nov 18 '08 #2
karthickkuchanur
156 100+
Expand|Select|Wrap|Line Numbers
  1. function showAsDaily() {
  2.         document.getElementById('daily').options.length = 0;
  3.        if (document.forms[0].chartType.value=="TIMELINE") {
  4.             document.getElementById('daily').options[0] = new Option('DAYS','DAYS');
  5.         }
  6.         else {
  7.             document.getElementById('daily').options[0] = new Option('MONTHLY','MONTHLY');
  8.             document.getElementById('daily').options[1] = new Option('DAYS','DAYS');
  9.         }
  10.     }
Expand|Select|Wrap|Line Numbers
  1. <td>
  2.                 <bean:define id="ChartDisplayedTypeId" name="UserActivityForm" property="chartDisplayedTypeArray" scope="request" />
  3.  
  4.                 <html:select  property="chartDisplayedType" styleId="daily"  style="width:85%" styleClass="MandatoryTextboxFont" >
  5.                     <html:options collection="ChartDisplayedTypeId" property="value" labelProperty="label" />
  6.                 </html:select>    
  7.             </td>    

try this one
Nov 20 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

9
by: netclectic | last post by:
I'm dynamically adding options to a select list in javascript and i need to be able to set the height of the option, but setting style.height has not effect, I also tried style.pixelHeight but no...
7
by: danny | last post by:
Hello everyone, How can I go about setting a number of variables using a table which will have the variable names to be declared in one table. The data to be assigned will reside in another. As...
2
by: Petr Jakes | last post by:
Hi, I am trying to set-up communication to the coin change-giver from my Linux box using the Python code. The change giver uses MDB (Multi Drop Bus) serial protocol to communicate with the...
2
by: MLH | last post by:
Combo box LimitToList property setting of No does not prevent the MS Access error "The text you enter must match an entry in the list" from popping up. What makes this bad is that the error is not...
18
by: Dixie | last post by:
Can I set the Format property in a date/time field in code? Can I set the Input Mask in a date/time field in code? Can I set the Format of a Yes/No field to Checkbox in code? I am working on...
1
by: laredotornado | last post by:
Hi, I'm using PHP 4.4.4 on Apache 2 on Fedora Core 5. PHP was installed using Apache's apxs and the php library was installed to /usr/local/php. However, when I set my "error_reporting"...
3
by: Jason Carlton | last post by:
Is there a way to change the font-family and font-size for each individual option in a select menu? Something along the lines of: <select size="1"> <option style="font-family: Arial; font-size:...
6
by: metaperl | last post by:
I would like to check the setting of this variable in our MS-SQL 2000 database. Also, is there info on what the default value of this variable is?
1
by: javasachin | last post by:
Hello, I want to enable Struts2 Submit button <s:submit> in the client side using JavaScript based on the user inputs in some other controls (textboxes). If user is not entering any values in the...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.