Solved

Changing from html:text to html:select

Posted on 2004-09-21
3
175 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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Suggested Solutions

In this article, you will read about the trends across the human resources departments for the upcoming year. Some of them include improving employee experience, adopting new technologies, using HR software to its full extent, and integrating artifi…
Scam emails are a huge burden for many businesses. Spotting one is not always easy. Follow our tips to identify if an email you receive is a scam.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This video discusses moving either the default database or any database to a new volume.

705 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

18 Experts available now in Live!

Get 1:1 Help Now