Skip to Content

Generic List Picker Form Cell expects Serializable Type

Hi SAP Android Team,

could you answer me why you implemented Serializable instead of Parcelable in the Generic List Picker Form cell as an expected data type?

https://help.sap.com/doc/c2d571df73104f72b9f1b73e06c5609a/Latest/en-US/docs/fioriui/formcells/generic_listpicker_formcell.html

Another Question as well: Why would you make the generated proxy classes from OData Services Parcelable, but not implement the interface Serializable? How can I use generated data models in the generic list picker now without creating a proxy class of a proxy class that implements this interface myself?

Thank you for your thorough answers in advance :)

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Posted on Mar 12 at 03:40 PM

    Hi Eduard,

    Regarding the use of Serializable in the Generic List Picker Form Cell, I assume you are referring to the type used for the "key" in the Form Cell. This was done because we assumed that most developers would want to follow the typical approach of using standard Java classes (e.g., String or Integer) for their keys and didn't want to force them to write wrappers just to convert these to Parcelable. Is there a specific use case you are thinking of where Parcelable keys make more sense?

    I'm a bit confused by the second part of your question; the Generic List Picker Form Cell is focused primarily on the data types of the key (which must be Serializable, for reasons mentioned above) and the Layout of the items displayed in the list (which must be extended from View); processing the data for display in the View is typically done inside the onBindViewHolder method of the application-provided RecyclerView.Adapter where the values are moved from the OData Object into something like an Object Cell. I'd encourage you (once the SDK has been successfully downloaded, of course - I saw and responded to your other question) to use the Wizard to generate an application and then take a look at the "populateObjectCell" code that is generated to see if that provides any clarity.

    Regards,

    Mark

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Mar 13 at 08:40 AM

    Hi Mark,

    thank you for your answer. Yes, I were referring to key in the Form Cell. I was just curious after I read up the difference between those two implementation methods on a post on stackoverflow: https://stackoverflow.com/questions/3323074/android-difference-between-parcelable-and-serializable

    I will take a look at the "populateObjectCell". Thank you for the tip :)

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.