Announcement

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

    #31
    Ah OK, we thought you were saying that because it could fetch data in general, you were assuming the specific fetchMissingValues fetch would also work..

    If you're seeing it work at some times and not others, the most likely cause is that some other code of yours is wiping out the automatically fetched missing value.

    Can you confirm that in the case you're talking about where there is no selected record available to your formatter, you actually see a fetch occur and complete successfully, but then nothing happens? Or if that's not the behavior, what does happen?

    Comment


      #32
      Originally posted by Isomorphic
      Ah OK, we thought you were saying that because it could fetch data in general, you were assuming the specific fetchMissingValues fetch would also work..

      If you're seeing it work at some times and not others, the most likely cause is that some other code of yours is wiping out the automatically fetched missing value.

      Can you confirm that in the case you're talking about where there is no selected record available to your formatter, you actually see a fetch occur and complete successfully, but then nothing happens? Or if that's not the behavior, what does happen?


      I can confirm that I see a fetch occur when there is no selected record, which sends a request to my server side for that specific id and successfully returns a record for the value 300710 which returns a whole record containing the dsc (description as well as the rest of the record "CSR Guest Feedback"), but until I make a selection it never enters the if(item.getSelectedRecord != null) part of the formatter because it's always null until you select from the dropdown table of values you can see this happen in the video link I attached to the previous post. Once I select "Home..." you can see that a number appears next to the description (dsc) but only when an item is selected from the dropdown.



      EDIT: I've tried some other categories that have an ID in the first page of the SelectItem results pulled via the OptionDatasource those show the dsc and id, however if the id is not retrieved by the OptionDatasource's first pull it only shows the name, I think this is the same reason that the values don't match immediately because we are pulling from the server only part of the results until we scroll in the SelectItem to consecutive pages of results. So maybe this is not possible unless we pull the full table from the server instead of just a partial pull, like you stated in this quote?

      You'd have to turn off data paging, which you probably don't want to do unless the data is no more than a few hundreds records in the worst case. Otherwise, you're hitting the database and application server too much.
      Code:
      FormItemValueFormatter xmlidFmt = new FormItemValueFormatter() {
      			
      	@Override
      	public String formatValue(Object value, Record record, DynamicForm form, FormItem item) {
      		if(item.getSelectedRecord() != null) {
      			return item.getSelectedRecord().getAttribute("dsc") + "-" + item.getSelectedRecord().getAttribute("xmlid");
      		}
      		if(value == null) return "";
      		return value.toString();
      	}
      };
      Thank you
      Last edited by gilcollins; 13 Aug 2010, 06:42.

      Comment


        #33
        We've managed to reproduce this issue - essentially 'fetchMissingValues' failing to set up the 'selectedRecord' on the SelectItem - and have fixed it in our mainline code-base. Give it a try with our next nightly build and let us know if you continue to see the problem

        Regards
        Isomorphic Software

        Comment


          #34
          Originally posted by Isomorphic
          We've managed to reproduce this issue - essentially 'fetchMissingValues' failing to set up the 'selectedRecord' on the SelectItem - and have fixed it in our mainline code-base. Give it a try with our next nightly build and let us know if you continue to see the problem

          Regards
          Isomorphic Software
          Last "nightly" build I see is from the 12th, so I'll wait for the next one I see.

          EDIT: nightly builds are failing, just in case someone needed to know

          Thank you
          Last edited by gilcollins; 15 Aug 2010, 09:52.

          Comment


            #35
            Originally posted by Isomorphic
            We've managed to reproduce this issue - essentially 'fetchMissingValues' failing to set up the 'selectedRecord' on the SelectItem - and have fixed it in our mainline code-base. Give it a try with our next nightly build and let us know if you continue to see the problem

            Regards
            Isomorphic Software
            I've pulled the nightly from 8/20 and this is almost fixed it works just fine unless you resize the browser then it defaults back to the non-formatted view other than that it seems to work correctly.

            Thank you for your help

            Comment


              #36
              After reexamining this use case we have realized that it is actually not desirable to have fetchMissingValues:true *always* cause a fetch to occur against the item's optionDataSource and set up the selectedRecord.
              The original logic (only performing the fetch when this.displayField is specified) is appropriate in most cases.
              However your use case - having a formatter function which explicitly looks at this.selectedRecord - is a common case where we would also need a fetch to occur. To handle this we've added a new property to formItem: alwaysFetchMissingValues, which causes a fetch to occur against the optionDataSource to set up the selectedRecord even if the item has no specified displayField.

              You'll therefore need to set alwaysFetchMissingValues to true to get the expected behavior (a fetch against the optionDataSource populating the selectedRecord which can then be used in your custom formatter function).

              This change will show up in our next nightly build. Let us know if you don't see it.

              We'd also recommend you re-test the other issue with resizing the browser changing the display value with this new build / this feature in place.
              If you do continue to see it, let us know and we'll take a look

              Comment


                #37
                Originally posted by Isomorphic
                After reexamining this use case we have realized that it is actually not desirable to have fetchMissingValues:true *always* cause a fetch to occur against the item's optionDataSource and set up the selectedRecord.
                The original logic (only performing the fetch when this.displayField is specified) is appropriate in most cases.
                However your use case - having a formatter function which explicitly looks at this.selectedRecord - is a common case where we would also need a fetch to occur. To handle this we've added a new property to formItem: alwaysFetchMissingValues, which causes a fetch to occur against the optionDataSource to set up the selectedRecord even if the item has no specified displayField.

                You'll therefore need to set alwaysFetchMissingValues to true to get the expected behavior (a fetch against the optionDataSource populating the selectedRecord which can then be used in your custom formatter function).

                This change will show up in our next nightly build. Let us know if you don't see it.

                We'd also recommend you re-test the other issue with resizing the browser changing the display value with this new build / this feature in place.
                If you do continue to see it, let us know and we'll take a look
                Didn't see it in last nights I'll check again today.

                Thank you for your help.

                Comment


                  #38
                  The attribute is present (FormItem.setAlwaysFetchMissingValues()) in the nightly dated 2010-08-24

                  Thanks

                  Comment


                    #39
                    Originally posted by Isomorphic
                    After reexamining this use case we have realized that it is actually not desirable to have fetchMissingValues:true *always* cause a fetch to occur against the item's optionDataSource and set up the selectedRecord.
                    The original logic (only performing the fetch when this.displayField is specified) is appropriate in most cases.
                    However your use case - having a formatter function which explicitly looks at this.selectedRecord - is a common case where we would also need a fetch to occur. To handle this we've added a new property to formItem: alwaysFetchMissingValues, which causes a fetch to occur against the optionDataSource to set up the selectedRecord even if the item has no specified displayField.

                    You'll therefore need to set alwaysFetchMissingValues to true to get the expected behavior (a fetch against the optionDataSource populating the selectedRecord which can then be used in your custom formatter function).

                    This change will show up in our next nightly build. Let us know if you don't see it.

                    We'd also recommend you re-test the other issue with resizing the browser changing the display value with this new build / this feature in place.
                    If you do continue to see it, let us know and we'll take a look

                    I do see the setting in the nightly 8/24/2010 and it works until you do a browser resize.

                    Issue Detail:
                    This might be totally unrelated but it seems to be related.
                    If the value for the SelectItem is in the first page of the foreign key table data and you resize it stays as the formatter intended however if it's not then it reverts to as if there was no formatter on that field.

                    Captured a video to demonstrate the issue :
                    http://screencast.com/t/YTc0NmM1OT

                    Comment


                      #40
                      Thanks - we see the problem and have just added a fix for it.
                      This should show up in our *next* nightly build -- let us know if you continue to see the problem

                      Comment


                        #41
                        Originally posted by Isomorphic
                        Thanks - we see the problem and have just added a fix for it.
                        This should show up in our *next* nightly build -- let us know if you continue to see the problem
                        Works great!

                        Thank you,

                        Using latest Nightly from 8/26

                        Comment

                        Working...
                        X