Announcement

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

    DynamicForm with ComboBoxItem and new + edit functionality

    Hi
    I am using v8.3p_2013-01-20/EVAL Deployment 2013-01-20

    I'm trying to develop a DynamicForm which uses ComboBoxItems. The idea is that the ComboBoxItem acts as a filter come picklist. When the user types a few chars s/he gets a dropdown of matching values, once s/he selects a value, the form gets populated and can be edited. I'm unable to get this working. Please see attached html. How can I get this to work?

    Also when the user clicks the new button the form should allow a new entry. On new button click, I've managed to clear the comboboxitem and enable the Save button but when user starts to type in new data the change event fires and disallows new entry. How do I disable the changed even on click of new button?
    Attached Files

    #2
    We can't actually run this (no data and no server DataSource to provide it) so we can't see the problem.

    You either make this a runnable tests, or provide some details about what's going wrong.

    Comment


      #3
      No idea how to make a runnable test so attaching the DS and the table sql. Hope this will help in running it and help me?
      Attached Files

      Comment


        #4
        The best way to make a self-contained test case is to use clientOnly DataSource - this avoids the problem of having to set up a SQl engine to see the problem.

        But what we really need here is a clearer description of what you want to achieve and which parts of the code aren't behaving as you hoped. Code, even running, does not explain your intent or expectations.

        Comment


          #5
          Hi
          I'm trying to create a dynamicForm with three comboBoxItem's. Each comboBoxItem will act as a picklist cum data entry textbox.
          I have four buttons for the form Save, New, Clear and Delete. I want the user to be able to start typing in any of the comboBoxItem's and the entries containing typed chars should be shown in the dropdown of the comboBoxItem. When user selects an entry, the fields of the dynamicForm should be populated with corresponding data for that selected entry from the datasource. Allowing the user to edit & save or delete or clear the form.
          When the user clicks new button, the form should be cleared and save button should be enabled. And in this state ( of new button being clicked) user should be able to make a new data entry using the form and save it. i.e. when new button is clicked the comboBoxItem's should allow a new entry without trying to force the user to select data from existing entries.
          To test this, I've enabled the "changed" property on the comboBoxItem's and am calling "changed:"editForm.fetchData({companycode:this.getValue()});" This brings up a picklist of existing entries in the datasource as soon as user starts typing in the comboBoxItem. But this is not allowing the new entry functionality. As soon as user types an entry that is not in the datasource, the comboBoxItem is cleared. This is my problem. How do I make the comboBoxItem to act both as a picklist and as a new dataentry textbox.

          I've attached a single file with clientonly datasource and test data. Please help.
          Attached Files

          Comment


            #6
            This should be the default behaviour, unless you've set ComboBoxItem.addUnknownValues to false. If that's not it, please show the code for your form.
            Last edited by Isomorphic; 25 Feb 2013, 01:28.

            Comment


              #7
              I have attached the code with the last post. companyold.html please have a look.

              Comment


                #8
                Just alter the changed handler on your first comboBoxItem so it's like this:

                Code:
                changed: function (form, item, value) {
                    if (this.getSelectedRecord()) {
                        editForm.fetchData({companycode:this.getValue()});
                    }
                }

                Comment


                  #9
                  That does it.

                  Thanks :-)

                  Comment

                  Working...
                  X