بتاريخ: 13 يناير 201313 سنة comment_231079 بعض الاكواد التى نحتاجهاhow to set a background image to a componentلو عاوز تعمل صورة كخلفية ل pannelgroub layout مثلا و الصورة اللى انت عاوز تعملها خلفية اسمها مثلا globe.png و موجودة فى الفولدر images . بس ضيف التالي فى ال inline style او فى ال background image property الموجودة داخل style background-image:url(#{facesContext.externalContext.requestContextPath}/images/globe.png); Getting the binding container BindingContainer bindings = BindingContext.getCurrent().getCurrentBindingsEntry(); Getting ADF attribute value from an ADF page definition [indent]AttributeBinding attr = (AttributeBinding)bindings.getControlBinding("test"); attr.setInputValue("test");[/indent] [font=Arial, Tahoma, Helvetica, FreeSans, sans-serif][size=3] [/size][/font] Executing a MethodAction [indent]OperationBinding method = bindings.getOperationBinding("methodAction1"); method.execute(); List errors = method.getErrors(); method = bindings.getOperationBinding("methodAction2"); Map paramsMap = method.getParamsMap(); paramsMap.put("param","value") ; method.execute(); [/indent] [font=Arial, Tahoma, Helvetica, FreeSans, sans-serif][size=3] [/size][/font] Getting the errors of an iterator String error = iterBind.getError().getMessage(); Refresh an iterator bindings.refreshControl(); iterBind.executeQuery(); iterBind.refresh(DCIteratorBinding.RANGESIZE_UNLIMITED); All the rows of an iterator [indent]Row[] rows = iterBind.getAllRowsInRange(); TestData dataRow = null; for (Row row : rows) { dataRow = (TestData)((DCDataRow)row).getDataProvider(); }[/indent] [font=Arial, Tahoma, Helvetica, FreeSans, sans-serif][size=3] [/size][/font] Adding Action and Action Listener to a command component [indent]RichCommandMenuItem menuPage1 = new RichCommandMenuItem(); menuPage1.setId("page1"); menuPage1.setText("Page 1"); menuPage1.setActionExpression(getMethodExpression("page1")); RichCommandButton button = new RichCommandButton(); button.setValueExpression("disabled",getValueExpression("#{!bindings."+item+".enabled}")); button.setId(item); button.setText(item); MethodExpression me = getMethodExpression("#{bindings."+item+".execute}"); button.addActionListener(new MethodExpressionActionListener(me)); footer.getChildren().add(button);[/indent] Adding Groovy expression to a component's attribute [indent]RichInputText input = new RichInputText(); input.setValueExpression("value",getValueExpression("#{bindings."+item+".inputValue}")); input.setValueExpression("label",getValueExpression("#{bindings."+item+".hints.label}")); input.setId(item); panelForm.getChildren().add(input);[/indent] Redirect to an other url [indent]ExternalContext ectx = FacesContext.getCurrentInstance().getExternalContext(); HttpServletResponse response = (HttpServletResponse)ectx.getResponse(); String url = ectx.getRequestContextPath()+"/adfAuthentication?logout=true&end_url=/faces/start.jspx"; try { response.sendRedirect(url); } catch (Exception ex) { ex.printStackTrace(); }[/indent] Getting an application module [indent]private OEServiceImpl getAm(){ FacesContext fc = FacesContext.getCurrentInstance(); Application app = fc.getApplication(); ExpressionFactory elFactory = app.getExpressionFactory(); ELContext elContext = fc.getELContext(); ValueExpression valueExp = elFactory.createValueExpression(elContext, "#{data.OEServiceDataControl.dataProvider}", Object.class); return (OEServiceImpl)valueExp.getValue(elContext); } [/indent] Change the locale [indent]Locale newLocale = new Locale(this.language); FacesContext context = FacesContext.getCurrentInstance(); context.getViewRoot().setLocale(newLocale);[/indent] تقديم بلاغ
بتاريخ: 13 يناير 201313 سنة comment_231085 Thanks ...Good Tipsand you can add this http://biemond.blogspot.com/2009/03/some-handy-code-for-backing-beans-adf.html تقديم بلاغ
انضم إلى المناقشة
يمكنك المشاركة الآن والتسجيل لاحقاً. إذا كان لديك حساب, سجل دخولك الآن لتقوم بالمشاركة من خلال حسابك.