Thanks for all the responses.
The problem was a stupid mistake.

In the tag I call the form bean I forgot to mention scope.
It shoud have been this way:

<html:form scope="request" name="editDocTypeForm" ........

Other than that the code I provided in the question message was quite the
right way to do it.
I did not have to use vars in the jsp page to pull up the form values.
It does that automatic.


Regards...



-----Original Message-----
From: Kris Thompson [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 10, 2002 8:04 PM
To: Struts Users Mailing List
Subject: Re: getting the form populated.


The other part of your problem is how you are trying to set the
properties in your form.  I have also been unsuccessful at trying to use
your style to set the properties.  However what does work for me is
using the value attribute on most of the html tags for setting the
default values on the input fields.

<html:select property="day" value="<%=WorkingMeeting.getCurrentDay() %>">
                    <html:options collection="days" property="value"
labelProperty="label" />
</html:select>

Hope this helps

Kris

Keith Bacon wrote:

>looks like your action is invoked by editDocType.do so has been started by
struts. You should use
>the form parameter passed in the perform method. Struts has created it for
you to fill in then
>will store it in the scope specified your action definition in
struts-config.xml, where your jsp
>can access it.
>Don't add your own version of it to the request.
>Hope I've understood your problem correctly - Keith.
>
>--- Cengiz Kayay <[EMAIL PROTECTED]> wrote:
>
>>Hi all.
>>I am new to struts. so my problem is:
>>I have a jsp page that calls an action.
>>I want my action to be called and populate the fields in the jsp page from
>>the form bean.
>>I have followed the instruction in previous messages in the list and ended
>>up with code as below:
>>
>>I call a link named editDocType.do?action=Edit&ID=1
>>Here I want the piece of code to work to go to db and find the row with
the
>>PK gives as 1.
>>then return this jsp page populated.
>>
>>            else if ("Edit".equals(action)) {
>>
>>                if (ID !=null){
>>                      // fetch the database and bring me the name...
>>              // name . suppose this exists...
>>
>>                        ((EditDocTypeForm) form).setName(name);
>>                        request.setAttribute("editDocTypeForm", form);
>>                    }
>>                    path= mapping.getInput();
>>                    path=  "editDocType.jsp?action=Edit&ID="+ ID;
>>                }
>>           }
>>      return new ActionForward(path);
>>
>>I know that this form is populated and set to request to be pulled up by
the
>>jsp page and be populated.
>>But It does not. It comes as null. and a new editFormBean is created.
>>By the way, I am running on Bluestone 7.3 servlet engine.
>>
>>If you have any input, I would greatly appreciate it.
>>
>>
>>Regards
>>
>>
>>
>>--------------------------------------------------------------------------
--
>>-
>>Cengiz Kayay
>>Solutions Architect  - ( Çözüm Uzmanı )
>>--------------------------------------------------------------------------
--
>>-
>>INNOVA Bilişim Çözümleri - INNOVA IT Solutions
>>http://www.innova.com.tr
>>
>>e-mail :  [EMAIL PROTECTED]  ,  [EMAIL PROTECTED]
>>Phone :  +(90) 212 216 3636  x 135
>>--------------------------------------------------------------------------
--
>>-
>>
>>
>>_________________________________________________________
>>Do You Yahoo!?
>>Get your free @yahoo.com address at http://mail.yahoo.com
>>
>>
>>--
>>To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
>>For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>
>>
>
>
>__________________________________________________
>Do You Yahoo!?
>Send FREE video emails in Yahoo! Mail!
>http://promo.yahoo.com/videomail/
>
>--
>To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
>For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>
>



_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to