How can I avoid having to rebind with dataset?

Home Forums kbmMW How can I avoid having to rebind with dataset?

Viewing 3 reply threads
  • Author
    Posts
    • #54748
      TomYU
      Participant

      How can I avoid having to rebind it when the dataset is reopened after binding a dataset?

    • #54749
      TomYU
      Participant

      I bind a clientquery, and then when I reopen the clientquery, I must clear the binding before opening, and then rebind after opening.

      How can smartbind better support data reopening? Once bound, Smartbind can adapt to the reopening of the clientquery.

      • This reply was modified 5 years, 7 months ago by TomYU.
      • This reply was modified 5 years, 7 months ago by TomYU.
    • #54756
      kimbomadsen
      Keymaster

      Hi,

      I have looked at it, and it will be available in next release. No date set yet.

      • #54767
        TomYU
        Participant

        hi,

        This is definitely good news for me.

        I have used smartbind in the actual project. If I can see the improvement of the above problem as soon as possible, it is a very grateful event for me.

        I have already felt the perfection of smartbind. Smartbind is a technology that must be used in the development projects. I look forward to smartbind being more perfect.

        In order to bind the reopened clientquery, I have to write a lot of code because my clientquery is on the datamodule and the binding object is on the form. In the end, it looks like the form and datamodule Still tightly coupled together.

        In addition, when the Listview is bound to the clientquery, my users can feel the efficiency is very low on the android platform, Is there a way to improve the efficiency?

        best regards
        Tom yu.

    • #54769
      TomYU
      Participant

      hi,

      “In addition, when the Listview is bound to the clientquery, my users can feel the efficiency is very low on the android platform, Is there a way to improve the efficiency?”

      This problem was caused by rebinding.
      I created a field for ClientQuery during the design period and bound it once during the run time to solve the problem of slow display.

      best regards
      Tom yu.

      • #54770
        kimbomadsen
        Keymaster

        Rebinding should be fairly fast unless you have tens of thousands of bindings. However I think that you are no longer making a request for field definitions from the server, which saves you a roundtrip. The server probably also saves a couple of roundtrips towards the database.

        AutoFieldDefsOnOpen is a vital property to set correctly depending on need, for when opening kbmMW datasets. It exists both on the client side and server side data set components.

        The default is that each dataset will make two calls. One for the metadata/fielddefs and the other for the actual data.
        A faster option is to set to only ask for fielddefs when none exists, or use withdata option, or do as you did, predefine the fields and tell it not to get new metadata, since they all save a roundtrip.

        • #54775
          TomYU
          Participant

          I have some questions about smartbind:

          1.Smarbind does not work properly on the Android platform, but works normally on Windows. When ClientQuery.AutoFieldDefsOnOpen = mwafoOnce.
          I think mwafoOnce has bug on android platform.
          An error message : the field does not have a dataset.

          2.I had to call Refresh twice for Listview to display the contents of the dataset correctly.
          qOrderItem is a TkbmMWClientQuery and qOrderItem .AutoFieldDefsOnOpen =mwafoNever

          procedure TForm1.BindOrderItem;
          begin
          qOrderItem .AutoFieldDefsOnOpen :=mwafoNever;
          if NavigatorOrderItem=nil then
          begin
          FBindOrderItem.Bind(qOrderItem, ‘FGoodsCode’, ListView1, ‘#fgoodscode’);
          … NavigatorOrderItem:=FBindOrderItem.Bind(qOrderItem, ‘@’, ListView1, ‘@’, [mwboTwoWay]);
          end;
          NavigatorOrderItem.Navigator.Refresh;
          NavigatorOrderItem.Navigator.Refresh;//+++++++++++++

          end;

          3.In the process of repeatedly opening the dataset when clientquery .AutoFieldDefsOnOpen :=mwafoNever, occasionally an error message is generated: the field does not have a dataset. This is caused when smartbind calls the Update method.

        • #54776
          TomYU
          Participant

          After using mwafoNevera or mwafoOncer, I do not need to rebind, but when ClientQuery is opened, Listview and data set are often displayed out of sync, even though I call the Refresh method.
          This forced me to change back to the original way.

Viewing 3 reply threads
  • You must be logged in to reply to this topic.