How to set values of a parameterized message in ADF Faces?
siberlOct 31 2006 — edited Oct 31 2006Hi all,
i've got the following problem: I want to set the values of a parameterized message before i add the message to the FacesContext.
Contents of the message resource bundle:
testPage.successMsg.create=The device {0} was created successfully!
Code within backing bean method:
String message = getStringFromBundle("testPage.successMsg.create");
FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(message));
In Struts/ADF UIX the following code did the job:
protected void setUIXInfoMessage(HttpServletRequest request, String key, Object[] args)
{
MessageData msgs = new MessageData();
MessageResources mr = this.getResources(request);
String msg = "";
if (mr != null)
msg = mr.getMessage(request.getLocale(), key, args);
msgs.addMessage(null, msg, null, UIConstants.MESSAGE_TYPE_INFO);
request.setAttribute(UIX_MESSAGE_KEY, msgs);
}
Can anyone help me with this problem? I have searched a lot in the Oracle ADF Development Guide and within forum, but did not find any solution.
Another interesting thing is, how to set the parameters from jspx-Code.
How can i achieve the same results in ADF Faces corresponding to the following UIX-Code:
<boundAttribute name="title">
<messageFormat format="${nls['deleteTip.confirmation']}">
<dataObject source="${bindings.TipName}"/>
</messageFormat>
</boundAttribute>
Resource Bundle:
deleteTip.confirmation=Do you really want to delete the tip {0}?
Another question:
What are the corresponding elements in ADF Faces corresponding to <concat> and <if> in UIX or what possibilites exist in ADF Faces to dynamically concatenate strings depending on certain conditions?
I know, these are many questions. I am familiar with UIX, but now i have to start developing applications with ADF Faces and there are some things i don't find corresponding equivalents.
Thanks in advance!
Regards,
Stefan