Announcement

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

    #16
    Again its DateUtil.setInputFormat() you need to call; this changes the input format system-wide.

    Your results are as expected given that you changed the display formats for dates but did not modify the input format to match.

    Also, read the Internationalization overview - you should not even need to change those formatters, correct formatters (and input format, and decimal separator, etc) are all automatically set if you configure your locale.

    Comment


      #17
      I tried :
      - to remove all DateUtil configuration ;
      - to remove all DateUtil configuration and add DateUtil.setInputFormat("MDY") ;
      - to keep DateUtil configuration and add DateUtil.setInputFormat("DMY") ;
      - to keep DateUtil configuration and to use setInputFormat on the MiniDateRangeItem.

      Nothing worked.

      Concerning the locale configuration, I read the document and I found that we set it in our "project_name.gwt.xml" file :

      <extend-property name="locale" values="en, fr" />
      <set-property-fallback name="locale" value="en" />

      I don't know if it is enough but didn't find any other thing in the Internationalization overview that could help us.

      Comment


        #18
        The strangest thing is that relative dates work in any case, but not absolute ones.
        I tried From Yesterday to Tomorrow and it correctly appears in the filter bar after pressing Ok button.

        Is there any chance that MiniDateRangeItem works badly with DateTime but correctly with Date ? (there's no sample in the showcase)
        Last edited by vlafon; 12 Feb 2016, 05:18.

        Comment


          #19
          No, there's no general problem with MiniDateRangeItem and "datetime" fields - again bear in mind how easy something like that would be to find: we'd have dozens of reports, failing automated tests, etc.

          Your results perfectly describe setting a formatter and not setting the correct corresponding input format. You have probably missed a setting somewhere. You could also try setting "en" locale just in case, just to eliminate that as a possibility.

          At this point just let us know if you can find a way to reproduce the problem.

          Comment


            #20
            Is there any way to have details about the failure (any additional logs or error messages) ?
            I tried to use the Smart Console but it didn't help me to see why the DateRange is not accepted.
            Last edited by vlafon; 12 Feb 2016, 07:38.

            Comment


              #21
              Your instinct is good - often the developer console will log warnings which explain mysterious behavior like this, but obviously this particular interaction isn't tripping anything the framework assumes to be an error to warn about.
              From what you've told us so far, it seems like you're looking at a configuration problem of some sort. You are unable to reproduce it out side your application, and within the app it is tripped by what appears to be a straightforward use case.

              We've suggested some things to try - removing the date format customizations, removing any localization settings, and what you have tried has not yet revealed a mis-configuration.
              At this stage your best bet might be to
              - encapsulate your test case into a small standalone EntryPoint class - something you can run without any related resources. If you need a DataSource, you can define it inline as a ClientOnly DataSource just to make things self-contained
              - modify your project to launch with this entry point and confirm that the problem still exists
              - If not there's some additional application code causing the problem so it's just a case of figuring out what that is.
              - If the problem does persist, you can create a new project (or use one of the shipped samples like BuiltInDS), and put your test case EntryPoint class into it. If you can reproduce the problem there, then we've got a real test case you can show us, which we can analyze for framework bugs. If not, you know it's a configuration issue - something like the locale loaded in your app, and you can probably determine what it is.


              Going through this process is likely to identify the culprit. It may turn out to be a framework bug, or it may reveal an application coding or configuration error. If you think a Framework bug is indicated, please show us the test case and we'll take a look.

              Regards
              Isomorphic Software

              Comment


                #22
                Hi,
                Thank you for your answer.

                I finally found why the filtering was not working. I was calling filterData after using ListGrid.setCriteria method, whereas setCriteria already refreshes the grid.
                Nevertheless, it confirms a second problem I have and that I reproduced following your method (my view in a small Entry Point) :

                Code:
                public class MyEntryPoint implements EntryPoint {
                
                    @Override
                    public final void onModuleLoad() {
                        final VLayout layout = new VLayout();
                        layout.addMember(new TestFormViewImpl());
                        layout.setWidth100();
                        layout.setHeight100();
                        RootPanel.get().add(layout);
                  }
                }
                and using a project.gwt.xml as small as possible :

                Code:
                <?xml version="1.0" encoding="UTF-8"?>
                <module rename-to='my_project'>
                    <!-- Inherit the core Web Toolkit stuff. -->
                    <inherits name='com.google.gwt.user.User' />
                    <inherits name='com.google.gwt.activity.Activity' />
                    <inherits name="com.google.gwt.i18n.I18N" />
                    <inherits name="com.smartgwt.tools.SmartGwtTools" />
                    <inherits name="com.google.gwt.http.HTTP" />
                
                    <!-- We need the JUnit module in the main module, -->
                    <!-- otherwise eclipse complains (Google plugin bug?) -->
                    <inherits name='com.google.gwt.junit.JUnit' />
                
                    <!-- Other module inherits -->
                    <!-- Inherit the SmartGWT Toolkit library configuration. -->
                    <inherits name="com.smartgwt.SmartGwt" />
                
                    <!-- Specify the app entry point class. -->
                    <entry-point class='my.path.to.MyEntryPoint ' />
                
                    <!-- Specify the paths for translatable code -->
                    <source path='client' />
                    <source path='shared' />
                
                    <extend-property name="locale" values="en" />
                    <set-property-fallback name="locale" value="en" />
                </module>
                (I used the same code for TestFormViewImpl that I previously posted.)

                In that case, the filter works correctly but it doesn't appear correctly in the filtering bar (filter is still empty). Moreover, when I click again on the calendar of MiniDateRangeItem, the previous dateRange that I selected doesn't appear (the From and To combobox are empty) whereas in the ShowCase, it is correctly saved. That explains why filterData method was not retrieving correctly the criteria from the filterEditor.

                I tested it on Chrome and Firefox, using the same versions as before.

                Does this strange behavior about the display and memory of the MiniDateRangeItem come from a configuration issue, even if I tried it in a completely isolated EntryPoint?
                Can you reproduce that?

                Thanks.

                Comment


                  #23
                  Thanks for the test case.
                  We'll give it a try on our end and follow up soon to let you know what we find.

                  Regards
                  Isomorphic Software

                  Comment


                    #24
                    TestFormViewImpl still has the problem we previously pointed out - no dataFormat:"xml" setting.

                    With an isolated EntryPoint like this, you could still create a problem from a static initializer in a class in the same project. Please check for code like that.

                    Comment


                      #25
                      Have you updated to the latest SGWT 5.0p patch build from http://www.smartclient.com/builds/SmartGWT/5.0p? That should be your first step.

                      We're not reproducing the problem you describe with the latest build, using GWT 2.6.1. We've attached our modifications to the BuiltInDS sample project - the java files go under src\com\smartgwt\sample\client, the project file under src\com\smartgwt\sample, and the DS data file under war\ds. Nothing else is changed from what's in the public download.

                      In that case, the filter works correctly but it doesn't appear correctly in the filtering bar (filter is still empty). Moreover, when I click again on the calendar of MiniDateRangeItem, the previous dateRange that I selected doesn't appear (the From and To combobox are empty) whereas in the ShowCase, it is correctly saved. That explains why filterData method was not retrieving correctly the criteria from the filterEditor.
                      We're able to enter a date range in the popup and use it to filter. Afterwards, the correct range is displayed in the filter text box of the ListGrid. Clicking the MiniDateRangeItem again brings up the date range that was previously entered. (Tested on Chrome 48 and FF 24 ESR.)
                      Attached Files
                      Last edited by Isomorphic; 16 Feb 2016, 12:24.

                      Comment


                        #26
                        Hi,
                        Thanks for your answer.

                        No we don't have the latest version but we can't update it too often because of the potential impact on our project.

                        Moreover, I tried to create a new project, not linked with any other, using the code you tested and, indeed, there's no display problem.
                        There is probably some component in our project that is modifying the behavior of MiniDateRangeItem, without knowing it.

                        I will try to identify what is it, but it will be quite hard to find I think.

                        Comment

                        Working...
                        X