Editing "disabled" TableView column data

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

Editing "disabled" TableView column data

Tom Coleman

Here's one condition that I could use some guidance on.

I've basically figured out how to display data ini a TableView as "disabled".  This basically involves examining the data in context and rendering an appropriate style.  So far so good.

But once identified as "disabled", how should I go about disallowing editing of the column?

That ends my question.  Editorial comments follow:

I've been wading through the project and so far have been quite impressed.

Between the web docs, the API docs, tutorials, examples, demos, tests and source code, there is not much that someone with time and patience can't figure out.
 
Two observations are that many of the examples tend to be very simple and that Google is not much help.

Thanks!

Tom




Reply | Threaded
Open this post in threaded view
|

Re: Editing "disabled" TableView column data

Sandro Martini

Hi Tom,
welcome to Pivot and sorry for the delay.

What do you mean by disabled data ?
A row that's not editable ?
I remember a prototype made by a user (but never proposed for a real inclusion in Pivot) to select or render cells in a different way ... do you need something like this ?

Anyway we have some example of table row editing, I can give you more details.

Note that in our sources in svn (both branch 2.0.x and trunk) there is an example subproject with some not so trivial  samples.

On documentation I know that could be improved,  and any help is welcome :-) ...
Note that all our mailing lists are public so you can find many info in some indexing services like Nabble.

Bye,
Sandro

Il 04/Feb/2016 19:21, "Tom Coleman" <[hidden email]> ha scritto:

Here's one condition that I could use some guidance on.

I've basically figured out how to display data ini a TableView as "disabled".  This basically involves examining the data in context and rendering an appropriate style.  So far so good.

But once identified as "disabled", how should I go about disallowing editing of the column?

That ends my question.  Editorial comments follow:

I've been wading through the project and so far have been quite impressed.

Between the web docs, the API docs, tutorials, examples, demos, tests and source code, there is not much that someone with time and patience can't figure out.

Two observations are that many of the examples tend to be very simple and that Google is not much help.

Thanks!

Tom




Reply | Threaded
Open this post in threaded view
|

Re: Editing "disabled" TableView column data

Tom Coleman
In reply to this post by Tom Coleman
So far I derived a TableViewCellRenderer that can render a cell as "disabled".

The trick then is to process this information in the TableViewRowEditor, which I have done by creating my own. (I found it difficult to extend Pivot's - basically wound it copying it and renaming it.)

My RowEditor can now disable the appropriate CellEditor Component. So far so good.

At the moment I am wrestling with understanding TableView data binding.

It seemed like I was heading down a path of endlessly extending Components.

So far it looks like I can have an "editable" property in a custom TableView cell class (OlympicStanding).

I know I can disable CellEditors. Right now the only unknown is how editor Components will bind to custom objects in cells.

Let me know if I'm making this more complicated than it is.

Thanks

Tom


Sandro Martini <[hidden email]> wrote:

Hi Tom,
welcome to Pivot and sorry for the delay.

What do you mean by disabled data ?
A row that's not editable ?
I remember a prototype made by a user (but never proposed for a real inclusion in Pivot) to select or render cells in a different way ... do you need something like this ?

Anyway we have some example of table row editing, I can give you more details.

Note that in our sources in svn (both branch 2.0.x and trunk) there is an example subproject with some not so trivial  samples.

On documentation I know that could be improved,  and any help is welcome :-) ...
Note that all our mailing lists are public so you can find many info in some indexing services like Nabble.

Bye,
Sandro

Il 04/Feb/2016 19:21, "Tom Coleman" <[hidden email]> ha scritto:

Here's one condition that I could use some guidance on.

I've basically figured out how to display data ini a TableView as "disabled".  This basically involves examining the data in context and rendering an appropriate style.  So far so good.

But once identified as "disabled", how should I go about disallowing editing of the column?

That ends my question.  Editorial comments follow:

I've been wading through the project and so far have been quite impressed.

Between the web docs, the API docs, tutorials, examples, demos, tests and source code, there is not much that someone with time and patience can't figure out.

Two observations are that many of the examples tend to be very simple and that Google is not much help.

Thanks!

Tom




Reply | Threaded
Open this post in threaded view
|

Re: Editing "disabled" TableView column data

Roger and Beth Whitcomb
Definitely row/cell editors use data binding to "load" and "store" values into your TableView data objects.  So, the super of your RowEditor will call the "load" method before beginning the edit, and then at the end of the edit will call "store".  It is up to you to implement these methods on your bean objects.

I should be able to give you a better explanation later today -- have some appointments...

Thanks,
~Roger

On 2/7/16 8:20 AM, Tom wrote:
So far I derived a TableViewCellRenderer that can render a cell as "disabled".

