Announcement

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

    filteronkeypress true

    Hello

    I am using the following
    SmartClient Version: SNAPSHOT_v8.3d_2012-09-20/PowerEdition Deployment (built 2012-09-20)

    With firefox 17.0.1

    I find that my handler is executed as the user types, and if I type fast with a longer string.

    However, the string is fully selected in the filter cell. And thus when I "pause" in my typing, and then start again what I just typed is deleted. How do I avoid this auto select of the filter string as the user types?


    I have the following code

    entityListGrid.setShowFilterEditor(true);
    entityListGrid.setAllowFilterExpressions(true);
    entityListGrid.setFilterOnKeypress(true);
    entityListGrid.setFilterLocalData(false);

    FilterEditorSubmitHandler handler = new FilterEditorSubmitHandler() {
    @Override
    public void onFilterEditorSubmit(FilterEditorSubmitEvent event) {
    myFetchData(entityListGrid, getStandardFetchDataCallback());
    }
    };
    entityListGrid.addFilterEditorSubmitHandler(handler);

    #2
    ideas?

    So how to turn off the auto select in the filter?

    Comment


      #3
      addFilterSubmitHandler leads to problem

      Hello,

      If I don't have a handler then the default filter runs and does not leave the text one types in the filter box as selected.

      My handler does a simple

      DSRequest dataRequest = new DSRequest();
      entityListGrid.fetchData(critEntityListGrid, callback, dataRequest);

      And the call back is rather simple also ...

      DSCallback callback = new DSCallback() {
      @Override
      public void execute(DSResponse response, Object rawData, DSRequest request) { entityListGrid.setData(response.getData()

      Perhaps there is a method to get the filter row and explicitly unselect it??

      Comment


        #4
        perhaps

        If I could select the filter and move the cursor that would unselect the whole item.

        Any ideas what is forcing a select/highlight of the filter text I am typing into the filter editor?

        Comment


          #5
          help

          Hmm. Even if I do
          setfilteronkeypress(false)

          I still get this auto select of the text entered when one hits return.

          How do I turn this auto select off.

          Without able to turn off the auto select I can't release our product. So any hint will be help.

          thanks!

          Comment


            #6
            warning

            [ERROR] [winter] - 19:17:28.636:MUP3:WARN:RecordEditor:isc_RVITodayArea_12_0filterEditor:Hello there. editField:drug has ods:undefined, is our first field?:true


            Perhaps this error is related.

            Not sure what ods:undefined means.

            Thanks

            Comment


              #7
              more logs

              19:28:08.018:INFO:Log:initialized
              19:28:08.833:WARN:Log:New Class ID: 'DataView' collides with ID of existing object with value 'function DataView() {
              [native code]
              }'. Existing object will be replaced.
              This conflict would be avoided by disabling ISC Simple Names mode. See documentation for further information.
              19:28:26.673:WARN:VLayout:isc_VLayout_0:Adding already drawn widget:isc_HomeTableauPane_0 to new parent:isc_VLayout_0. Child has been cleared so it can be drawn inside the new parent. This may be a result of autoDraw being enabled for the child.
              19:28:27.606:INFO:Log:isc.Page is loaded
              19:30:00.925:IBLR1:WARN:RecordEditor:isc_RVITodayArea_12_0filterEditor:Hello there. editField:drug has ods:undefined, is our first field?:true
              19:30:00.927:IBLR1:WARN:RecordEditor:isc_RVITodayArea_12_0filterEditor:Hello there. editField:ind has ods:undefined, is our first field?:false
              19:30:00.929:IBLR1:WARN:RecordEditor:isc_RVITodayArea_12_0filterEditor:Hello there. editField:company has ods:undefined, is our first field?:false
              19:30:00.931:IBLR1:WARN:RecordEditor:isc_RVITodayArea_12_0filterEditor:Hello there. editField:q5 has ods:undefined, is our first field?:false
              19:30:36.956:MUP7:WARN:Log:findByKeys: dataSource 'rvi_today' does not have primary keys declared, can't find record
              19:34:45.172:XRP0:WARN:Scrollbar:isc_PickListMenu_0_body_vscroll:setImage: image 'corner' couldn't be found
              19:34:49.037:IFCS3[E]:WARN:RecordEditor:isc_RVITodayArea_12_1filterEditor:Hello there. editField:drug has ods:undefined, is our first field?:true
              19:34:49.039:IFCS3[E]:WARN:RecordEditor:isc_RVITodayArea_12_1filterEditor:Hello there. editField:ind has ods:undefined, is our first field?:false
              19:34:49.040:IFCS3[E]:WARN:RecordEditor:isc_RVITodayArea_12_1filterEditor:Hello there. editField:company has ods:undefined, is our first field?:false
              19:34:49.042:IFCS3[E]:WARN:RecordEditor:isc_RVITodayArea_12_1filterEditor:Hello there. editField:q5 has ods:undefined, is our first field?:false

              Comment


                #8
                focus

                Setting the focus to the list grid allows me to get the selection of the filter text I have entered to go away. However, if I then just focus back to the listgrid field the filter is highlighted again.

                So does seem focus is involved. Just not able to set it.

                Comment


                  #9
                  messing with focus

                  On the theory focus might help I tried

                  adding
                  entityListGrid.focus();
                  entityListGrid.focusInFilterEditor("company");
                  entityListGrid.focusInFilterEditor("drug");

                  In my callback after I fetch data from executing the filter on the server.

                  The If I just set the focus to the list grid the selection leaves the filter and thus no highlight of what I entered. If I then click myself in the filter then it highlights and then the cursor goes to the end.

                  However, the code above does not seem to change anything. Perhaps the other focus events get dropped.

                  Ideas??

                  Comment


                    #10
                    oh

                    by the way we have the commerical version of the product (bought from you folks). we love it but for this issue which I can't figure out.

                    Comment


                      #11
                      perhaps

                      When a list grid has a filter set and is loaded by fetchdata does it auto highlight the filter field? I bet it does.

                      So then how do I stop this.

                      Comment


                        #12
                        setup for testing

                        Hello,

                        Well I guess I will try creating a simple listgrid with just my attempt at a filter and work up a test case with a mysql table with a few rows.

                        Naturally any ideas would be helpful for what I might try look at.

                        Thanks!

                        Comment


                          #13
                          what I wish to do

                          This is what I "want" to be able to do. The question is how does one do this with a listbox.

                          mylistbox.getFilterTextbox().addFocusHandler(new FocusHandler() {
                          @Override
                          public void onFocus(FocusEvent event) {
                          mylistbox.getFilterTextBox().unSelectAll();
                          }
                          });

                          Comment


                            #14
                            auto selects

                            I call
                            entityListGrid.focusInFilterEditor();

                            when the data in my grid is "Arrived", using
                            DataArrivedHandler handlerArrived = new DataArrivedHandler() {

                            @Override
                            public void onDataArrived(
                            com.smartgwt.client.widgets.grid.events.DataArrivedEvent event) {
                            System.out.println("****arrived");
                            entityListGrid.focusInFilterEditor();

                            }

                            };

                            And the text in the first field of the listbox is selected!! I just want the cursor to be at the end, no selection. Otherwise, the user is confused and types over what they already have typed in the filter box.

                            I was hoping that explicitly putting in focus would avoid the auto selection that is occurring when the listbox is refreshed.

                            ideas??

                            Comment


                              #15
                              key press

                              My current thought is to generate a
                              keypress event of a right arrow and hope that the filter editor will pick it up and unselect the highlighted text.

                              There does not seem to be any methods I can override in the list grid to control the filter.

                              But I notice that what the user wants to do is a right arrow, so will try that.

                              Ideas why the listgrid is broken? If I was not doing my own server side query it would work fine on the filter. For until recently we were doing client side filtering, which did not have this problem.

                              Perhaps some sort of timing issue?

                              Comment

                              Working...
                              X