DCP

Thursday 2 March 2017

Adding a tip on OAF page Programatically

         OAWebBean ntfDetailsFn = webBean.findChildRecursive("NtfDetailsFn");
                                 if (ntfDetailsFn != null) {
                                     OATipBean tip =
                                         (OATipBean)createWebBean(pageContext, OAWebBeanConstants.TIP_BEAN, null, "aName");
                                     OAStaticStyledTextBean tipText =
                                         (OAStaticStyledTextBean)createWebBean(pageContext, OAWebBeanConstants.STATIC_STYLED_TEXT_BEAN,
                                                                               null, "anotherName");
                                     tipText.setText("For Invoice Details please click on the link 'View Additional Invoice Details'");

                                     CSSStyle customStyle = new CSSStyle();
                                     customStyle.setProperty("color", "#FF0000");
                                     customStyle.setProperty("font-weight", "bold");
                                     customStyle.setProperty("font-size", "10pt");

                                     tipText.setInlineStyle(customStyle);

                                     // Add the tip text to the tip bean.
                                     tip.addIndexedChild(tipText);
                                     ntfDetailsFn.addIndexedChild(tip);
                                 }