I used to show error messages on the top of my BSP-page by using the messages object. With <i>messages->add_message()</i>, I added the error messages and with <i>message->get_message()</i> I read and displayed them.
Now, I would like to show the messages on a popup-window that shows another BSP-page. Can I access the first page's messages object on the popup-page or is using a global messages object in the application class the only way?
The right way is to use global messages object in the application class & statefull BSP.
Other way is to transfer message table from page to page via navigation->set_parameter
Daniel,
I think it should be possible to use JavaScript to read the error message from another page.
If, for example, the two pages are in the same frameset,
and if the first frame contains the message element with
id="MY_MESSAGE_ID", then something like the following could do the job:
<script>
<!--
document.write(parent.frames[0].document.getElementById("MY_MESSAGE_ID-txt").firstChild.nodeValue;
-->
</script>
In a popup window this will be more difficult. I know that there is something like self.creator.xxx.xxx etc., but I am not really sure if this works.
But it's worth a try.
Hope that helps.
Best regards,
Juergen
Add a comment