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:t...@soaringclub.org]
Sent: Tuesday, February 09, 2016 8:31 AM
To: user@pivot.apache.org
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 <sandro.mart...@gmail.com><mailto:sandro.mart...@gmail.com> 
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" 
<t...@soaringclub.org<mailto:t...@soaringclub.org>> 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 via email to