473,441 Members | 1,842 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,441 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 8888
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.