You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@pivot.apache.org by ben <be...@intel.com> on 2013/08/15 19:36:23 UTC

Custom List Item Renderer

So I've followed the list tutorial on the website:
http://pivot.apache.org/tutorials/lists.html

I've decided to make my own list, using a custom list item (it just has two
fields, a title and a name) and so a corresponding custom renderer to
display the title as a label and the name in a textinput field. 
It works fine, and looks like this:

<http://apache-pivot-users.399431.n3.nabble.com/file/n4022678/listitem.png> 

When I hover over the textinput and try and double click and edit it, like
you normally can with a textinput to edit the input field, nothing happens.
I've made sure it's setEnabled(true) setEditable(true), but still no luck.

Is there something wrong with embedding it inside a list item that turns off
all the editing for the textinput?



--
View this message in context: http://apache-pivot-users.399431.n3.nabble.com/Custom-List-Item-Renderer-tp4022678.html
Sent from the Apache Pivot - Users mailing list archive at Nabble.com.

Re: Custom List Item Renderer

Posted by Roger Whitcomb <Ro...@rbwhitcomb.com>.
Yes, that's correct. Let us know if you get stuck with that. 

~Roger

On Aug 21, 2013, at 9:59 AM, ben <be...@intel.com> wrote:

> Ok. So this was just a dummy run for me to see if it was possible to do
> something similar with the treeview. I wanted to start with a simple
> component. With the tree, I need to embed a treeNode with two parts: a name
> and some data, and I would represent those as label and table view
> components. So I got it working and displaying, but I can't edit anything in
> the tableview. So you're saying I would just need to write a corresponding
> TreeView.NodeEditor child class to include these two components, a label and
> a table view?
> 
> 
> 
> --
> View this message in context: http://apache-pivot-users.399431.n3.nabble.com/Custom-List-Item-Renderer-tp4022678p4022693.html
> Sent from the Apache Pivot - Users mailing list archive at Nabble.com.
> 

Re: Custom List Item Renderer

Posted by ben <be...@intel.com>.
Ok. So this was just a dummy run for me to see if it was possible to do
something similar with the treeview. I wanted to start with a simple
component. With the tree, I need to embed a treeNode with two parts: a name
and some data, and I would represent those as label and table view
components. So I got it working and displaying, but I can't edit anything in
the tableview. So you're saying I would just need to write a corresponding
TreeView.NodeEditor child class to include these two components, a label and
a table view?



--
View this message in context: http://apache-pivot-users.399431.n3.nabble.com/Custom-List-Item-Renderer-tp4022678p4022693.html
Sent from the Apache Pivot - Users mailing list archive at Nabble.com.

Re: Custom List Item Renderer

Posted by Roger Whitcomb <Ro...@rbwhitcomb.com>.
Hi Ben,
   Thanks for using Pivot. Yes, the Renderer interface is just for displaying (rendering) the data. If you want to change values then you need to implement (also) a ListView.ItemEditor (basically you can subclass ListViewItemEditor) and populate it with the same two fields as your renderer.

HTH,
~Roger Whitcomb

Sent from my iPhone

On Aug 15, 2013, at 12:36 PM, ben <be...@intel.com> wrote:

> So I've followed the list tutorial on the website:
> http://pivot.apache.org/tutorials/lists.html
> 
> I've decided to make my own list, using a custom list item (it just has two
> fields, a title and a name) and so a corresponding custom renderer to
> display the title as a label and the name in a textinput field. 
> It works fine, and looks like this:
> 
> <http://apache-pivot-users.399431.n3.nabble.com/file/n4022678/listitem.png> 
> 
> When I hover over the textinput and try and double click and edit it, like
> you normally can with a textinput to edit the input field, nothing happens.
> I've made sure it's setEnabled(true) setEditable(true), but still no luck.
> 
> Is there something wrong with embedding it inside a list item that turns off
> all the editing for the textinput?
> 
> 
> 
> --
> View this message in context: http://apache-pivot-users.399431.n3.nabble.com/Custom-List-Item-Renderer-tp4022678.html
> Sent from the Apache Pivot - Users mailing list archive at Nabble.com.
>