The trick then is to process this information in the TableViewRowEditor, which I have done by creating my own. (I found it difficult to extend Pivot's - basically wound it copying it and renaming it.)

My RowEditor can now disable the appropriate CellEditor Component. So far so good.

At the moment I am wrestling with understanding TableView data binding.

It seemed like I was heading down a path of endlessly extending Components.

So far it looks like I can have an "editable" property in a custom TableView cell class (OlympicStanding).

I know I can disable CellEditors. Right now the only unknown is how editor Components will bind to custom objects in cells.

Let me know if I'm making this more complicated than it is.

Thanks

Tom


Sandro Martini [hidden email] wrote:

Hi Tom,
welcome to Pivot and sorry for the delay.

What do you mean by disabled data ?
A row that's not editable ?
I remember a prototype made by a user (but never proposed for a real inclusion in Pivot) to select or render cells in a different way ... do you need something like this ?

Anyway we have some example of table row editing, I can give you more details.

Note that in our sources in svn (both branch 2.0.x and trunk) there is an example subproject with some not so trivial  samples.

On documentation I know that could be improved,  and any help is welcome :-) ...
Note that all our mailing lists are public so you can find many info in some indexing services like Nabble.

Bye,
Sandro

Il 04/Feb/2016 19:21, "Tom Coleman" <[hidden email]> ha scritto:

Here's one condition that I could use some guidance on.

I've basically figured out how to display data ini a TableView as "disabled".  This basically involves examining the data in context and rendering an appropriate style.  So far so good.

But once identified as "disabled", how should I go about disallowing editing of the column?

That ends my question.  Editorial comments follow:

I've been wading through the project and so far have been quite impressed.

Between the web docs, the API docs, tutorials, examples, demos, tests and source code, there is not much that someone with time and patience can't figure out.

Two observations are that many of the examples tend to be very simple and that Google is not much help.

Thanks!

Tom





Reply | Threaded
Open this post in threaded view
|

Re: Editing "disabled" TableView column data

Tom Coleman

Re: load and store in the bean objects:  I can't find any example.  It looks to me like cell editor Components load data via JSON.get, but that this binding can be overridden.

What would really help right now is some feedback on the DataBindingTest (org.apache.pivot.tests).  I can't make any sense of it.

Thanks,

Tom


On Feb 8, 2016, at 10:46 AM, Roger and Beth Whitcomb wrote:

Definitely row/cell editors use data binding to "load" and "store" values into your TableView data objects.  So, the super of your RowEditor will call the "load" method before beginning the edit, and then at the end of the edit will call "store".  It is up to you to implement these methods on your bean objects.

I should be able to give you a better explanation later today -- have some appointments...

Thanks,
~Roger

On 2/7/16 8:20 AM, Tom wrote:
So far I derived a TableViewCellRenderer that can render a cell as "disabled".

The trick then is to process this information in the TableViewRowEditor, which I have done by creating my own. (I found it difficult to extend Pivot's - basically wound it copying it and renaming it.)

My RowEditor can now disable the appropriate CellEditor Component. So far so good.

At the moment I am wrestling with understanding TableView data binding.

It seemed like I was heading down a path of endlessly extending Components.

So far it looks like I can have an "editable" property in a custom TableView cell class (OlympicStanding).

I know I can disable CellEditors. Right now the only unknown is how editor Components will bind to custom objects in cells.

Let me know if I'm making this more complicated than it is.

Thanks

Tom


Sandro Martini [hidden email] wrote:

Hi Tom,
welcome to Pivot and sorry for the delay.

What do you mean by disabled data ?
A row that's not editable ?
I remember a prototype made by a user (but never proposed for a real inclusion in Pivot) to select or render cells in a different way ... do you need something like this ?

Anyway we have some example of table row editing, I can give you more details.

Note that in our sources in svn (both branch 2.0.x and trunk) there is an example subproject with some not so trivial  samples.

On documentation I know that could be improved,  and any help is welcome :-) ...
Note that all our mailing lists are public so you can find many info in some indexing services like Nabble.

Bye,
Sandro

Il 04/Feb/2016 19:21, "Tom Coleman" <[hidden email][hidden email]> ha scritto:

Here's one condition that I could use some guidance on.

I've basically figured out how to display data ini a TableView as "disabled".  This basically involves examining the data in context and rendering an appropriate style.  So far so good.

But once identified as "disabled", how should I go about disallowing editing of the column?

That ends my question.  Editorial comments follow:

I've been wading through the project and so far have been quite impressed.

Between the web docs, the API docs, tutorials, examples, demos, tests and source code, there is not much that someone with time and patience can't figure out.

Two observations are that many of the examples tend to be very simple and that Google is not much help.

Thanks!

Tom






Reply | Threaded
Open this post in threaded view
|

RE: Editing "disabled" TableView column data

Roger Whitcomb-2

Hi Tom,

                I can’t make any sense out of that code either!  I’ll try to clean it up to make it usable.

 

Thanks,

~Roger

 

From: Tom Coleman [mailto:[hidden email]]
Sent: Tuesday, February 09, 2016 8:31 AM
To: [hidden email]
Subject: Re: Editing "disabled" TableView column data

 

 

Re: load and store in the bean objects:  I can't find any example.  It looks to me like cell editor Components load data via JSON.get, but that this binding can be overridden.

 

