Re: text field not populating after validate() fails.

2005-12-25 Thread Vikrama Sanjeeva
Hi,

 Ok I will read Rick's article. Right now situation is bit different
(I'm sure most of junior developers face more or less same situation). As
for me, I've certain deadline to achieve the functionality, which I have
achieved by just setting scope=session.

   Now as Rick said:

"(nothing wrong with using the Session either but personally I don't think
you should use the Session for storing lists for form dropdowns.) "

At this stage, I'm more curious about the difference b/w two approaches.
Which one is more effecient (in terms of performance), reliable and
scalable. So that I can adopt the right approach for future struts based
development.

Thanks guys for discussing this topic.

Bye,
Viki.


On 12/24/05, Rahul Akolkar <[EMAIL PROTECTED]> wrote:
>
> On 12/24/05, Vikrama Sanjeeva <[EMAIL PROTECTED]> wrote:
> > H,
> >  Rahul: The pull-down menus are prepopulated using the session. For
> > pull-down menus, I'm using the same approach as Rick used in "LESSON II
> - 9
> > - Create SetUpEmployeeAction". You can see here:
> > http://www.reumann.net/struts/lesson2/step9.do
> >
> 
>
> OK, my question was about the text fields and textareas that were
> *not* getting populated after validation failure.
>
> But, please see Rick's pointer in the earlier email to this thread.
>
> -Rahul
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


Re: text field not populating after validate() fails.

2005-12-24 Thread Rahul Akolkar
On 12/24/05, Vikrama Sanjeeva <[EMAIL PROTECTED]> wrote:
> H,
>  Rahul: The pull-down menus are prepopulated using the session. For
> pull-down menus, I'm using the same approach as Rick used in "LESSON II - 9
> - Create SetUpEmployeeAction". You can see here:
> http://www.reumann.net/struts/lesson2/step9.do
>


OK, my question was about the text fields and textareas that were
*not* getting populated after validation failure.

But, please see Rick's pointer in the earlier email to this thread.

-Rahul

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



Re: text field not populating after validate() fails.

2005-12-24 Thread Rick Reumann
On 12/24/05, Vikrama Sanjeeva <[EMAIL PROTECTED]> wrote:
>
>
> Rick: I've change the "scope" in struts-config from "request" to "session"
> and it is working fine now. But question is, why it is not working with
> scope=request?


Did you read this article I posted?
http://www.reumann.net/struts/articles/request_lists.jsp Not trying to avoid
the question, but I mention it there in better detail in the first
paragraph. You shouldn't need to use the Session to store those lists if you
read that article (nothing wrong with using the Session either but
personally I don't think you should use the Session for storing lists for
form dropdowns.)

--
Rick


Re: text field not populating after validate() fails.

2005-12-24 Thread Vikrama Sanjeeva
H,
 Rahul: The pull-down menus are prepopulated using the session. For
pull-down menus, I'm using the same approach as Rick used in "LESSON II - 9
- Create SetUpEmployeeAction". You can see here:
http://www.reumann.net/struts/lesson2/step9.do

Rick: I've change the "scope" in struts-config from "request" to "session"
and it is working fine now. But question is, why it is not working with
scope=request?

Bye,
Viki.


On 12/24/05, Rick Reumann <[EMAIL PROTECTED]> wrote:
>
> On 12/21/05, Vikrama Sanjeeva <[EMAIL PROTECTED]> wrote:
> >
> >
> > I have a form which consists of pull-down menus, radio button, text area
> > and text fields. The form takes all the required input fields from user,
> > validate them and if validation fail's, the same form is called with
> > pre-populated values (as entered 1st time by user). This is true when
> > there
> > is NO form "name" and "type" is given in form tag. But when I give form
> > "name" and "type" in form tag, only pull-down menus are populated if
> > validation fails. Whereas, text field, text area and radio buttons are
> not
> > pre-poulated.
> >
> >   I'm not sure what is going wrong here?? Below is the related code I'm
> > using.
>
>
>
> This is a classic problem and it is why I recommend you call your
> validation
> manually from your Action class. I decribe in detail the exact problem you
> are encountering here
> http://www.reumann.net/struts/articles/request_lists.jsp and the solution
> I
> like to use.
>
> --
> Rick
>
>


Re: text field not populating after validate() fails.

2005-12-23 Thread Rick Reumann
On 12/21/05, Vikrama Sanjeeva <[EMAIL PROTECTED]> wrote:
>
>
> I have a form which consists of pull-down menus, radio button, text area
> and text fields. The form takes all the required input fields from user,
> validate them and if validation fail's, the same form is called with
> pre-populated values (as entered 1st time by user). This is true when
> there
> is NO form "name" and "type" is given in form tag. But when I give form
> "name" and "type" in form tag, only pull-down menus are populated if
> validation fails. Whereas, text field, text area and radio buttons are not
> pre-poulated.
>
>   I'm not sure what is going wrong here?? Below is the related code I'm
> using.



This is a classic problem and it is why I recommend you call your validation
manually from your Action class. I decribe in detail the exact problem you
are encountering here
http://www.reumann.net/struts/articles/request_lists.jsp and the solution I
like to use.

--
Rick


Re: text field not populating after validate() fails.

