Solved

Changing from html:text to html:select

Posted on 2004-09-21
3
176 Views
Last Modified: 2010-04-01
Hi!

I changed from the html:text to html:select and insert doesn’t work. When I view table, there are no record for it.
++++++++++++++++
<span class="data_heading"><bean:message key="label.flights"/>:</span>
<html:text property="flights"  styleClass="formfield" maxlength="10" size="10"/>

++++++++++++++++++
<span class="data_heading"><bean:message key="label.flights"/>:</span>
   <html:select property="flights" styleClass="formfield">
               <html:option value="">Select one</html:option>
            <html:option value="one">1</html:option>
            <html:option value="two">2</html:option>
               <html:option value="three">3</html:option>
         </html:select>&nbsp;&nbsp;&nbsp;
++++++++++++++++++
However, something like this works.
<span class="data_heading"><bean:message key="label.assistance"/>:</span>&nbsp;
      <html:select property="assistance" styleClass="formfield">
               <html:option value="">Select one</html:option>
            <html:option value="Independent">Independent</html:option>
            <html:option value="Supervision">Supervision</html:option>
               <html:option value="Contact">Contact guard</html:option>
         </html:select>

any idea?

0
Comment
Question by:dkim18
  • 2
3 Comments
 
LVL 35

Expert Comment

by:TimYates
ID: 12112497
What methods do you have for getFlights and setFlights in your form bean...

And how do they differ from getAssistance and setAssistance?

As far as I can see, your code should be ok...
0
 

Author Comment

by:dkim18
ID: 12112666
I thought it should be ok, but it doesn't work for database part...
+++++++++

      public String getFlights() {
            return flights;
      }
      /**
       * @param flights The flights to set.
       */
      public void setFlights(String flights) {
            this.flights = flights;

++++++++++++

      public String getAssistance() {
            return assistance;
      }
      /**
       * @param assistance The assistance to set.
       */
      public void setAssistance(String assistance) {
            this.assistance = assistance;
0
 
LVL 35

Accepted Solution

by:
TimYates earned 200 total points
ID: 12112743
That should work...

Are you sure the field in the database hasn't changed?  Or the database code itself?

Remember, you are now sending "one", "two" or "three", wheras you may have been expecting "1", "2", "3" before...

I'd print out the value before you add it to the database...  Then if that is null, I'd trace back through your code from database to ActionForm, printing out the value of that field as you go...you should see the point that it becomes null then, and fix the code...

Tim
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

With the rapid rise in mobile usage, mobile devices are here to stay and have become an integral part of doing business. Here are 9 great apps for your BYOD environment.
Knowledge base software has turned out to be a quite reliable method for storing information, promoting collaborative work and for sharing valuable input and solutions.However, some organizations are trying to develop a knowledge base that works wit…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now