What would really help right now is some feedback on the DataBindingTest (org.apache.pivot.tests).  I can't make any sense of it.

 

Thanks,

 

Tom

 

 

On Feb 8, 2016, at 10:46 AM, Roger and Beth Whitcomb wrote:



Definitely row/cell editors use data binding to "load" and "store" values into your TableView data objects.  So, the super of your RowEditor will call the "load" method before beginning the edit, and then at the end of the edit will call "store".  It is up to you to implement these methods on your bean objects.

I should be able to give you a better explanation later today -- have some appointments...

Thanks,
~Roger

On 2/7/16 8:20 AM, Tom wrote:

So far I derived a TableViewCellRenderer that can render a cell as "disabled".

The trick then is to process this information in the TableViewRowEditor, which I have done by creating my own. (I found it difficult to extend Pivot's - basically wound it copying it and renaming it.)

My RowEditor can now disable the appropriate CellEditor Component. So far so good.

At the moment I am wrestling with understanding TableView data binding.

It seemed like I was heading down a path of endlessly extending Components.

So far it looks like I can have an "editable" property in a custom TableView cell class (OlympicStanding).

I know I can disable CellEditors. Right now the only unknown is how editor Components will bind to custom objects in cells.

Let me know if I'm making this more complicated than it is.

Thanks

Tom


Sandro Martini [hidden email] wrote:

Hi Tom,
welcome to Pivot and sorry for the delay.

What do you mean by disabled data ?
A row that's not editable ?
I remember a prototype made by a user (but never proposed for a real inclusion in Pivot) to select or render cells in a different way ... do you need something like this ?

Anyway we have some example of table row editing, I can give you more details.

Note that in our sources in svn (both branch 2.0.x and trunk) there is an example subproject with some not so trivial  samples.

On documentation I know that could be improved,  and any help is welcome :-) ...
Note that all our mailing lists are public so you can find many info in some indexing services like Nabble.

Bye,
Sandro

Il 04/Feb/2016 19:21, "Tom Coleman" <[hidden email]> ha scritto:


Here's one condition that I could use some guidance on.

I've basically figured out how to display data ini a TableView as "disabled".  This basically involves examining the data in context and rendering an appropriate style.  So far so good.

But once identified as "disabled", how should I go about disallowing editing of the column?

That ends my question.  Editorial comments follow:

I've been wading through the project and so far have been quite impressed.

Between the web docs, the API docs, tutorials, examples, demos, tests and source code, there is not much that someone with time and patience can't figure out.

Two observations are that many of the examples tend to be very simple and that Google is not much help.

Thanks!

Tom



 

 

Reply | Threaded
Open this post in threaded view
|

Re: Editing "disabled" TableView column data

Tom Coleman
It’s comforting to know that "it’s not me”.  ;-)

I’ll watch the trunk for changes.

Thanks!

Tom


On Feb 9, 2016, at 3:16 PM, Roger Whitcomb <[hidden email]> wrote:

Hi Tom,
                I can’t make any sense out of that code either!  I’ll try to clean it up to make it usable.
 
Thanks,
~Roger
 
From: Tom Coleman [[hidden email]] 
Sent: Tuesday, February 09, 2016 8:31 AM
To: [hidden email]
Subject: Re: Editing "disabled" TableView column data
 
 
Re: load and store in the bean objects:  I can't find any example.  It looks to me like cell editor Components load data via JSON.get, but that this binding can be overridden.
 
What would really help right now is some feedback on the DataBindingTest (org.apache.pivot.tests).  I can't make any sense of it.
 
Thanks,
 
Tom
 
 
On Feb 8, 2016, at 10:46 AM, Roger and Beth Whitcomb wrote:


Definitely row/cell editors use data binding to "load" and "store" values into your TableView data objects.  So, the super of your RowEditor will call the "load" method before beginning the edit, and then at the end of the edit will call "store".  It is up to you to implement these methods on your bean objects.

I should be able to give you a better explanation later today -- have some appointments...

Thanks,
~Roger

On 2/7/16 8:20 AM, Tom wrote:

So far I derived a TableViewCellRenderer that can render a cell as "disabled".

The trick then is to process this information in the TableViewRowEditor, which I have done by creating my own. (I found it difficult to extend Pivot's - basically wound it copying it and renaming it.)

My RowEditor can now disable the appropriate CellEditor Component. So far so good.

At the moment I am wrestling with understanding TableView data binding. 

It seemed like I was heading down a path of endlessly extending Components. 

So far it looks like I can have an "editable" property in a custom TableView cell class (OlympicStanding).

I know I can disable CellEditors. Right now the only unknown is how editor Components will bind to custom objects in cells.

Let me know if I'm making this more complicated than it is.

Thanks

Tom


Sandro Martini [hidden email] wrote:

Hi Tom,
welcome to Pivot and sorry for the delay.

What do you mean by disabled data ?
A row that's not editable ?
I remember a prototype made by a user (but never proposed for a real inclusion in Pivot) to select or render cells in a different way ... do you need something like this ?

Anyway we have some example of table row editing, I can give you more details.

Note that in our sources in svn (both branch 2.0.x and trunk) there is an example subproject with some not so trivial  samples.

On documentation I know that could be improved,  and any help is welcome :-) ...
Note that all our mailing lists are public so you can find many info in some indexing services like Nabble.

