Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    change functioin call different in IE vs FF&Chrome

    In our product, our "disabled" fields do not actually use the disabled property of a form item. Instead, we make it look like it is not editable but the user is still able to highlight the value and copy it - which a normal disabled form item does not allow. My problem now is when the user selects the text in the form and right clicks on it, the delete context menu actually deletes the value. I do not want this at all obviously. So tried using change() to cancel any changes that may occur for this field BUT it only works in FF and Chrome. In IE, the change is not triggered until I click outside of the field.


    Code:
    isc.DynamicForm.create({
    width: 300,
    fields: [
    {name: "fullName",
    type: "text",
    title: "Full Name",
    defaultValue: "Billy Bob",
    change: function(){form.getField('proceed').setDisabled(false)";return false;}
    },
    {name: "proceed",
    type: "button",
    title: "Proceed",
    click: "isc.say('OK')",
    disabled: true
    }
    ]
    });

    #2
    If you want an item with selectable, but non editable text, how about a StaticTextItem rather than a TextItem?
    You can change the textBoxStyle to make it look like a disabled textItem if required.

    Comment


      #3
      Our fields are dynamically editable/noneditable so we cannot just switch to a static text item.

      Comment


        #4
        You could handle this a couple of ways:
        - a call to 'setItems()' could change the items displayed in the form so the field in question shows a textItem or a staticText item depending on desired editability.
        - you could have a static text item and a text item in the form and show() / hide() them as appropriate to change the editability of the item at runtime.

        Note that in the 8.2 branch we handle this functionality in the framework with a 'setCanEdit' method on form items.
        Unfortunately this isn't one we can easily port to the 8.1 branch.

        Comment


          #5
          I've thought about this before but what happens to the textbox style if I change it to a static text item?

          Comment


            #6
            If you set the "textBoxStyle" attribute you can style the static text item however you want (including giving it a border and background color to match a normal, editable text-item)

            Comment


              #7
              Is there a tentative date set on 8.2 release?

              Comment


                #8
                We can't officially commit to a date but we're in final preparation and testing stages so we're looking at a release very soon.

                Comment


                  #9
                  Now that this is available in 8.2, is there any way for "canEdit" to be a state of the textfield? Kind of like when the text field is disabled, the basestyle would be appended with Disabled

                  Comment


                    #10
                    It basically does work like that. If an item is canEdit:false and showDisabled:true is set, styles get "Disabled" as a suffix.

                    Comment


                      #11
                      Sorry, I do not see this happening in the 12-16-2011 build.

                      When I run the following testcase and use firebug to inspect, all its doing is changing the textfield to a staticTextItem. I do not see the "Disabled" suffix anywhere

                      Code:
                      
                      isc.DynamicForm.create({
                          ID: "exampleForm",
                          width: 250,
                          fields: [
                              {name: "username",
                               title: "Username",
                               type: "text",canEdit:false,showDisabled:true,
                               required: true,
                               defaultValue: "bob"
                              }
                          ]
                      });

                      Comment


                        #12
                        Also, canEdit does not seem to be working for AutoFit/textarea

                        Code:
                        isc.DynamicForm.create({
                            width: 300,
                            fields: [
                                {title:"Description",_constructor:"TextItem",defaultValue:"ajdlajdlajdlajdlkadlajdlajflajflajflajflajfla",canEdit:false} 
                            ]
                        });

                        Comment


                          #13
                          Ah - sorry for the confusion. The default FormItem generated for a field of type text marked as canEdit false is a StaticTextItem. The "type" is the data type.
                          If you want an actually canEdit:false text item use editorType:"TextItem" instead of, or as well as type:"text".

                          The issue with canEdit:false failing to disallow editing of a TextAreaItem is a framework bug which we are fixing in the stable 3.0 branch now (So the fix should be in the next nightly build).

                          Regards
                          Isomorphic Software

                          Comment


                            #14
                            Ok Thanks. BTW, which link should I be downloading the nightly builds from? I've been checking 8.2 but there has not been a build since the 16th

                            8.1
                            8.1.x
                            8.1p
                            8.2
                            8.2.x
                            8.2p
                            8.3d
                            8.x

                            Comment


                              #15
                              We've reworked our build numbering scheme to be clearer. The links are still in transition - sorry for any confusion.

                              Basically a "p" suffix implies a "patch" branch.
                              This is a branch where the only changes from the public release are bug-fixes to minimize instability.

                              A "d" suffix implies an active development branch with new feature work in progress.

                              So you'll probably want to get the build from 8.2p

                              Comment

                              Working...
                              X