Custom List Item Renderer

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

Custom List Item Renderer

ben
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:



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?
Reply | Threaded
Open this post in threaded view
|

Re: Custom List Item Renderer

Roger and Beth Whitcomb
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 <[hidden email]> 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.
>
ben
Reply | Threaded
Open this post in threaded view
|

Re: Custom List Item Renderer

ben
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?
Reply | Threaded
Open this post in threaded view
|

Re: Custom List Item Renderer

Roger and Beth Whitcomb
Yes, that's correct. Let us know if you get stuck with that.

~Roger

On Aug 21, 2013, at 9:59 AM, ben <[hidden email]> 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.
>