Piyush,
I don't know why the messages don't display at all. I agree with you
that they should.
Beyond that, I don't agree with anything else. I think the rendering of
the messages component on a portable device needs some special attention
that cannot be "solved" in the base renderer. As for not rendering
component level messages, there is an API on the messages tag called
"globalOnly". Disregarding this attribute and NEVER displaying the
global messages is bad form. Especially since an app developer can
adjust this for themselves using an EL expression and some logic to
detect formfactor.
A better implementation might be to display global messages and then (if
globalOnly is false) put the component level messages in some sort of
disclosure or provide a nav icon or something with a way to return back
to the original page..
Scott
piyush hari wrote:
Hello,
I have two questions regarding PDA renderers for "messages" component.
*1) Can we make one common renderer for PDA and Desktop for a
"messages" component ?*
Desktop and PDAs have different renderers for a "messages" component.
They are both located in
org->apache->myfaces>trinidadinternal->ui->laf->base->pda/desktop->MessageboxRenderer.java
With current trinidad code, on a desktop, the demo-app renders a
message box that displays messageType (like Error) and the message
(Label : Conversion Error) in the following format: (see
desktop_messages.JPG)
On Pocket PCs (PIE and IE mobile) PDA message box is not rendered and
it displays nothing.
I did not understand why in the first place we need a different
renderer for PDAs ? So, I tried something different. I copied the
contents of DESKTOP MessageBoxRenderer.java into the PDA
MessageBoxRenderer.java of a PDA. And it worked !!! PDA displays
errors in the desired format. Everything appears same
as desktop except the skin and the absence of Error Icon (X) on left
of Label which I think are skinning issues. (see pda_messages.JSPX)
*2) Since, limited screen size is a handicap on a PDA device, it does
not make sense to show messages that are specific to a component (in
this case an inputText) within "tr:messages" component (Label :
Conversion Error) as well as below the component they belong to. (ex:
Specified value is not a val....).*
*In that case, shall I alter the PDA renderer from 1) to exclude any
messages being added to the "messages" component if they are specific
to a component?
*
**
Sincerely,
Piyush Hari