Announcement

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

    FilterBuilder - Operand converted to Picktree

    Hi,

    We are using below Power Edition:

    SmartClient Version: SC_SNAPSHOT-2011-10-26/PowerEdition Deployment (built 2011-10-26)

    Scenario :
    When user selects an operand in the filterbuilder, the operators are populated based in the type of an Operand selected by user. An operand is a simple dropdown in filterbuilder. So when the value of operand is changed, filterbuilder internally calls "getValueFieldProperties" where type, fieldname are input parameters. Depending on the type parameter, whether TF, SD, MD, DATE etc apropriate operators (>, <, <>, =, IN etc) are populated and corresponding value field is displayed.

    Issue :
    When we change the Operand Dropdown to IPickTreeItem, the change event "getValueFieldProperties" does get fired but with wrong input parameter values. The type parameter, & fieldname parameter received is always the type/fieldname of the first operand in the PickTree list and not the one which is currently selected by user.

    Following is the code which we have changed in FWFilterBuilder constructor wherein Operand simple dropdown is converted to PickTreeItem.

    public FWFilterBuilder(){
    final DataSource FBDataSource = DataSource.get("FSFilterBuilder");
    IPickTreeItem fieldPickerProperties = new IPickTreeItem();
    IPickTreeItem fieldPickerProperties = new IPickTreeItem();
    fieldPickerProperties.setDataSource(FBDataSource);
    fieldPickerProperties.setRedrawOnChange(true);
    this.setFieldPickerProperties(fieldPickerProperties);
    }

    The above code converts the normal operand dropdown to a picktree. Following is the change event where we expect the correct input parameters to be received based on the operand selected.

    public FormItem getValueFieldProperties(FieldType type, String fieldName, OperatorId operatorId, ValueItemType itemType, String custom)

    Can any one guide me?

    Thanks,
    Neelima

    #2
    From some quick internal testing we're not reproducing this in the latest code on the 3.0p or 3.1d branches.
    Can you try with the latest nightly.

    If the problem does persist for you, please put together a standalone test case demonstrating the issue that we can run on our end. This will allow us to see the problem in action, making it much easier to solve as well as eliminating the possibility of anything within your application being responsible for the behavior.

    Comment


      #3
      Following are the details ….

      Scenario

      When user selects an operand in the filterbuilder, filterbuilder internally calls "getValueFieldProperties" where type, fieldname are input parameters. In filterbuilder, the operand field is basically a simple combo/dropdown. When user selects/change the operand, we receive appropriate/correct parameter values in function getValueFieldProperties.

      Issue

      When we change the Operand Dropdown to IPickTreeItem, the change event does not get fired "getValueFieldProperties”.
      Code which change the default operand dropdown to picktree is as follows

      IPickTreeItem fieldPickerProperties = new IPickTreeItem();
      fieldPickerProperties.setLoadDataOnDemand(false);
      fieldPickerProperties.setEmptyMenuMessage("No Sub Categories");
      this.setFieldPickerProperties(fieldPickerProperties);*/

      Screenshot:


      Expectation

      The change event should get fired. We should receive appropriate changed operand value (fieldname, fieldtype) in the function getValueFieldProperties.

      Other Details

      1. The smartGWT or SmartClient version from lower left corner of developer console.
      Answer]] SmartClient Version: SC_SNAPSHOT-2012-03-01_v8.2p/LGPL Development Only (built 2012-03-01)

      2. Browser(s) and version(s) involved?
      Answer]] IE Version 8 & Firefox Version 10.0.2

      3. Server side problem?
      Answer]] No. Problem is with the client side filterbuilder control issue

      4. Problem processing a server response?
      Answer]] No. Problem is with the client side filterbuilder control issue

      5. If there is a JavaScript error?
      Answer]] No. There are no javascript errors reported on browser as well as console

      Sample Project

      Sample project is attached herewith this mail. We have compressed the eclipse or reduced the size only as required for application to run. Only thing is to set the reference to the GWT and SmartGWT libraries which stated in detailed below.

      Following are the steps to run the attached project

      1. Add java files to project
      2. Copy the jars from smartgwt 3.0p lib into application’s web-inf/lib
      3. And then Import the project in eclipse using option “Import existing eclipse project”
      4. Set the reference to GWT SDK 2.3 or above.
      5. Compile the project using GWT Compile. Once you finish building the project copy files (log4j.isc.config.xml, log4j.properties, server.properties) from web-inf folder to web-inf/classes folder.
      6. Run the application as GWT web application (module name is GridNestedFilterBulderSample module and JSP name is GridNestedFilterBulderSample).

      If you run the project as is

      a. You will see a operand dropdown which is a normal combo and change event (getValueFieldProperties) is getting fired correctly with appropriate selected value from dropdown.
      b. When we change the operand dropdown from normal combo to picktree, which can be done by uncommenting the code in constructor of class FWFilterBuilder, the issue can be replicated. In version smartgwt 3.0p, the change event (getValueFieldProperties) is not getting fired. We need the change event to fire even when operand dropdown is changed from normal combo to picktree. In the smartgwt version which we are using (2.5.0), the change event is getting fired even when we have the picktree, but issue is, the change event always receives the details of the first option in the picktree operand list rather than the one selected.

      Thanks,
      Neelima
      Attached Files

      Comment


        #4
        I believe I'm seeing the same with e.g., the 3.0.p20120303 build. Is the attached test case sufficient, or would you like mine as well?

        Comment


          #5
          This is queue'd up to be addressed (expect a proper response on Monday).
          Bill, if you have a test case that demonstrates this it would be worth attaching - that would verify that the same issue is causing trouble for you (as well as giving us some additional info in case we can't reproduce the problem with nilus' test case for any reason)

          Thanks
          Isomorphic Software

          Comment


            #6
            Ok - This looked to be an issue with PickTreeItem.
            In essence the internals of the FilterBuilder relied on the 'getSelectedRecord()' API of the field chooser item, and PickTreeItem did not support this method in the same way that SelectItems do.
            We've made a change to address this. Please try the next nightly build on the 3.0p or 3.1d branch to see the change in action. If you continue to have problems with this let us know

            Thanks
            Isomorphic Software

            Comment


              #7
              Thank you - This worked with nightly build of evaluation version.
              But we have commercial version for version 2.x
              How do we get this fix in version 2.x?

              Comment


                #8
                We've now ported the fix across to the 2.5p branch - it should show up in the next nightly on that branch

                Comment

                Working...
                X