Bye,
Sandro 

Il 04/Feb/2016 19:21, "Tom Coleman" <[hidden email]> ha scritto:


Here's one condition that I could use some guidance on.

I've basically figured out how to display data ini a TableView as "disabled".  This basically involves examining the data in context and rendering an appropriate style.  So far so good.

But once identified as "disabled", how should I go about disallowing editing of the column?

That ends my question.  Editorial comments follow:

I've been wading through the project and so far have been quite impressed.

Between the web docs, the API docs, tutorials, examples, demos, tests and source code, there is not much that someone with time and patience can't figure out.

Two observations are that many of the examples tend to be very simple and that Google is not much help.

Thanks!

Tom


Reply | Threaded
Open this post in threaded view
|

RE: Editing "disabled" TableView column data

Roger Whitcomb-2
In reply to this post by Tom Coleman

The canonical example of how data binding is *supposed* to work would be to look into Spinner.java, in the “load” and “store” methods.  There is a several step process there involving not only the data bindings (there can be several), but also the JSON.get() and JSON.put() methods.  Sorry I wasn’t more clear in my earlier post. 

 

So, you wouldn’t write the “load” or “store” methods – those are already implemented in each of the Pivot components.  Someone in your GUI code would have to call them during the course of loading and saving your form(s) (on the topmost container objects of the form).  Your code would just have to implement the bean properties, and/or the bind mappings (if necessary).  So, normally your code wouldn’t have to write the “JSON.get()” or “JSON.put()” calls either – that is one of the things that is confusing in the data binding example.

 

Yes, look for checkins in “trunk”.  Although I’ll cross to the 2.0.x branch once I get it sorted as well.

 

~Roger

 

From: Tom Coleman [mailto:[hidden email]]
Sent: Tuesday, February 09, 2016 8:31 AM
To: [hidden email]
Subject: Re: Editing "disabled" TableView column data

 

 

Re: load and store in the bean objects:  I can't find any example.  It looks to me like cell editor Components load data via JSON.get, but that this binding can be overridden.

 

What would really help right now is some feedback on the DataBindingTest (org.apache.pivot.tests).  I can't make any sense of it.

 

Thanks,

 

Tom

 

 

On Feb 8, 2016, at 10:46 AM, Roger and Beth Whitcomb wrote:



Definitely row/cell editors use data binding to "load" and "store" values into your TableView data objects.  So, the super of your RowEditor will call the "load" method before beginning the edit, and then at the end of the edit will call "store".  It is up to you to implement these methods on your bean objects.

I should be able to give you a better explanation later today -- have some appointments...

Thanks,
~Roger

On 2/7/16 8:20 AM, Tom wrote:

So far I derived a TableViewCellRenderer that can render a cell as "disabled".

The trick then is to process this information in the TableViewRowEditor, which I have done by creating my own. (I found it difficult to extend Pivot's - basically wound it copying it and renaming it.)

My RowEditor can now disable the appropriate CellEditor Component. So far so good.

At the moment I am wrestling with understanding TableView data binding.

It seemed like I was heading down a path of endlessly extending Components.

So far it looks like I can have an "editable" property in a custom TableView cell class (OlympicStanding).

I know I can disable CellEditors. Right now the only unknown is how editor Components will bind to custom objects in cells.

Let me know if I'm making this more complicated than it is.

Thanks

Tom


Sandro Martini [hidden email] wrote:

Hi Tom,
welcome to Pivot and sorry for the delay.

What do you mean by disabled data ?
A row that's not editable ?
I remember a prototype made by a user (but never proposed for a real inclusion in Pivot) to select or render cells in a different way ... do you need something like this ?

Anyway we have some example of table row editing, I can give you more details.

Note that in our sources in svn (both branch 2.0.x and trunk) there is an example subproject with some not so trivial  samples.

On documentation I know that could be improved,  and any help is welcome :-) ...
Note that all our mailing lists are public so you can find many info in some indexing services like Nabble.

Bye,
Sandro

Il 04/Feb/2016 19:21, "Tom Coleman" <[hidden email]> ha scritto:


Here's one condition that I could use some guidance on.

I've basically figured out how to display data ini a TableView as "disabled".  This basically involves examining the data in context and rendering an appropriate style.  So far so good.

But once identified as "disabled", how should I go about disallowing editing of the column?

That ends my question.  Editorial comments follow:

I've been wading through the project and so far have been quite impressed.

Between the web docs, the API docs, tutorials, examples, demos, tests and source code, there is not much that someone with time and patience can't figure out.

Two observations are that many of the examples tend to be very simple and that Google is not much help.

