Re: T5: Message component

2007-12-24 Thread Joshua Jackson
Thanks Sven,

Really helpful :)

Cheers,

On Dec 21, 2007 8:06 PM, Sven Homburg <[EMAIL PROTECTED]> wrote:
> like this ?
...
-- 
I'm a coder not a drag-n-dropper

Blog: http://joshuajava.wordpress.com/

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



Re: T5: Message component

2007-12-21 Thread Howard Lewis Ship
I think you are missing an @Parameter on field _class.

On Dec 21, 2007 5:06 AM, Sven Homburg <[EMAIL PROTECTED]> wrote:
> like this ?
>
> /**
>  *
>  * @author mailto:[EMAIL PROTECTED]">shomburg
>  * @version $Id$
>  */
> public class MessageDisplay
> {
> /**
>  * message that should displayed.
>  */
> @Parameter
> private String _infoMessage;
>
> /**
>  * message that should displayed.
>  */
> @Parameter
> private String _errorMessage;
>
> /**
>  * The CSS class for the div element rendered by the component. The
> default value is "t5c-info".
>  */
> private String _class = "t5c-info";
>
> void beginRender(MarkupWriter writer)
> {
> String displayMessage = null;
>
> if (_errorMessage != null && _errorMessage.length() > 0)
> {
> displayMessage = _errorMessage;
> _class = "t5c-error";
> }
> else if (_infoMessage != null && _infoMessage.length() > 0)
> displayMessage = _infoMessage;
>
> if (displayMessage == null)
> return;
>
> writer.element("div", "class", _class);
> writer.write(displayMessage);
> writer.end();
> }
> }
>
> best regards
> S.Homburg
>
>
>
>
> Joshua Jackson schrieb:
> > Dear all,
> >
> > Is there a message component in T5? Usually I use this in struts to
> > display message after succession upon one process. What I've found is
> > only the t:errors component.
> >
> > Thanks in advance.
> >
> >
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>



-- 
Howard M. Lewis Ship
TWD Consulting, Inc.

Creator Apache Tapestry and Apache HiveMind

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



Re: T5: Message component

2007-12-21 Thread Sven Homburg

like this ?

/**
*
* @author mailto:[EMAIL PROTECTED]">shomburg
* @version $Id$
*/
public class MessageDisplay
{
   /**
* message that should displayed.
*/
   @Parameter
   private String _infoMessage;

   /**
* message that should displayed.
*/
   @Parameter
   private String _errorMessage;

   /**
* The CSS class for the div element rendered by the component. The 
default value is "t5c-info".

*/
   private String _class = "t5c-info";

   void beginRender(MarkupWriter writer)
   {
   String displayMessage = null;

   if (_errorMessage != null && _errorMessage.length() > 0)
   {
   displayMessage = _errorMessage;
   _class = "t5c-error";
   }
   else if (_infoMessage != null && _infoMessage.length() > 0)
   displayMessage = _infoMessage;

   if (displayMessage == null)
   return;

   writer.element("div", "class", _class);
   writer.write(displayMessage);
   writer.end();
   }
}

best regards
S.Homburg




Joshua Jackson schrieb:

Dear all,

Is there a message component in T5? Usually I use this in struts to
display message after succession upon one process. What I've found is
only the t:errors component.

Thanks in advance.

  


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