Announcement

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

    How to build "Databound Depended Selects" sample in Visual Builder

    Hi,

    We are using SmartGWT Power 2.5, and need to build the code similar to the sample above using solely Visual Builder. Main challenge so far is absent of "getPickListFilterCriteria" action in SelectItem component. We try to replace it with Combobox which has such action. It generally works but we need ability to select empty value. That feature presents only in SelectItem.
    I checked the latest build but that action is not added to SelectItem as well. Is it possible to add that action into night build (we would not mind to upgrade) or provide instruction how to add it ourselves?

    Code:
    <DynamicForm ID="DynamicForm0" autoDraw="false">
        <dataSource>myDataSource</dataSource>
        <autoFetchData>true</autoFetchData>
        <fields>
            <FormItem name="PARAM.REQUESTGROUP.ID" constructor="ComboBoxItem" >
              <displayField>XXX</displayField>
                <changed><![CDATA[
    form.clearValue('PARAM.VENDORTYPE.ID');
    ]]></changed>
            </FormItem>
            <FormItem name="PARAM.VENDORTYPE.ID" constructor="ComboBoxItem" >
              <displayField>YYYY</displayField>
              <getPickListFilterCriteria><![CDATA[
    var requestGroup = this.form.getValue('PARAM.REQUESTGROUP.ID');
    return {RequestGroup:requestGroup};
    ]]></getPickListFilterCriteria>
            </FormItem>
        </fields>
        <width>100%</width>
        <height>100%</height>
        <autoFetchData>true</autoFetchData>
    </DynamicForm>
    Thanks,
    Maksym

    #2
    Visual Builder isn't intended as an IDE (see FAQ).

    If you'd like to extend it's capabilities so that this specific scenario is made possible, consider Feature Sponsorship, but note that new features are only added to the latest version; released version such as 2.5 receive only fixes (see also smartclient.com/builds).

    Comment


      #3
      I understand the concept, but here is another problem. How would I override a protected method of the Component in SmartGWT like "SelectItem.getPickListFilterCriteria"? The sample in the FAQ just cover regular staff like event injections:

      Code:
      ListGrid grid = (ListGrid)Canvas.getByID("mainGrid");
          final DynamicForm form = (DynamicForm)Canvas.getByID("editForm");
          grid.addRecordClickHandler(new RecordClickHandler() {
              public void onRecordClick(RecordClickEvent event) {
                  form.editRecord(event.getRecord());  
              }
          });

      Comment


        #4
        See the docs for that method, it also supports adding an implementation in a more event-like style that works with screens loaded from XML.

        Comment

        Working...
        X