2005-12-22 Thread Rahul Akolkar
On 12/22/05, Vikrama Sanjeeva <[EMAIL PROTECTED]> wrote:
> Actually I'm using a javascript which needs to define form name. And in
> struts, when you define form name it is mandatory to define type too.
>
>I just change the "scope" in struts-config from "request" to "session"
> and it is working fine now. But question is, why it is not working with
> scope=request?
>


What is the pre-population mechanism that you mention below? Is it
request-sensitive for the controls that don't get pre-populated?

-Rahul


> Bye,
> Viki.
>
> On 12/22/05, Laurie Harper <[EMAIL PROTECTED]> wrote:
> >
> > You shouldn't need either name or type, Struts will derive both from the
> > configuration. Since you say that's working OK for you, why are you
> > trying to add them?
> >
> > L.
> >
> > Vikrama Sanjeeva wrote:
> > > Hi,
> > >
> > >  I have a form which consists of pull-down menus, radio button, text
> > area
> > > and text fields. The form takes all the required input fields from user,
> > > validate them and if validation fail's, the same form is called with
> > > pre-populated values (as entered 1st time by user). This is true when
> > there
> > > is NO form "name" and "type" is given in form tag. But when I give form
> > > "name" and "type" in form tag, only pull-down menus are populated if
> > > validation fails. Whereas, text field, text area and radio buttons are
> > not
> > > pre-poulated.
> > >
> > >   I'm not sure what is going wrong here?? Below is the related code I'm
> > > using.
> > >
> > > / struts-config.xml***/
> > >
> > > 
> > >
> > >  > > type="com.world.MyActionClass"
> > > name="myForm"
> > > scope="request"
> > > validate="true"
> > > input="myForm.jsp"
> > > >
> > >  > > name="success"
> > > path="/myHome.jsp"/>
> > >  
> > >
> > > / struts-config.xml***/
> > >
> > > /START myForm.jsp***/
> > >
> > > 
> > >
> > >  > > method="post" enctype="multipart/form-data">
> > >
> > > Happy
> > >
> > > 
> > > Select Country
> > >   > property="countryName"
> > > labelProperty="countryName" />
> > > 
> > >
> > > 
> > >
> > >
> > >
> > > 
> > > / END myForm.jsp***/
> > >
> > >
> > > Bye,
> > > Viki.
> > >


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



Re: text field not populating after validate() fails.

2005-12-22 Thread Vikrama Sanjeeva
Actually I'm using a javascript which needs to define form name. And in
struts, when you define form name it is mandatory to define type too.

I just change the "scope" in struts-config from "request" to "session"
and it is working fine now. But question is, why it is not working with
scope=request?

Bye,
Viki.

On 12/22/05, Laurie Harper <[EMAIL PROTECTED]> wrote:
>
> You shouldn't need either name or type, Struts will derive both from the
> configuration. Since you say that's working OK for you, why are you
> trying to add them?
>
> L.
>
> Vikrama Sanjeeva wrote:
> > Hi,
> >
> >  I have a form which consists of pull-down menus, radio button, text
> area
> > and text fields. The form takes all the required input fields from user,
> > validate them and if validation fail's, the same form is called with
> > pre-populated values (as entered 1st time by user). This is true when
> there
> > is NO form "name" and "type" is given in form tag. But when I give form
> > "name" and "type" in form tag, only pull-down menus are populated if
> > validation fails. Whereas, text field, text area and radio buttons are
> not
> > pre-poulated.
> >
> >   I'm not sure what is going wrong here?? Below is the related code I'm
> > using.
> >
> > / struts-config.xml***/
> >
> > 
> >
> >  > type="com.world.MyActionClass"
> > name="myForm"
> > scope="request"
> > validate="true"
> > input="myForm.jsp"
> > >
> >  > name="success"
> > path="/myHome.jsp"/>
> >  
> >
> > / struts-config.xml***/
> >
> > /START myForm.jsp***/
> >
> > 
> >
> >  > method="post" enctype="multipart/form-data">
> >
> > Happy
> >
> > 
> > Select Country
> >   property="countryName"
> > labelProperty="countryName" />
> > 
> >
> > 
> >
> >
> >
> > 
> > / END myForm.jsp***/
> >
> >
> > Bye,
> > Viki.
> >
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


Re: text field not populating after validate() fails.

2005-12-21 Thread Laurie Harper
You shouldn't need either name or type, Struts will derive both from the 
configuration. Since you say that's working OK for you, why are you 
trying to add them?


L.

Vikrama Sanjeeva wrote:

Hi,

 I have a form which consists of pull-down menus, radio button, text area
and text fields. The form takes all the required input fields from user,
validate them and if validation fail's, the same form is called with
pre-populated values (as entered 1st time by user). This is true when there
is NO form "name" and "type" is given in form tag. But when I give form
"name" and "type" in form tag, only pull-down menus are populated if
validation fails. Whereas, text field, text area and radio buttons are not
pre-poulated.

  I'm not sure what is going wrong here?? Below is the related code I'm
using.

/ struts-config.xml***/





 

/ struts-config.xml***/

/START myForm.jsp***/





Happy


Select Country
 




   


/ END myForm.jsp***/


Bye,
Viki.




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