Page 1 of 1

Problems with checkboxes with readOnly set to true

PostPosted: Tue Jul 27, 2010 10:56 pm
by paulc
Hi, I am having an issue with the checkboxes on my forms, we are currently moving from 4.1.7 to 5.1.4. We did not experience this problem in 4.1.7. On load/show the checkboxes readOnly properties are set to true. When the user clicks a button to enable "edit" I have to set all fields on my form to readOnly = false. The following code works for all other elements on my form, but the checkboxes are never able to set the readOnly = false unless I set the field properties through a qualifid name.

Has anyone experienced this? Is there a better way to do this?

what I do is:

Code: Select all
for(i in elements.allnames)
  {
    var elementName = elements.allnames[i];
   
    var args = elementName.split('_');
    if(args[0] == 'fld')
    {
      elements[elementName].readOnly = !lv_find_mode;
      elements[elementName].enabled  = lv_find_mode;
      if (elements[elementName].getElementType() != 'CHECK')
        elements[elementName].editable = lv_find_mode;
    }
  } 

//added to fix checkbox readonly issue
  elements.fld_fv_active_ind.readOnly = !lv_find_mode;
  elements.fld_fv_current_seis_status.readOnly = !lv_find_mode;
  elements.fld_fv_dimension.readOnly = !lv_find_mode;
  elements.fld_fv_dirty.readOnly = !lv_find_mode;
  elements.fld_fv_k_original_owner.readOnly = !lv_find_mode;
  elements.fld_fv_k_ownership_class.readOnly = !lv_find_mode;



Thanks

Re: Problems with checkboxes with readOnly set to true

PostPosted: Tue Jul 27, 2010 11:12 pm
by ptalbot
What we tend to do is put all the fields we want to enable/disable etc. in a form, then put this form in a tabPanel.

Now when we want to change the state of all this field, we simply set the tabPanel enabled or readOnly to the state we want.
You can also set the form's controller enabled or readOnly property.

We found it a lot shorter than iterating through all the fields, just put all the buttons that are supposed to toggle the state of the tabPanel/form, out of it in the parent form.

Re: Problems with checkboxes with readOnly set to true

PostPosted: Wed Jul 28, 2010 10:38 am
by jcompagner
what happens if you do this:

Code: Select all
      elements[elementName].readOnly = !lv_find_mode;
      if (elements[elementName].getElementType() != 'CHECK')
      {
        elements[elementName].enabled  = lv_find_mode;
        elements[elementName].editable = lv_find_mode;
      }


setting readOnly is the same as enabled for a checkbox...