I've run into this problem before as well.  Is there a better way to support this?

On 12/17/05, Johan Compagner < [EMAIL PROTECTED]> wrote:
Yes i see it now the IFeedBack instances do get a call first that will initialize them before youre onBeginRequest is called
But now i have thought about it more. That is also a wrong place. Because you are already in the response phase there. And you shouldn't
alter things in the response phase.

I currently see only one solution. Give a page or the FeedbackMessage instance to youre panels constructor.
(or set it at one point as a threadlocal or something)

johan



On 12/17/05, Ingram Chen < [EMAIL PROTECTED]> wrote:
The call sequence is:

   onGetObject();
   onGetObject();
   onGetObject();
    ... several times...
   onBeginRequest() where settting error message
   onGetObject();
   onGetObject();
    ... several times...

Since onGetObject() only check null for messages:
   if (messages == null)
   {
       //get fillter messages from page
   }
   return messages;

so, only the first invocation of onGetObject() actually get messages from page.





On 12/17/05, Johan Compagner < [EMAIL PROTECTED]> wrote:
onBeginRequest should work i think
Can you set 2 breakpoints? One in that onBeginRequest where you set the error message
and one in FeedBackMessageModel and then the public Object onGetObject(final Component component) method

johan



On 12/16/05, Ingram Chen < [EMAIL PROTECTED]> wrote:
Dear all,

    We have several Panels  need to add error message while constructing:

public MyPanel(MyData data) {
    //some process.....
    error(errorMessage);
}

However, panel can't find parent Page yet. I also tried adding error message
in onBeginRequest(), but it didn't work.

Is there any way to add feedback message ?

Thanks in advance
--
Ingram Chen
Java [EMAIL PROTECTED]
Institue of BioMedical Sciences Academia Sinica Taiwan
blog: http://www.javaworld.com.tw/roller/page/ingramchen




--
Ingram Chen
Java [EMAIL PROTECTED]
Institue of BioMedical Sciences Academia Sinica Taiwan
blog: http://www.javaworld.com.tw/roller/page/ingramchen


Reply via email to