动态创建OATipBean

本文介绍了如何通过编程方式动态创建OATipBean,并设置其提示内容。具体步骤包括:在应用程序消息字典中创建消息;实例化OATipBean并使用OAStaticStyledTextBean来存放提示文本;从应用程序消息字典获取翻译后的文本值并设置为提示内容。

动态创建OATipBean。

动态创建的OATipBean无法直接设置提示内容,需要添加一个静态文本。

参考User Guide示例如下。

If you need to create a tip programmatically, follow these steps:

Step 1: Create a message in the Applications Message Dictionary.

Step 2: Instantiate the tip as shown below. Then, instantiate an oracle.apps.fnd.framework.webui.beans.OAStaticStyledTextBean to hold your tip text and add it as an indexed child of the tip. Note that UIX automatically sets the CSS style to OraTipText on your behalf.

import oracle.apps.fnd.framework.webui.OAWebBeanConstants; import oracle.apps.fnd.framework.webui.beans.OAStaticStyledTextBean;import oracle.apps.fnd.framework.webui.beans.OATipBean;   
... 
public void processRequest(OAPageContext pageContext, OAWebBean webBean)
{
 // Always call this first.
 super.processRequest(pageContext, webBean);

 // Instantiate the tip bean using the factory mechanism (do not use "new").
 OATipBean tip = (OATipBean)createWebBean(pageContext, 
                                          OAWebBeanConstants.TIP_BEAN, 
                                          null,"aName");

 // Instantiate the text portion of the tip.
 OAStaticStyledTextBean tipText = (OAStaticStyledTextBean)createWebBean(pageContext, OAWebBeanConstants.STATIC_STYLED_TEXT_BEAN, null,"anotherName"); // Obtain the translated text value from the Applications Message Dictionary // and set it as the text value in the static styled text bean. String tipTextValue = pageContext.getMessage("AK", "FWK_TBX_T_TIP_BEAN", null); tipText.setText(tipTextValue); // Add the tip text to the tip bean.  tip.addIndexedChildren(tipText); }

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值