You store the confirm/alert/error msg in user's session, but I store
them in my request tool, (see the following snippet), what I don't
understand is why the message not reset for a request tool (for reqest
tool, they should be refreshed upon each request, am I correct?)

In my request pull tool class, I have:
<snippet>
        private Object confirmMessage;
        private Object infoMessage;
        private Object alertMessage;

        public void refresh() {
                confirmMessage = null;
                infoMessage = null;
                alertMessage = null;
        }

        public Object getConfirmMessage() {
                return confirmMessage;
        }

        public void setConfirmMessage(Object v) {
                this.confirmMessage = v;
        }
        ...
</snippet>

Thanks!

richard


On Fri, 2004-05-21 at 16:17, Louis Moore wrote:
> I can't tell from your snippet where the message is
> actually being stored but if it's in the temp session
> data then you have to reset it to empty after showing
> the message. Here's a snippet from my Message.vm
> template:
> 
> #if(!$data.User.getTemp($nocwebG.Constant.ERROR_MESSAGE,"").equals(""))
>  <div
> class="errormessage"><p>$nocwebR.addBreaks($!data.User.getTemp($nocwebG.Constant.ERROR_MESSAGE))</div>
> 
> $data.User.setTemp($nocwebG.Constant.ERROR_MESSAGE,"")
> #end
> 
> hope it helps,
> Lou
> 
> --- Richard Han <[EMAIL PROTECTED]> wrote:
> > I tried another way to set confirm/alert/error
> > messages
> >     - in my layout/default.vm, I have a macro
> > #actionMessage()
> >             <td align="left" valign="top">
> >             #actionMessage()
> >             $screen_placeholder
> >             </td>
> >     - The macro #actionMessage() uses a request pull
> > tool to check
> > confirm/alert/error message set within action
> > #macro (actionMessage) 
> >     #if($myReqTool.ConfirmMessage)
> >             <p
> >
> class="confirmmsg"><strong>$myReqTool.ConfirmMessage</strong></p>
> >  
> >     #end
> >  
> >     #if($myReqTool.AlertMessage)
> >              <p
> > class="alertmsg"><strong>$myReqTool</strong></p>  
> >     #end
> > #end
> > 
> > This is basically the way how turbine-3/scarab deals
> > with
> > confirm/alert/error messasges (if I am correct),
> > 
> > But for reasons I don't know, the confirm/alert
> > message is persistent to
> > different pages and won't go away.
> > Can somebody points out what I am missing? or share
> > your way?
> > 
> > Thanks
> > 
> > richard
> > 
> > 
> >     
> > On Fri, 2004-05-21 at 11:58, Louis Moore wrote:
> > > There's probably a ton of different ways to do
> > this,
> > > but I've been setting session parameters in my
> > java
> > > classes, something like:
> > > 
> > > if (!inputOK)
> > > {
> > >  // alert
> > >  data.getUser().setTemp("warningmsg","Bad
> > input!");
> > >  return;
> > > }
> > > 
> > > try
> > > {
> > >  // success
> > > 
> > data.getUser().setTemp("successmsg","Successful");
> > > }
> > > catch
> > > {
> > >  // failure
> > >  data.getUser().setTemp("errormsg","Failed");
> > > }
> > > 
> > > Then I have a template Message.vm which checks for
> > > those parameters and prints the messages if they
> > are
> > > there, then removes the parameters. This template
> > is
> > > parsed inside my Default.vm layout so it's on
> > every
> > > page. I'd also be interested in hearing how other
> > > people are doing this.
> > > 
> > > -Lou
> > > 
> > > 
> > > --- Pradeep Kumar <[EMAIL PROTECTED]> wrote:
> > > > Hi Richard,
> > > > 
> > > > You can use javascript for this. On vm page for
> > the
> > > > click of any button
> > > > you can write a java script function which can
> > be
> > > > used to set
> > > > comfirm/alert/error message .
> > > > If you have tried some otherway let us know.
> > > > Thanks,
> > > > Pradeep
> > > > 
> > > > >>> [EMAIL PROTECTED] 5/21/2004 8:44:44 AM >>>
> > > > Hi everyone,
> > > > 
> > > > In turbine-2.3, how do you set
> > comfirm/alert/error
> > > > message ?
> > > > 
> > > > Thank you in advance!
> > > > 
> > > > richard
> > > > 
> > > > 
> > > >
> > >
> >
> ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail:
> > > > [EMAIL PROTECTED] 
> > > > For additional commands, e-mail:
> > > > [EMAIL PROTECTED] 
> > > > 
> > > > 
> > > >
> > >
> >
> ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail:
> > > > [EMAIL PROTECTED]
> > > > For additional commands, e-mail:
> > > > [EMAIL PROTECTED]
> > > > 
> > > 
> > > 
> > > 
> > >   
> > >           
> > > __________________________________
> > > Do you Yahoo!?
> > > Yahoo! Domains  Claim yours for only $14.70/year
> > > http://smallbusiness.promotions.yahoo.com/offer
> > > 
> > >
> >
> ---------------------------------------------------------------------
> > > To unsubscribe, e-mail:
> > [EMAIL PROTECTED]
> > > For additional commands, e-mail:
> > [EMAIL PROTECTED]
> > > 
> > 
> > 
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> > [EMAIL PROTECTED]
> > For additional commands, e-mail:
> > [EMAIL PROTECTED]
> > 
> 
> 
> 
>       
>               
> __________________________________
> Do you Yahoo!?
> Yahoo! Domains  Claim yours for only $14.70/year
> http://smallbusiness.promotions.yahoo.com/offer
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


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

Reply via email to