Announcement

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

    Using combo box to choose value for foreign key

    I have a DynamicForm based on a data source and I'm using this code to override a foreignKey field to display as a comboBox. It displays the dropdown and correctly shows the DisplayField based on the current value in the ValueField. The problem is that that is the only entry in the dropdown. How do I get it to show all available values from the data source so I can choose another?

    Code:
    FormItem cat = itemForm.getField("CategoryID");
    cat.setType("comboBox");
    cat.setOptionDataSource(ipMerchHierarchyDS);
    cat.setValueField("ID");
    cat.setDisplayField("Name");
    itemForm.setFields(submit, cat);
    A side note: I had to change the ISC_Forms.js to get the picker icon to show up. It was looking for a pickerIcon.gif file which did not exist in the Enterprise Skin. I changed it to use ComboBoxItem_PickButton_icon.gif instead.

    #2
    The ComboBox is showing whatever the DataSource returns. Take a look at the RPC tab to see the request being sent and the response.

    Comment


      #3
      I can see that it is requesting the one record ID that is showing in the drop down, but why? The same data source is used to fill a tree on the page and I am not doing anything to set criteria on the data source. I've also tried setOptionCriteria to try to manually clear the criteria that is being set by the framework.

      Comment

      Working...
      X