You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Sheldon Hearn <sh...@starjuice.net> on 2004/01/07 18:59:27 UTC

How to reset properties of a DynaValidatorForm

Hi folks,

How are you supposed to reset properties of a DynaValidatorForm?

The source suggests that DynaValidatorForm.reset() doesn't actually
reset values to their defaults, and calling the method certainly doesn't
do what I expected.

I need to be able to do this from inside an action, so I can clear the
values on success.  This is necessary when success forwards to the page
with the form on it, where you don't want the value that was just
provided to appear in the form again, because it's been dealt with.

Ciao,
Sheldon.

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


RE: How to reset properties of a DynaValidatorForm

Posted by Matthias Wessendorf <ma...@matthias-wessendorf.de>.
oh.
sorry for that.
it was late...,
when i answerd on your mail...
:-)

greetings
Matthias

-----Original Message-----
From: Sheldon Hearn [mailto:sheldonh@starjuice.net] 
Sent: Thursday, January 08, 2004 11:38 AM
To: Struts Users Mailing List
Subject: Re: How to reset properties of a DynaValidatorForm


On (2004/01/08 01:00), Matthias Wessendorf wrote:

> i dind´t say, that is reset==initialize()

I wasn't disagreeing with you.  I meant "oh, you're right, reset() isn't
what I want, but initialize() is". :-)

Thanks,
Sheldon.

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Re: How to reset properties of a DynaValidatorForm

Posted by Sheldon Hearn <sh...@starjuice.net>.
On (2004/01/08 01:00), Matthias Wessendorf wrote:

> i dind´t say, that is reset==initialize()

I wasn't disagreeing with you.  I meant "oh, you're right, reset() isn't
what I want, but initialize() is". :-)

Thanks,
Sheldon.

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


RE: How to reset properties of a DynaValidatorForm

Posted by Matthias Wessendorf <ma...@matthias-wessendorf.de>.
i dind´t say, that is reset==initialize()

greetings

mw


-----Original Message-----
From: Sheldon Hearn [mailto:sheldonh@starjuice.net] 
Sent: Wednesday, January 07, 2004 7:09 PM
To: Struts Users Mailing List
Subject: Re: How to reset properties of a DynaValidatorForm


On (2004/01/07 19:03), Matthias Wessendorf wrote:

> but you can
> set the properties to its default,
> is this what you want?
> 
> DynaValidatorForm myForm = (DynaValidatorForm) form;
> 		
> myForm.initialize(actionMapping);

Duh, that's it.  reset() != initialize().  initialize() is exactly what
I wanted.

Thanks,
Sheldon.

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Re: How to create pop ups in struts

Posted by Raphaël di Cicco <ra...@atosorigin.com>.
This has nothing to do with struts but with javascript you have to use
window.open

----- Original Message ----- 
From: "Kamal Gupta" <kg...@tech-group.co.uk>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>
Sent: Wednesday, January 07, 2004 7:19 PM
Subject: How to create pop ups in struts


> Hi,
>
> I am trying to create popups.
>
> I have a jsp page which displays some information. When I click on a
button
> it displays a popup which has information from database and user selects
one
> information from the popup and clicks on OK then the info will go back to
> the jsp page from where the jsp page was called.
>
> Can some one please send me some code on popup using iframes.
>
> Or is there any better way of doing this in struts
>
> Regards
>
> Kamal
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


How to create pop ups in struts

Posted by Kamal Gupta <kg...@tech-group.co.uk>.
Hi,

I am trying to create popups.

I have a jsp page which displays some information. When I click on a button
it displays a popup which has information from database and user selects one
information from the popup and clicks on OK then the info will go back to
the jsp page from where the jsp page was called.

Can some one please send me some code on popup using iframes.

Or is there any better way of doing this in struts

Regards

Kamal


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Re: How to reset properties of a DynaValidatorForm

Posted by Sheldon Hearn <sh...@starjuice.net>.
On (2004/01/07 19:03), Matthias Wessendorf wrote:

> but you can
> set the properties to its default,
> is this what you want?
> 
> DynaValidatorForm myForm = (DynaValidatorForm) form;
> 		
> myForm.initialize(actionMapping);

Duh, that's it.  reset() != initialize().  initialize() is exactly what
I wanted.

Thanks,
Sheldon.

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


RE: How to reset properties of a DynaValidatorForm

Posted by Matthias Wessendorf <ma...@matthias-wessendorf.de>.
Hi,

a DynaValidatorForm has not
an own reset().
the reset() of DynaActionForm is called
but she doesn´t do anything:

public void reset(ActionMapping mapping, HttpServletRequest request) {
  ;       // Default implementation does nothing
}

but you can
set the properties to its default,
is this what you want?

DynaValidatorForm myForm = (DynaValidatorForm) form;
		
myForm.initialize(actionMapping);

the properties haven´t an
initial are null
e.g. for Integer.

but for String the length().method returns 0.

hope i understand you right...

greetings



-----Original Message-----
From: Sheldon Hearn [mailto:sheldonh@starjuice.net] 
Sent: Wednesday, January 07, 2004 6:59 PM
To: struts-user@jakarta.apache.org
Subject: How to reset properties of a DynaValidatorForm


Hi folks,

How are you supposed to reset properties of a DynaValidatorForm?

The source suggests that DynaValidatorForm.reset() doesn't actually
reset values to their defaults, and calling the method certainly doesn't
do what I expected.

I need to be able to do this from inside an action, so I can clear the
values on success.  This is necessary when success forwards to the page
with the form on it, where you don't want the value that was just
provided to appear in the form again, because it's been dealt with.

Ciao,
Sheldon.

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org