Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Changing from html:text to html:select

Posted on 2004-09-21
3
Medium Priority
?
184 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 800 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

While opting for any web-to-print solution, you need to discuss with your team and some of your end users and know their opinions about your decisions. In this article we list down some questions you need to ask yourself.
By default Outlook 2016 displays only one time zone in the Calendar. The following article explains how to display two time zones in one calendar view.
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

721 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