tarek_fathi بتاريخ: 1 مارس 2011 تقديم بلاغ مشاركة بتاريخ: 1 مارس 2011 I have a panel splitter layout component on my page and i want to enable/disable this splitter at run time from within a managed bean In my managed bean I made this method public void doDiscloseSplit(PhaseEvent phaseEvent){ String currViewId = phaseEvent.getFacesContext().getViewRoot().getViewId(); System.out.println("current view id="+currViewId); if (!currViewId.equals(this.getViewId())) { spliter.setDisabled(false); System.out.println("spliter is now false"); } } but this method throws a runtime exceptionjavax.el.ELException: java.lang.NullPointerException اقتباس رابط هذا التعليق شارك المزيد من خيارات المشاركة
Hala Salem بتاريخ: 1 مارس 2011 تقديم بلاغ مشاركة بتاريخ: 1 مارس 2011 عادة ال panel Splitter بيستخدم معاها collapsed وليس Disabled وهو اخفاء احد ال Panes وجعل الاخرى تمتد لتملا الصفحه باكملها ولكن بغض النظر عن collapsed او disable فاستخدام الميثود غير صحيح بالمرة لان الصح تستخدم ميثود زى isCollapsed او isDisabled او isPositionedFromEnd وكلهم بيرجعوا boolean وفى البروبرتى الخاصه بال disable او ال collapse او ال PositionedFromEnd فى ال property Inspector اعمل bind للخصائص دى على الميثود بتاعتك اللى فى ال managed Bean اقتباس رابط هذا التعليق شارك المزيد من خيارات المشاركة
sd4it بتاريخ: 2 مارس 2011 تقديم بلاغ مشاركة بتاريخ: 2 مارس 2011 Hello Tarek,it seems that you are using a phase listener.in this case make sure that you have successfully used the binding attribute of the splitter to point to your variable <spliter>.i think you forgot to do this and the null pointer is occurring because of null spliter.we normally use such technique where the splitter resides in a template اقتباس رابط هذا التعليق شارك المزيد من خيارات المشاركة
Recommended Posts
انضم إلى المناقشة
يمكنك المشاركة الآن والتسجيل لاحقاً. إذا كان لديك حساب, سجل دخولك الآن لتقوم بالمشاركة من خلال حسابك.