بتاريخ: 3 أغسطس 20169 سنة comment_276855 السلام عليكم its possible to add in appmodule method that return Row set or any row collection and call this method in managed bean public RowSet getPrRows(int id) { RowSet rows; BigDecimal price=new BigDecimal(0); ViewObject vo = getPrView1(); ViewCriteria vc = vo.createViewCriteria(); ViewCriteriaRow vcr1 = vc.createViewCriteriaRow(); vcr1.setAttribute("Itid",id); vc.add(vcr1); vo.applyViewCriteria(vc); vo.executeQuery(); rows=(RowSet)vo; return rows; } تقديم بلاغ
بتاريخ: 3 أغسطس 20169 سنة كاتب الموضوع comment_276859 نعم ممكن شكرا مهندس مصطفي يعني الطريقة المكتوب بيها الميثود صحيحة ولو صحيحة كيف انادي عليها في managed bean وكيف iterate في النتيجة شاكر لحضرتك تقديم بلاغ
بتاريخ: 3 أغسطس 20169 سنة comment_276861 لا توجد مشكلة فيها لكن ما الذي تريد عمله بالضبط حيث أنه الأفضل استخدام iterator داخل bean تقديم بلاغ
بتاريخ: 3 أغسطس 20169 سنة كاتب الموضوع comment_276862 مثلا عائذ املا tabular في الصفحة من النتيجة ,ال tabular بيزد علي viewbpject مختلف بحيث اساعد المستخدم بادخال عدد من الصفوف تم ادخاله مسبقا في جدول اخر واسترجاعها في tabular للحذف او التعديل زي ما بتعمل عند ما اكون عائذ احول sales order لفاتورة نهائية تقديم بلاغ
بتاريخ: 3 أغسطس 20169 سنة comment_276864 يمكن تنفيذها داخل bean من خلال iterator ولا توجد أي حاجة لاستخدام appModule تقديم بلاغ
بتاريخ: 4 أغسطس 20169 سنة كاتب الموضوع comment_276884 اشكرك اخي مصطفي المشكلة عند ما احاول تنفيذها داخل bean توجد مشكلة عند انه لا يتعرف علي ال View object getPrView1 تقديم بلاغ
بتاريخ: 4 أغسطس 20169 سنة كاتب الموضوع comment_276886 اشكرك اخي مصطفي المشكلة عند ما احاول تنفيذها داخل bean توجد مشكلة عند انه لا يتعرف علي ال View object getPrView1 الا بعمل Object من AppModuleImpl تقديم بلاغ
بتاريخ: 7 أغسطس 20169 سنة كاتب الموضوع comment_276940 شكرا مهندس مصطفي علي هذا التوضيح الكود ادناها يقوم بجلب بيانات من جدول لحفظها في جدول اخر عن طريق ADF Tabular والان شغال بطريقة صحيحة السؤال هل هذا الكود من ناحية performance or best practice جيد ام لا public String LoadData(ValueChangeEvent ev) { // Add event code here... BigDecimal qty=new BigDecimal(2); BigDecimal id= new BigDecimal(0); BigDecimal prc=new BigDecimal(0); BigDecimal vat=new BigDecimal(0); BigDecimal perc=new BigDecimal(0.1); Integer pr=0; //FacesContext fctx = FacesContext.getCurrentInstance(); String amDef = "model.AppModule"; String config = "AppModuleLocal"; ApplicationModule am = Configuration.createRootApplicationModule(amDef,config); AppModuleImpl service = (AppModuleImpl)am; RowSet rows; BigDecimal price=new BigDecimal(0); ViewObject vo =service.getPrView1(); ViewCriteria vc = vo.createViewCriteria(); ViewCriteriaRow vcr1 = vc.createViewCriteriaRow(); pr=(Integer)ev.getNewValue(); vcr1.setAttribute("Reqno",pr); vc.add(vcr1); vo.applyViewCriteria(vc); vo.executeQuery(); ClearTable(); // delete existing records while (vo.hasNext()) { Row r=vo.next(); qty= (BigDecimal)r.getAttribute("Qty"); id= (BigDecimal)r.getAttribute("Itid"); prc= (BigDecimal)r.getAttribute("Price"); vat=(qty.multiply(prc)).multiply(perc); String x=cb1_action(); // to add new record this method called createInsert to add new record DCBindingContainer dcBindings = (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry(); DCIteratorBinding customIter = dcBindings.findIteratorBinding("InvDetView1Iterator"); RowSetIterator customRSIter = customIter.getRowSetIterator(); //Populating the data to newly created row Row currentRow = customRSIter.getCurrentRow(); currentRow.setAttribute("Itid",id); currentRow.setAttribute("Qty", qty); currentRow.setAttribute("Price", prc); currentRow.setAttribute("Vat",Math.round(vat.doubleValue())); currentRow.setAttribute("TotPrice", prc.multiply(qty)); currentRow.setAttribute("Reqno", pr); } return null; } تقديم بلاغ
بتاريخ: 7 أغسطس 20169 سنة comment_276944 لو عدد السجلات كبير فاستخدام sql أسرع كثيراً لكن لو عدد السجلات التي يتم إدخالها في حدود 100 على الأكثر فلن يظهر فرق كبير تقديم بلاغ
بتاريخ: 7 أغسطس 20169 سنة comment_276945 لكن بشكل عام طريقة استدعاء AppModule خاطئة سيكون هناك فيديو قريب في مشروع ADF على قناتنا لتوضيح الطريقة الصحيحة تقديم بلاغ
بتاريخ: 8 أغسطس 20169 سنة كاتب الموضوع comment_276973 جزاك الله خيرا اخ مصطفي في الانتظار ان شاء الله تقديم بلاغ
بتاريخ: 8 أغسطس 20169 سنة كاتب الموضوع comment_276992 لو عدد السجلات كبير فاستخدام sql أسرع كثيراً لكن لو عدد السجلات التي يتم إدخالها في حدود 100 على الأكثر فلن يظهر فرق كبير هل تعني ب sql عبارة select from A insert into B يعني يتم حفظ البيانات بشكل دائم لكن الغرض من المثال هو ان يتم جلب هذه البيانات في الصفحة لغرض التعديل والتعديل والحذف وان يقوم بحفظ البيانات او الالغاء تقديم بلاغ
انضم إلى المناقشة
يمكنك المشاركة الآن والتسجيل لاحقاً. إذا كان لديك حساب, سجل دخولك الآن لتقوم بالمشاركة من خلال حسابك.