الانتقال إلى المحتوى

عمل Disable لي لكل Input Item علي البيدج


khaledhere

Recommended Posts

في الواقع أنا أقول لك أنه يجب تنفيذ الكود على كل عنصر موجود في الصفحة

لا يوجد كود يقوم بتنفيذ الخاصية برمجياً لجميع العناصر

رابط هذا التعليق
شارك

  • بعد 2 أسابيع...

تستطيع إستخدام الكود التالي كتبته كود شامل لعمل disable  لكل components  موجود على الصفحة وأي كان نوعه ليس فقط input text حسب الشرط الذي لديك

    public String disableAction() {
        for (UIComponent child : getPfl1().getChildren()) 
        {       
          if (child instanceof RichInputText)
          {
           ((RichInputText)child).setDisabled(true);
          } 
            if (child instanceof RichInputText)
             {
              ((RichInputText)child).setDisabled(true); 
             }
              else if (child instanceof RichSelectBooleanCheckbox) 
               {
                ((RichSelectBooleanCheckbox)child).setDisabled(true);
               } 
                else if (child instanceof RichSelectBooleanRadio) 
                {
                 ((RichSelectBooleanRadio)child).setDisabled(true);
                }
                 else if (child instanceof RichSelectManyChoice) 
                 {
                 ((RichSelectManyChoice)child).setDisabled(true);
                 }    
        }
        return null;
    }

أنا أستخدمه ضمن مشروعي لكن عملت صفحة لغرض التجربة فقط وضعت فيها أكثر من نوع من الـ component وكتبت الكود تحت button Disable 

إن شاء الله تستفيد من الكود

أرفقت صورة للشاشة قبل وبعد الضغط على الزر

post-41781-0-66015000-1455898220_thumb.jpg

رابط هذا التعليق
شارك

تستطيع إستخدام الكود التالي كتبته كود شامل لعمل disable  لكل components  موجود على الصفحة وأي كان نوعه ليس فقط input text حسب الشرط الذي لديك

    public String disableAction() {
        for (UIComponent child : getPfl1().getChildren()) 
        {       
          if (child instanceof RichInputText)
          {
           ((RichInputText)child).setDisabled(true);
          } 
            if (child instanceof RichInputText)
             {
              ((RichInputText)child).setDisabled(true); 
             }
              else if (child instanceof RichSelectBooleanCheckbox) 
               {
                ((RichSelectBooleanCheckbox)child).setDisabled(true);
               } 
                else if (child instanceof RichSelectBooleanRadio) 
                {
                 ((RichSelectBooleanRadio)child).setDisabled(true);
                }
                 else if (child instanceof RichSelectManyChoice) 
                 {
                 ((RichSelectManyChoice)child).setDisabled(true);
                 }    
        }
        return null;
    }

أنا أستخدمه ضمن مشروعي لكن عملت صفحة لغرض التجربة فقط وضعت فيها أكثر من نوع من الـ component وكتبت الكود تحت button Disable 

إن شاء الله تستفيد من الكود

أرفقت صورة للشاشة قبل وبعد الضغط على الزر

أحسنتِ وجزاك الله خيرا بما كتبت يداكِ

رابط هذا التعليق
شارك

 

Pfl1 هو الـ layout container  الذي وضعت العناصر فيه ،، بمعنى أنا وضعت هذه العناصر داخل panel form layout  وهي الإختصار ل Pfl1  فهي الإسم البرمجي (id) لها

 

أعتقد حضرتك وضعت العناصر في panel grid layout  يعني ستكون Pgl1  أو حسب الإسم البرمجي (id) لها لديك 

 

رابط هذا التعليق
شارك

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

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

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

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   تمت استعادة المحتوى السابق الخاص بك.   مسح المحرر

×   You cannot paste images directly. Upload or insert images from URL.

جاري التحميل
×
×
  • أضف...

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

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