بتاريخ: 9 أكتوبر 20178 سنة comment_290678 Below is a validator method which belongs to an attribute in a page ,but not working with me Attribute Type=String but in case i change the if condition to be like this "if (newValue.length()>0 || newValue!=null ) " it works fine public void validatorStoreName(FacesContext facesContext, UIComponent uIComponent, Object object) { FacesContext fc = FacesContext.getCurrentInstance(); String newValue = (String)object; if (newValue.length()==0 || newValue==null ) { System.out.println("null 1_____ "+"object= "+object+" newvalue= "+newValue); FacesMessage message =new FacesMessage(FacesMessage.SEVERITY_ERROR, "Null Value not allowed",null); fc.addMessage(uIComponent.getClientId(fc), message); ((RichInputText)uIComponent).setValid(false); } else { System.out.println("object= "+object+" newvalue= "+newValue); } } Thanks in advance تقديم بلاغ
بتاريخ: 10 أكتوبر 20178 سنة كاتب الموضوع comment_290698 رتبت الشرط كالآتي : if (newValue==null ||newValue.length()==0 ) مشتغلش وجربت if (newValue==null) فقط بردو مشتغلش علما بأني مبتدأ في ال ADF والله المستعان تقديم بلاغ
بتاريخ: 10 أكتوبر 20178 سنة كاتب الموضوع comment_290728 لا تظهر الرسالة في ال runtime بالرغم من أن القيمة null تقديم بلاغ
بتاريخ: 11 أكتوبر 20178 سنة comment_290761 كما يمكنك تعديل الشرط كالتالي if (newValue==null || newValue.trim().length()==0 ) تقديم بلاغ
بتاريخ: 21 أكتوبر 20178 سنة كاتب الموضوع comment_291034 جربت الكود لكن مش شغال مفيش أي تفاعل خالص مع القيمة ال null مش بيدخل اصلا على ال if condition + مفيش قيمة بتتطبع في حالة ال null ممكن يكون في exception محتاج يتهندل تقديم بلاغ
بتاريخ: 21 أكتوبر 20178 سنة comment_291036 لو هناك exception فسيقوم بتوليد رسالة من المؤكد أن لديك مشكلة أخرى تقديم بلاغ
انضم إلى المناقشة
يمكنك المشاركة الآن والتسجيل لاحقاً. إذا كان لديك حساب, سجل دخولك الآن لتقوم بالمشاركة من خلال حسابك.