الانتقال إلى المحتوى
View in the app

A better way to browse. Learn more.

مجموعة مستخدمي أوراكل العربية

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Not Null Not Working In Ui Component (programmatically)

Featured Replies

بتاريخ:

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

بتاريخ:

ترتيب الشرط خطأ

يجب التأكد من null أولاً

بتاريخ:
  • كاتب الموضوع

رتبت الشرط كالآتي :

if (newValue==null ||newValue.length()==0 )  مشتغلش

وجربت if (newValue==null) فقط بردو مشتغلش

 

علما بأني مبتدأ في ال ADF والله المستعان

بتاريخ:

وكيف عرفت أنه لا يعمل؟

بتاريخ:
  • كاتب الموضوع

لا تظهر الرسالة في ال runtime بالرغم من أن القيمة null

بتاريخ:

والله في عون العبد مادام العبد في عون أخيه....

بتاريخ:

جرب طباعة newValue 

بتاريخ:

كما يمكنك تعديل الشرط كالتالي

        if (newValue==null || newValue.trim().length()==0  )

  • بعد 2 أسابيع...
بتاريخ:
  • كاتب الموضوع

جربت الكود لكن مش شغال

مفيش أي تفاعل خالص مع القيمة ال null

مش بيدخل اصلا على ال if condition + مفيش قيمة بتتطبع في حالة ال null

ممكن يكون في exception محتاج يتهندل

بتاريخ:

لو هناك exception فسيقوم بتوليد رسالة

من المؤكد أن لديك مشكلة أخرى

انضم إلى المناقشة

يمكنك المشاركة الآن والتسجيل لاحقاً. إذا كان لديك حساب, سجل دخولك الآن لتقوم بالمشاركة من خلال حسابك.

زائر
أضف رد على هذا الموضوع...

برجاء الإنتباه

بإستخدامك للموقع فأنت تتعهد بالموافقة على هذه البنود: سياسة الخصوصية

Account

Navigation

البحث

إعداد إشعارات المتصفح الفورية

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.