Thanks!

Tom



 

 

Reply | Threaded
Open this post in threaded view
|

RE: Editing "disabled" TableView column data

Roger Whitcomb-2
In reply to this post by Tom Coleman

Okay, I have fixed this test program, and added explanatory stuff to the GUI:

Sending        tests\src\org\apache\pivot\tests\DataBindingTest.java

Sending        tests\src\org\apache\pivot\tests\data_binding_test.bxml

Transmitting file data ..

Committed revision 1729480.

 

HTH,

~Roger

 

From: Tom Coleman [mailto:[hidden email]]
Sent: Tuesday, February 09, 2016 12:21 PM
To: [hidden email]
Subject: Re: Editing "disabled" TableView column data

 

It’s comforting to know that "it’s not me”.  ;-)

 

I’ll watch the trunk for changes.

 

Thanks!

 

Tom

 

 

On Feb 9, 2016, at 3:16 PM, Roger Whitcomb <[hidden email]> wrote:

 

Hi Tom,

                I can’t make any sense out of that code either!  I’ll try to clean it up to make it usable.

 

Thanks,

~Roger

 

From: Tom Coleman [[hidden email]] 
Sent: Tuesday, February 09, 2016 8:31 AM
To: [hidden email]
Subject: Re: Editing "disabled" TableView column data

 

 

Re: load and store in the bean objects:  I can't find any example.  It looks to me like cell editor Components load data via JSON.get, but that this binding can be overridden.

 

What would really help right now is some feedback on the DataBindingTest (org.apache.pivot.tests).  I can't make any sense of it.

 

Thanks,

 

Tom

 

 

On Feb 8, 2016, at 10:46 AM, Roger and Beth Whitcomb wrote:




Definitely row/cell editors use data binding to "load" and "store" values into your TableView data objects.  So, the super of your RowEditor will call the "load" method before beginning the edit, and then at the end of the edit will call "store".  It is up to you to implement these methods on your bean objects.

I should be able to give you a better explanation later today -- have some appointments...

Thanks,
~Roger

On 2/7/16 8:20 AM, Tom wrote:

So far I derived a TableViewCellRenderer that can render a cell as "disabled".

The trick then is to process this information in the TableViewRowEditor, which I have done by creating my own. (I found it difficult to extend Pivot's - basically wound it copying it and renaming it.)

My RowEditor can now disable the appropriate CellEditor Component. So far so good.

At the moment I am wrestling with understanding TableView data binding. 

It seemed like I was heading down a path of endlessly extending Components. 

So far it looks like I can have an "editable" property in a custom TableView cell class (OlympicStanding).

I know I can disable CellEditors. Right now the only unknown is how editor Components will bind to custom objects in cells.

Let me know if I'm making this more complicated than it is.

Thanks

Tom


Sandro Martini [hidden email] wrote:

Hi Tom,
welcome to Pivot and sorry for the delay.

What do you mean by disabled data ?
A row that's not editable ?
I remember a prototype made by a user (but never proposed for a real inclusion in Pivot) to select or render cells in a different way ... do you need something like this ?

Anyway we have some example of table row editing, I can give you more details.

Note that in our sources in svn (both branch 2.0.x and trunk) there is an example subproject with some not so trivial  samples.

On documentation I know that could be improved,  and any help is welcome :-) ...
Note that all our mailing lists are public so you can find many info in some indexing services like Nabble.

Bye,
Sandro 

Il 04/Feb/2016 19:21, "Tom Coleman" <[hidden email]> ha scritto:


Here's one condition that I could use some guidance on.

I've basically figured out how to display data ini a TableView as "disabled".  This basically involves examining the data in context and rendering an appropriate style.  So far so good.

But once identified as "disabled", how should I go about disallowing editing of the column?

That ends my question.  Editorial comments follow:

I've been wading through the project and so far have been quite impressed.

Between the web docs, the API docs, tutorials, examples, demos, tests and source code, there is not much that someone with time and patience can't figure out.

Two observations are that many of the examples tend to be very simple and that Google is not much help.

Thanks!

Tom

 

Reply | Threaded
Open this post in threaded view
|

Re: Editing "disabled" TableView column data

Tom Coleman
<base href="x-msg://63/">Perfect.

Thank you!

On Feb 9, 2016, at 5:07 PM, Roger Whitcomb wrote:

Okay, I have fixed this test program, and added explanatory stuff to the GUI:
Sending        tests\src\org\apache\pivot\tests\DataBindingTest.java
Sending        tests\src\org\apache\pivot\tests\data_binding_test.bxml
Transmitting file data ..
Committed revision 1729480.
 
HTH,
~Roger
 
From: Tom Coleman [mailto:[hidden email]] 
Sent: Tuesday, February 09, 2016 12:21 PM
To: [hidden email]
Subject: Re: Editing "disabled" TableView column data
 
It’s comforting to know that "it’s not me”.  ;-)
 
I’ll watch the trunk for changes.
 
Thanks!
 
Tom
 
 
On Feb 9, 2016, at 3:16 PM, Roger Whitcomb <[hidden email]> wrote:
 
Hi Tom,
                I can’t make any sense out of that code either!  I’ll try to clean it up to make it usable.
 
Thanks,
~Roger

Reply | Threaded
Open this post in threaded view
|

RE: Editing "disabled" TableView column data

Roger Whitcomb-2
In reply to this post by Tom Coleman

One more change:  implement the “Store” operation as a new button in the GUI, and then update the display of the selected item bindings after each store operation.

Sending        tests\src\org\apache\pivot\tests\DataBindingTest.java

Sending        tests\src\org\apache\pivot\tests\data_binding_test.bxml

Transmitting file data ..

Committed revision 1729493.

 

~Roger

 

From: Roger Whitcomb
Sent: Tuesday, February 09, 2016 2:08 PM
To: [hidden email]
Subject: RE: Editing "disabled" TableView column data

 

Okay, I have fixed this test program, and added explanatory stuff to the GUI:

Sending        tests\src\org\apache\pivot\tests\DataBindingTest.java

Sending        tests\src\org\apache\pivot\tests\data_binding_test.bxml

Transmitting file data ..

Committed revision 1729480.

 

HTH,

~Roger

 

From: Tom Coleman [[hidden email]]
Sent: Tuesday, February 09, 2016 12:21 PM
To: [hidden email]
Subject: Re: Editing "disabled" TableView column data

 

It’s comforting to know that "it’s not me”.  ;-)

 

I’ll watch the trunk for changes.

 

Thanks!

 

Tom

 

 

On Feb 9, 2016, at 3:16 PM, Roger Whitcomb <[hidden email]> wrote:

 

Hi Tom,

                I can’t make any sense out of that code either!  I’ll try to clean it up to make it usable.

 

Thanks,

~Roger

 

From: Tom Coleman [[hidden email]] 
Sent: Tuesday, February 09, 2016 8:31 AM
To: [hidden email]
Subject: Re: Editing "disabled" TableView column data

 

 

Re: load and store in the bean objects:  I can't find any example.  It looks to me like cell editor Components load data via JSON.get, but that this binding can be overridden.

 

What would really help right now is some feedback on the DataBindingTest (org.apache.pivot.tests).  I can't make any sense of it.

 

Thanks,

 

Tom

 

 

On Feb 8, 2016, at 10:46 AM, Roger and Beth Whitcomb wrote:



Definitely row/cell editors use data binding to "load" and "store" values into your TableView data objects.  So, the super of your RowEditor will call the "load" method before beginning the edit, and then at the end of the edit will call "store".  It is up to you to implement these methods on your bean objects.

I should be able to give you a better explanation later today -- have some appointments...

Thanks,
~Roger

On 2/7/16 8:20 AM, Tom wrote:

So far I derived a TableViewCellRenderer that can render a cell as "disabled".

The trick then is to process this information in the TableViewRowEditor, which I have done by creating my own. (I found it difficult to extend Pivot's - basically wound it copying it and renaming it.)

My RowEditor can now disable the appropriate CellEditor Component. So far so good.

At the moment I am wrestling with understanding TableView data binding. 

It seemed like I was heading down a path of endlessly extending Components. 

So far it looks like I can have an "editable" property in a custom TableView cell class (OlympicStanding).

I know I can disable CellEditors. Right now the only unknown is how editor Components will bind to custom objects in cells.

Let me know if I'm making this more complicated than it is.

Thanks

Tom


Sandro Martini [hidden email] wrote:

Hi Tom,
welcome to Pivot and sorry for the delay.

What do you mean by disabled data ?
A row that's not editable ?
I remember a prototype made by a user (but never proposed for a real inclusion in Pivot) to select or render cells in a different way ... do you need something like this ?

Anyway we have some example of table row editing, I can give you more details.

Note that in our sources in svn (both branch 2.0.x and trunk) there is an example subproject with some not so trivial  samples.

On documentation I know that could be improved,  and any help is welcome :-) ...
Note that all our mailing lists are public so you can find many info in some indexing services like Nabble.

Bye,
Sandro 

Il 04/Feb/2016 19:21, "Tom Coleman" <[hidden email]> ha scritto:


Here's one condition that I could use some guidance on.

I've basically figured out how to display data ini a TableView as "disabled".  This basically involves examining the data in context and rendering an appropriate style.  So far so good.

But once identified as "disabled", how should I go about disallowing editing of the column?

That ends my question.  Editorial comments follow:

I've been wading through the project and so far have been quite impressed.

Between the web docs, the API docs, tutorials, examples, demos, tests and source code, there is not much that someone with time and patience can't figure out.

Two observations are that many of the examples tend to be very simple and that Google is not much help.

Thanks!

Tom

 

Reply | Threaded
Open this post in threaded view
|

RE: Editing "disabled" TableView column data

Roger Whitcomb-2
In reply to this post by Tom Coleman

Yes, the row editors can be messy to setup.  Every time I’ve done it, there is a ton of code.  Likely a chance for some new features for version 2.1 ;)

 

Would it help if I dig up some examples?

 

One thing I can think of about read-only columns is to just render a Label there, or you could put in a TextInput with “readonly” set to true.

 

It’s also important to call the “super.beginEdit()” inside your own “beginEdit” method because the super does the “load” from the current data object into your row editor components, and conversely to call the super method from your “endEdit” method also (to do the “store” back into the data object).

 

One trick I’ve been using in other areas, if you have a fixed set of data types that need to be edited, is just to create a small BXML file with just the row editor in it.  That way your Java code is reduced considerably from just instantiating and setting up each of the components directly in code.  Of course, if you have completely dynamic data, then that won’t work…

 

Let us know how it’s going.

~Roger

 

From: Tom [mailto:[hidden email]]
Sent: Sunday, February 07, 2016 8:21 AM
To: [hidden email]
Subject: Re: Editing "disabled" TableView column data

 

So far I derived a TableViewCellRenderer that can render a cell as "disabled".

The trick then is to process this information in the TableViewRowEditor, which I have done by creating my own. (I found it difficult to extend Pivot's - basically wound it copying it and renaming it.)

My RowEditor can now disable the appropriate CellEditor Component. So far so good.

At the moment I am wrestling with understanding TableView data binding.

It seemed like I was heading down a path of endlessly extending Components.

So far it looks like I can have an "editable" property in a custom TableView cell class (OlympicStanding).

I know I can disable CellEditors. Right now the only unknown is how editor Components will bind to custom objects in cells.

Let me know if I'm making this more complicated than it is.

Thanks

Tom


Sandro Martini <[hidden email]> wrote:

Hi Tom,
welcome to Pivot and sorry for the delay.

What do you mean by disabled data ?
A row that's not editable ?
I remember a prototype made by a user (but never proposed for a real inclusion in Pivot) to select or render cells in a different way ... do you need something like this ?

Anyway we have some example of table row editing, I can give you more details.

Note that in our sources in svn (both branch 2.0.x and trunk) there is an example subproject with some not so trivial  samples.

On documentation I know that could be improved,  and any help is welcome :-) ...
Note that all our mailing lists are public so you can find many info in some indexing services like Nabble.

Bye,
Sandro

Il 04/Feb/2016 19:21, "Tom Coleman" <[hidden email]> ha scritto:


Here's one condition that I could use some guidance on.

I've basically figured out how to display data ini a TableView as "disabled".  This basically involves examining the data in context and rendering an appropriate style.  So far so good.

But once identified as "disabled", how should I go about disallowing editing of the column?

That ends my question.  Editorial comments follow:

I've been wading through the project and so far have been quite impressed.

Between the web docs, the API docs, tutorials, examples, demos, tests and source code, there is not much that someone with time and patience can't figure out.

Two observations are that many of the examples tend to be very simple and that Google is not much help.

Thanks!

Tom



Reply | Threaded
Open this post in threaded view
|

MVC application

Tom Coleman
In reply to this post by Tom Coleman

Can someone please share some thoughts on an MVC approach to this application using Pivot?

The question arises from trying to figure out how best to rewrite data changed by a TableViewRowEditor.

Data underlying the model is a sequence of bytes, the position and length of which can represent different data types.   These can be parsed and converted to TableData objects (the model?) which can be rendered and edited as Pivot ListButtons, TextInputs, and Checkboxes.  
The parse is expensive and the position and length data can be stored in the TableData cell to facilitate the rewrite.

I can probably rewrite the data as part of the "store" process in the RowEditor, but can someone suggest a more detached MVC approach?

Thanks



 





 

Reply | Threaded
Open this post in threaded view
|

Re: MVC application

Roger and Beth Whitcomb
Hey Tom,
     I'm not sure what you mean by a "detached MVC approach".  IMO the
"store" method of RowEditor is the canonical place to do the update --
this is what is meant to happen there.
     Can you do the parse beforehand and store some intermediate
representation?  That would be my first thought, without knowing more
about the whole process.

Thanks,
~Roger

On 4/14/16 9:53 AM, Tom Coleman wrote:

> Can someone please share some thoughts on an MVC approach to this application using Pivot?
>
> The question arises from trying to figure out how best to rewrite data changed by a TableViewRowEditor.
>
> Data underlying the model is a sequence of bytes, the position and length of which can represent different data types.   These can be parsed and converted to TableData objects (the model?) which can be rendered and edited as Pivot ListButtons, TextInputs, and Checkboxes.
> The parse is expensive and the position and length data can be stored in the TableData cell to facilitate the rewrite.
>
> I can probably rewrite the data as part of the "store" process in the RowEditor, but can someone suggest a more detached MVC approach?
>
> Thanks
>
>
>
>    
>
>
>
>
>
>  
>
>
>

Reply | Threaded
Open this post in threaded view
|

Re: MVC application

Tom Coleman
Hi Roger

Thanks for the quick reply.  Sorry for my delayed response.

I am trying to get a handle on implementing an MVC application using Pivot.   At this point I am seeing Pivot as the MVC “View", and am searching for hooks that can relate the data contained in the model to the Pivot “View”.

  • View – The view renders the contents of a model. It specifies exactly how the model data should be presented. If the model data changes, the view must update its presentation as needed. This can be achieved by using a push model, in which the view registers itself with the model for change notifications, or a pull model, in which the view is responsible for calling the model when it needs to retrieve the most current data.

The application is complicated by the fact that model data is interrelated.  In other words, if a column in a row is updated, other columns may have to be updated as well.  These relationships can be encoded in an “intermediate representation” of the model data. 

I’m pretty sure Pivot has everything to do what I need to do.   After long involvement with synchronous systems, I’m just struggling to get a handle on the architecture.

Thanks!

Tom


On Apr 14, 2016, at 1:23 PM, Roger and Beth Whitcomb <[hidden email]> wrote:

Hey Tom,
   I'm not sure what you mean by a "detached MVC approach".  IMO the "store" method of RowEditor is the canonical place to do the update -- this is what is meant to happen there.
   Can you do the parse beforehand and store some intermediate representation?  That would be my first thought, without knowing more about the whole process.

Thanks,
~Roger

On 4/14/16 9:53 AM, Tom Coleman wrote:
Can someone please share some thoughts on an MVC approach to this application using Pivot?

The question arises from trying to figure out how best to rewrite data changed by a TableViewRowEditor.

Data underlying the model is a sequence of bytes, the position and length of which can represent different data types.   These can be parsed and converted to TableData objects (the model?) which can be rendered and edited as Pivot ListButtons, TextInputs, and Checkboxes.
The parse is expensive and the position and length data can be stored in the TableData cell to facilitate the rewrite.

I can probably rewrite the data as part of the "store" process in the RowEditor, but can someone suggest a more detached MVC approach?

Thanks



  




 




Reply | Threaded
Open this post in threaded view
|

RE: MVC application

Roger Whitcomb-2

Hi Tom,

                So, I think the hooks you’re looking for are already in place.  This is the reason that all the Pivot components specify using Pivot Collections classes instead of the default Java Collections.  The difference is that the Pivot Collections implement Listeners for changes in the data.  These listeners call into the Pivot Skin classes when data changes are detected and signal repaints, etc.

                I’m not sure if these would be sufficient to detect updates in one column that would affect the value in another column, though.  I think I’d have to see a bit more code from your application to be sure.

                But I am sure that you should be implementing the “load” and “store” method calls from your row editor(s) so that the data gets properly updated once the edit is finished.  But, I think everything beyond will just “work” then.  And if not, there should be ways around it using the mechanisms that are already in place.

 

HTH,

~Roger

 

From: Tom Coleman [mailto:[hidden email]]
Sent: Wednesday, April 20, 2016 11:10 AM
To: [hidden email]
Subject: Re: MVC application

 

Hi Roger

 

Thanks for the quick reply.  Sorry for my delayed response.

 

I am trying to get a handle on implementing an MVC application using Pivot.   At this point I am seeing Pivot as the MVC “View", and am searching for hooks that can relate the data contained in the model to the Pivot “View”.

 

§  View – The view renders the contents of a model. It specifies exactly how the model data should be presented. If the model data changes, the view must update its presentation as needed. This can be achieved by using a push model, in which the view registers itself with the model for change notifications, or a pull model, in which the view is responsible for calling the model when it needs to retrieve the most current data.

 

The application is complicated by the fact that model data is interrelated.  In other words, if a column in a row is updated, other columns may have to be updated as well.  These relationships can be encoded in an “intermediate representation” of the model data. 

 

I’m pretty sure Pivot has everything to do what I need to do.   After long involvement with synchronous systems, I’m just struggling to get a handle on the architecture.

 

Thanks!

 

Tom

 

 

On Apr 14, 2016, at 1:23 PM, Roger and Beth Whitcomb <[hidden email]> wrote:

 

Hey Tom,
   I'm not sure what you mean by a "detached MVC approach".  IMO the "store" method of RowEditor is the canonical place to do the update -- this is what is meant to happen there.
   Can you do the parse beforehand and store some intermediate representation?  That would be my first thought, without knowing more about the whole process.

Thanks,
~Roger

On 4/14/16 9:53 AM, Tom Coleman wrote:

Can someone please share some thoughts on an MVC approach to this application using Pivot?

The question arises from trying to figure out how best to rewrite data changed by a TableViewRowEditor.

Data underlying the model is a sequence of bytes, the position and length of which can represent different data types.   These can be parsed and converted to TableData objects (the model?) which can be rendered and edited as Pivot ListButtons, TextInputs, and Checkboxes.
The parse is expensive and the position and length data can be stored in the TableData cell to facilitate the rewrite.

I can probably rewrite the data as part of the "store" process in the RowEditor, but can someone suggest a more detached MVC approach?

Thanks