felix.bec...@t-systems.com schrieb:
>
> Hi,
>
> I’ve got a JSF page divided in 2 parts – the status message area and
> the content area. The content area is positioned under the status
> message area. In the status area all messages for the user should be
> shown – for example success messages, error messages and exceptions.
> In my content area I’ve got a <tr:dataTable
> value=”#{myBean.values}”..>. When the method getValues() of myBean
> throws an exception, I’m catching this exception. I want to display
> this exception in the status message area – but this does not work –
> apparently because the status area is already rendered when the
> content el-methods are called. Is there any solution for this problem?
> Is it possible to render the status area at last?
>

I can't think of an easy solution for this.

Output generated during rendering is (at least theoretically) sent over
the network to the remote browser as it is created. So as you point out,
your "status area" has already been written before you encounter the
exception. There is no TCP feature to "unsend data".

One obvious option would be to move your status area to the bottom of
the page.

Or you could write out the status area at the bottom of the page, then
use CSS positioning rules to make it *appear* at the top of the page. Or
use javascript to move the generated messages block from the bottom of
the page to the top.

Note that JSF messages created during:
* conversion
* validation
* action-handling
are no problem. It is only exceptions during rendering that would be an
issue. I can't think why you would be getting errors during fetching of
rendered data; I've not had to deal with that before except when wanting
to display some kind of "result set too large" message. Maybe you can
move the fetching of this data up into the action method of your bean?

Regards,
Simon

-- 
-- Emails in "mixed" posting style will be ignored
-- (http://en.wikipedia.org/wiki/Posting_style)

Reply via email to