Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does ListView support custom components? #464

Open
robinp opened this issue Jun 24, 2022 · 1 comment
Open

Does ListView support custom components? #464

robinp opened this issue Jun 24, 2022 · 1 comment

Comments

@robinp
Copy link

robinp commented Jun 24, 2022

Reading ItemRenderer code, it would try to assign the data source's given field value to the ItemRenderer's corresponding-id-d Component's value field.

So I thought, if my custom component stores its data (a complex object) in a value field, then I could render a list of that custom component.

I define the custom component using the XML + inheriting class pattern hinted by the docs. The root of the template is a hbox, and that's what the component inherits from. But turns out, in HBox's hierarchy there's already a final value field. So this path is not fruitful for me.

Wondering if there's a way to render a list of custom components somehow? Or to get ItemRenderer try to update a component field different than value?

For now I worked it around by just using a vbox in a scrollview as a custom list component, and appending custom components in that vbox. Might even work as a persistent solution (but I like to ask things on the issue tracker, in case someone has the same question in the future).

Thank you!

@ianharrigan
Copy link
Member

Hi, is there any chance you can give an example of what you mean? Its sometimes easier to see code rather than text as an explanation :)

Cheers,
Ian

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants