Remote Table Model

classic Classic list List threaded Threaded
15 messages Options
Reply | Threaded
Open this post in threaded view
|

Remote Table Model

salman farci
Hi,

Its been a hardtime for me to get done with atleast a simple "remote
table model" working. After extending Remote class and implementing
_loadRowCount() and _loadRowData(), it returns an error saying
"_loadRowCount() is not a function", Thats one thing. And another
thing is that once I get data from the backend server, how do i put on
them on the remote table instead of Simple ?(May be I'm stupid at this
point) Coz, I tried creating object for Remote() method &
instantiating in order to put them on the table. But, it doesn't work.
I'm using php for my server side scripting. Im eagerly looking forward
& thankful for anyone who can provide me the code for remote model
table.

Regards

Farci

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: Remote Table Model

Derrell Lipman
On Fri, Sep 19, 2008 at 2:35 AM, salman farci <[hidden email]> wrote:
Hi,

Its been a hardtime for me to get done with atleast a simple "remote
table model" working. After extending Remote class and implementing
_loadRowCount() and _loadRowData(), it returns an error saying
"_loadRowCount() is not a function", Thats one thing. And another
thing is that once I get data from the backend server, how do i put on
them on the remote table instead of Simple ?(May be I'm stupid at this
point) Coz, I tried creating object for Remote() method &
instantiating in order to put them on the table. But, it doesn't work.
I'm using php for my server side scripting. Im eagerly looking forward
& thankful for anyone who can provide me the code for remote model
table.

Why don't you post your class that extends Remote.  Maybe we can tell you what the problem is.

Derrell
 

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: Remote Table Model

salman farci
Hi,

Here is my code(very much incorrect) in that I have used Remote
instead of Simple. Still doesn't seem to work.

qx.Class.define("qx.ui.table.model.RemoteTable",
{
  extend : qx.ui.table.model.Remote,

  members : {

    _loadRowCount: function()
   {
   /* var tableModel = new qx.ui.table.model.Simple();
    tableModel.setColumns(["User ID", "User Name", "Designation",
"Residence Address", "Email ID", "Contact Number"]);
    this.tableModel = tableModel;
 */
    var rpc = new
qx.io.remote.Rpc("http://localhost/rpc/backend/index.php","user");
    var handler = function(result, exception)
    {
      if (exception==null) {
                          alert(result); // tableModel.setData(result);
                        }
      else  { alert(exception); }          this.onRowCountLoaded(result);
    };
    rpc.callAsync(handler, "userList", "user");
    //var table = new qx.ui.table.Table(tableModel);  table.set({
width: 700, height: 400 }); return table;
   },

   _loadRowData : function()
  {

    var handler = function(result, exception) {
       if (exception == null) {
        alert(result);
        var rowData = this.formulateRowData(result);
    }
     else
     {
        //alert(exception);
     }
   //  this._onRowDataLoaded (rowData);
    };
    rpc.callAsync(handler, "userList", firstRow, rowCount);
    }
  }
});

Regards

Farci

On Fri, Sep 19, 2008 at 6:48 AM, Derrell Lipman
<[hidden email]> wrote:

> On Fri, Sep 19, 2008 at 2:35 AM, salman farci <[hidden email]> wrote:
>>
>> Hi,
>>
>> Its been a hardtime for me to get done with atleast a simple "remote
>> table model" working. After extending Remote class and implementing
>> _loadRowCount() and _loadRowData(), it returns an error saying
>> "_loadRowCount() is not a function", Thats one thing. And another
>> thing is that once I get data from the backend server, how do i put on
>> them on the remote table instead of Simple ?(May be I'm stupid at this
>> point) Coz, I tried creating object for Remote() method &
>> instantiating in order to put them on the table. But, it doesn't work.
>> I'm using php for my server side scripting. Im eagerly looking forward
>> & thankful for anyone who can provide me the code for remote model
>> table.
>
> Why don't you post your class that extends Remote.  Maybe we can tell you
> what the problem is.
>
> Derrell
>
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great
> prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> qooxdoo-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>
>

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: Remote Table Model

Derrell Lipman
Holy fly paper, Batman!  It's a real bug!

I was under the impression that numerous people were actually using the Remote Data Model, but it had a serious bug in it and just plain didn't work.  I've fixed that bug and also provided a real live working example of using the Remote Data Model.  The last tab of the qooxdoo-contrib project RpcExample is a table that uses a remote table model.  It communicates via JSON-RPC to the PHP (only, at the moment) backend which provides the data for the table as it's requested.  I expect you'll have better luck now, but if you still have problems, at least there's now an example you can refer to.

Cheers,

Derrell

ps. The method you need to call you've retrieved the row count is _onRowCountLoaded (note the leading underscore).  I expect that was just a typo.



On Sun, Sep 21, 2008 at 12:53 AM, salman farci <[hidden email]> wrote:
Hi,

Here is my code(very much incorrect) in that I have used Remote
instead of Simple. Still doesn't seem to work.

qx.Class.define("qx.ui.table.model.RemoteTable",
{
 extend : qx.ui.table.model.Remote,

 members : {

   _loadRowCount: function()
  {
  /* var tableModel = new qx.ui.table.model.Simple();
   tableModel.setColumns(["User ID", "User Name", "Designation",
"Residence Address", "Email ID", "Contact Number"]);
   this.tableModel = tableModel;
 */
   var rpc = new
qx.io.remote.Rpc("http://localhost/rpc/backend/index.php","user");
   var handler = function(result, exception)
   {
     if (exception==null) {
                         alert(result); // tableModel.setData(result);
                       }
     else  { alert(exception); }          this.onRowCountLoaded(result);
   };
   rpc.callAsync(handler, "userList", "user");
   //var table = new qx.ui.table.Table(tableModel);  table.set({
width: 700, height: 400 }); return table;
  },

  _loadRowData : function()
 {

   var handler = function(result, exception) {
      if (exception == null) {
       alert(result);
       var rowData = this.formulateRowData(result);
   }
    else
    {
       //alert(exception);
    }
  //  this._onRowDataLoaded (rowData);
   };
   rpc.callAsync(handler, "userList", firstRow, rowCount);
   }
 }
});

Regards

Farci

On Fri, Sep 19, 2008 at 6:48 AM, Derrell Lipman
<[hidden email]> wrote:
> On Fri, Sep 19, 2008 at 2:35 AM, salman farci <[hidden email]> wrote:
>>
>> Hi,
>>
>> Its been a hardtime for me to get done with atleast a simple "remote
>> table model" working. After extending Remote class and implementing
>> _loadRowCount() and _loadRowData(), it returns an error saying
>> "_loadRowCount() is not a function", Thats one thing. And another
>> thing is that once I get data from the backend server, how do i put on
>> them on the remote table instead of Simple ?(May be I'm stupid at this
>> point) Coz, I tried creating object for Remote() method &
>> instantiating in order to put them on the table. But, it doesn't work.
>> I'm using php for my server side scripting. Im eagerly looking forward
>> & thankful for anyone who can provide me the code for remote model
>> table.
>
> Why don't you post your class that extends Remote.  Maybe we can tell you
> what the problem is.
>
> Derrell
>
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great
> prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> qooxdoo-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>
>

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel



--
"There is nothing more difficult to plan, more doubtful of success, nor more dangerous to manage than the creation of a new system. For the initiator has the enmity of all who would profit by the preservation of the old system and merely lukewarm defenders in those who would gain by the new one." --Machiavelli, 1513

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: Remote Table Model

oetiker
Derrell,

Yesterday Derrell Lipman wrote:
[...]
> using the Remote Data Model.  The last tab of the qooxdoo-contrib project
> RpcExample is a table that uses a remote table model.

can you convert that into an accual url for me ?

cheers
tobi

--
Tobi Oetiker, OETIKER+PARTNER AG, Aarweg 15 CH-4600 Olten, Switzerland
http://it.oetiker.ch [hidden email] ++41 62 775 9902 / sb: -9900

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: Remote Table Model

Hugh Gibson-2
In reply to this post by Derrell Lipman
Derrell,

I've been using the remote table for a couple of years and haven't ever
hit this "fundamental problem" that you talk of.

It appears that you have misunderstood how the row data is stored in the
remote table. It actually is a map from column name to column information.
Changing this to an array, as you have done with your checkins, would
have a significant impact on our code. We store additional information
about the row which helps with context menu content and which colour to
use as background etc.

I've had a look around and can't find any clear documentation on this -
it's just one of those things that are "known". There's various hints
about it, e.g. ui/table/pane/pane.js line 526:

// AB: use the "getValue" method of the tableModel to get the
cell's value
// working directly on the "rowData" object (->
cellInfo.rowData[col];) is not a solution
// because you can't work with the columnIndex -> you have to
use the columnId of the columnIndex
          // This is exactly what the method "getValue" does
          cellInfo.value = tableModel.getValue(col, row);

Also remote.js getRowData says the return type is "{Object} Map
containing a value for each column." - not an array. Note that
ITableModel.getRowData says that the row data depends on the model in
use:

* @return {Object} the row data as an object or null if the model
does not support row data
*                    objects. The details on the object returned are
determined by the model
     *                    implementation only.

In other words, the model is free to change the type.

There was a previous thread about this: see
http://www.mail-archive.com/qooxdoo-devel@.../msg12379.h
tml as the most relevant message.

The "bug" would be lack of documentation. The 0.8 API viewer, by hiding
protected functions, makes it very difficult to understand how to use the
remote table model anyway.

See also
http://www.nabble.com/Patch-to-qx.ui.table.model.Remote%3A-setValue%28%29-
method-implemented-td13112506.html#a13154974
for a comment about a setRowData function.

Derrell, one thing that is also clear when trying to track down issues
like this is lack of cross-referencing and bug reports. In the bad old
days there was very little done (which has made the detective work I've
done this morning more difficult). We should know better now...

Also, I've CCed this to your private address as a previous comment of
mine to the mailing list seems to have got stuck in a queue.

Hugh

> *Subject:* Re: [qooxdoo-devel] Remote Table Model
> *From:* "Derrell Lipman" <[hidden email]>
> *To:* "qooxdoo Development" <[hidden email]>
> *Date:* Sun, 21 Sep 2008 21:08:20 -0400
>
> Holy fly paper, Batman!  It's a real bug!
>
> I was under the impression that numerous people were actually using
> the Remote Data Model, but it had a serious bug in it and just plain
> didn't work.  I've fixed that bug and also provided a real live
> working example of using the Remote Data Model.  The last tab of the
> qooxdoo-contrib project RpcExample is a table that uses a remote
> table model.  It communicates via JSON-RPC to the PHP (only, at the
> moment) backend which provides the data for the table as it's
> requested.  I expect you'll have better luck now, but
> if you still have problems, at least there's now an example you can
> refer to.

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: Remote Table Model

Derrell Lipman


On Mon, Sep 22, 2008 at 2:46 AM, Hugh Gibson <[hidden email]> wrote:
Derrell,

I've been using the remote table for a couple of years and haven't ever
hit this "fundamental problem" that you talk of.

It appears that you have misunderstood how the row data is stored in the
remote table. It actually is a map from column name to column information.
Changing this to an array, as you have done with your checkins, would
have a significant impact on our code. We store additional information
about the row which helps with context menu content and which colour to
use as background etc.

Hi, Hugh.  Thanks for your comments!

Actually, I hadn't changed anything from a map to an array; I had just changed which "index" (property of the map) was used to reference the map. I changed it from the string ID to the column number.  However, I now see that the data provided to the Remote data model is intended to be different than the data passed to the Simple data model.  I had assumed (incorrectly) that an efficient array of arrays would be passed from the server to the client... just as an array of arrays is passed to the Simple data model.  No such luck, I see.  Instead, we need to pass the column id with each and every value.  Mighty inefficient and bandwidth wasteful, but I suppose for the small amount of data on each request, it's not a huge issue.

I've reverted my change to Remote.js so that existing code doesn't break, and I have patched my example so that it can work with the unaltered Remote.js.  There are problems, though.   In order for a map to be passed between server and client, the server and client must agree on the ID values.  By default, the column id values are the same as the column heading values.  That's all well and fine until the column headings are localized.  Then, a client in Germany would expect the server to send one set of id values while a client in England would expect a different set.  Internally, there's no need for the ID values to be localized.  This is purely a data model issue, not one that the application should have to deal with.  It is possible to override the id values for the columns by calling dataModel.setColumnIds(), and it would seem reasonable that the data model which extends Remote would in fact do this.  The problem is that when the data model is passed to the constructor of the Table, the ID values are reset to the column names.  That, I think, shouldn't happen.  If the ID values have been set already, I do not believe that setting the column names should override the previously-set ID values.  Would you agree?  How did you get around this?  Are you just not concerned with localization (and can therefore use the column names)?  Did you have the application deal with it after instantiating the table?

Derrell


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: Remote Table Model

Derrell Lipman
On Mon, Sep 22, 2008 at 9:42 AM, Derrell Lipman <[hidden email]> wrote:

The problem is that when the data model is passed to the constructor of the Table, the ID values are reset to the column names.

Obviously, that's not where it happens.  Sorry.  It happens when dataModel.setColumns() is called by the application.  The problem I described, however, still exists.  The data model should be able to set the ID values and not have them overridden with the column names, right?

Derrell



-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: Remote Table Model

Derrell Lipman
In reply to this post by oetiker
On Mon, Sep 22, 2008 at 2:10 AM, Tobias Oetiker <[hidden email]> wrote:
Derrell,

Yesterday Derrell Lipman wrote:
[...]
> using the Remote Data Model.  The last tab of the qooxdoo-contrib project
> RpcExample is a table that uses a remote table model.

can you convert that into an accual url for me ?

No, there's no URL.  Since there is no public backend, there's no way to provide a live example.  You can, however, easily check out the code and build the application yourself.  Instructions for checking out the code are here:

  http://qooxdoo.org/contrib?s=qooxdoo%20contrib%20svn

and the projects you want to look at are RpcExample for the definition of the remote table model class that extends Remote, and at RpcPhp for the remoteTableTest service that generates the data for the remote table.

Derrell


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: Remote Table Model

Hugh Gibson-2
In reply to this post by Derrell Lipman
> Actually, I hadn't changed anything from a map to an array; I had
> just changed which "index" (property of the map) was used to
> reference the map. I changed it from the string ID to the column
> number.  However, I now see that the data provided to the Remote
> data model is intended to be different than the data passed to the
> Simple data model.  I had assumed (incorrectly) that an efficient
> array of arrays would be passed from the server to the client...
> just as an array of arrays is passed to the Simple data model.  No
> such luck, I see.  Instead, we need to pass the column id with each
> and every value.  Mighty inefficient and bandwidth wasteful, but I
> suppose for the small amount of data on each request, it's not a
> huge issue.

As I've said in the thread I referenced before, it's very simple to pass
an array and recode it in the client to a dict. I do this here and
haven't noticed a big hit on speed. As it works on blocks of 50 or so
items at once there won't be a big impact at any given instant.

Having said that I use one character column IDs!

Also, being able to store other information with the row is great for my
custom row renderer and for other things that hang off the table, like
menus which depend on row content (but not necessarily visible row
content, like permissions).

Hugh

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: Remote Table Model

Hugh Gibson-2
In reply to this post by Derrell Lipman
> > The problem is that when the data model is passed to the
> > constructor of the Table, the ID values are reset to the column
names.
> >
>
> Obviously, that's not where it happens.  Sorry.  It happens when
> dataModel.setColumns() is called by the application.  The problem I
> described, however, still exists.  The data model should be able to
> set the ID values and not have them overridden with the column names,
> right?

I don't see the problem. qx.ui.table.model.Abstract.setColumns has two
arguments - a list of column names and a list of IDs to use. If you pass
through just the names, then the IDs are reset to the names as you
describe. If you pass through both arrays then it's OK.

Hugh

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: Remote Table Model

Derrell Lipman
On Tue, Sep 23, 2008 at 3:13 AM, Hugh Gibson <[hidden email]> wrote:
> > The problem is that when the data model is passed to the
> > constructor of the Table, the ID values are reset to the column
names.
> >
>
> Obviously, that's not where it happens.  Sorry.  It happens when
> dataModel.setColumns() is called by the application.  The problem I
> described, however, still exists.  The data model should be able to
> set the ID values and not have them overridden with the column names,
> right?

I don't see the problem. qx.ui.table.model.Abstract.setColumns has two
arguments - a list of column names and a list of IDs to use. If you pass
through just the names, then the IDs are reset to the names as you
describe. If you pass through both arrays then it's OK.

Right.  I'm not changing that behavior.  What is currently not easy to do, but I think should be, is for the data model to set the IDs in its constructor.  The IDs are often an internally agreed issue between the data model and the backend, and when that's the case, the application (which calls setColumns() since it cares about what the user sees) shouldn't need to know anything about those IDs.  Without my proposed patch, though, as soon as the application calls setColumns() without passing the second parameter, the ID values specified by the data model in its constructor get overwritten.

All right, I think this is going to be an innocuous change for most people, probably everyone.  Likely they're either passing the array of IDs to setColumns() or they're not dealing with IDs.  I'll go ahead and check in my change.

Thanks.

Derrell


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: Remote Table Model

Jim Hunter
With all this talk going on about the Remote Table Model, I think that the on-line demo should be renamed. It is called "Table with remote table model" when in reality it is using a Simple table model and when you add rows it's not getting them remotely, it's getting the data from a local function. I feel jipped! I went there looking for sample code and found that it is all an illusion.

http://demo.qooxdoo.org/current/demobrowser/#table-Table_Remote_Model.html

That is the demo that needs to be renamed.

Thanks,
Jim


On Tue, Sep 23, 2008 at 5:41 AM, Derrell Lipman <[hidden email]> wrote:
On Tue, Sep 23, 2008 at 3:13 AM, Hugh Gibson <[hidden email]> wrote:
> > The problem is that when the data model is passed to the
> > constructor of the Table, the ID values are reset to the column
names.
> >
>
> Obviously, that's not where it happens.  Sorry.  It happens when
> dataModel.setColumns() is called by the application.  The problem I
> described, however, still exists.  The data model should be able to
> set the ID values and not have them overridden with the column names,
> right?

I don't see the problem. qx.ui.table.model.Abstract.setColumns has two
arguments - a list of column names and a list of IDs to use. If you pass
through just the names, then the IDs are reset to the names as you
describe. If you pass through both arrays then it's OK.

Right.  I'm not changing that behavior.  What is currently not easy to do, but I think should be, is for the data model to set the IDs in its constructor.  The IDs are often an internally agreed issue between the data model and the backend, and when that's the case, the application (which calls setColumns() since it cares about what the user sees) shouldn't need to know anything about those IDs.  Without my proposed patch, though, as soon as the application calls setColumns() without passing the second parameter, the ID values specified by the data model in its constructor get overwritten.

All right, I think this is going to be an innocuous change for most people, probably everyone.  Likely they're either passing the array of IDs to setColumns() or they're not dealing with IDs.  I'll go ahead and check in my change.

Thanks.

Derrell


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel




--
Jim Hunter

DAILY THOUGHT: SOME PEOPLE ARE LIKE SLINKIES - NOT REALLY GOOD
FOR ANYTHING BUT THEY BRING A SMILE TO YOUR FACE WHEN PUSHED DOWN THE STAIRS

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: Remote Table Model

Derrell Lipman


On Thu, Sep 25, 2008 at 7:34 PM, Jim Hunter <[hidden email]> wrote:
With all this talk going on about the Remote Table Model, I think that the on-line demo should be renamed. It is called "Table with remote table model" when in reality it is using a Simple table model and when you add rows it's not getting them remotely, it's getting the data from a local function. I feel jipped! I went there looking for sample code and found that it is all an illusion.

http://demo.qooxdoo.org/current/demobrowser/#table-Table_Remote_Model.html

That is the demo that needs to be renamed.

I noticed the same thing, and I wrote a real demo of using the Remote Table Model.  It's not appropriate to have it in the demobrowser, however, since there are no available services on that server.  Instead, you can build it yourself and install the server-side services on your own server to test it out.  Have a look at the RpcExample project in qooxdoo-contrib, and the RpcPhp backend.  (Currently, only the PHP backend supports the services used by the example.)  The last tab in the example application uses and tests a remote table model.  The class rpcexample.RemoteDataModel extends qx.ui.table.model.Remote and issues the requests to the server.  In RpcPhp, services/qooxdoo/remoteTableTest.php implements the services used by that example program.

Derrell



-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: Remote Table Model

Hugh Gibson-2
> I noticed the same thing, and I wrote a real demo of using the
> Remote Table Model.  It's not appropriate to have it in the
> demobrowser,  however, since there are no available services on that
> server.  Instead, you can build it yourself and install the
> server-side services on your own server to test it out.

The remote table demo could just have the functions to get data and count
supplying dummy local data. They don't have to call the server at all.

Hugh

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel