Author Topic: Binding a PagedList control to a ScriptDictionary device property  (Read 1042 times)

John Hughes

  • Administrator
  • Hero Member
  • *****
  • Posts: 2852
    • View Profile
    • Codecore Technologies
I have a prototype of this working. When you call DevicePropertyChangeNotification for the ScriptDictionary, the entire object will be sent to the touch screen so this is an expensive operation (relatively speaking). The Paged List control then updates itself with the new data in the dictionary object.

Each paged list item currently has display text and an underlying key value which could be used to retrieve more information about the selected item. The ScriptDictionary object works well for this since it also contains a key and a value... the value is displayed as text regardless of it's type (string, number) and the dictionary item key is used as the paged list item key.

In looking at this more the simple single line of text that he page list displays is really too simple in some cases. For example if you are showing a list of rss feeds or an email headers it would be nice to show the title in a larger font and then display some supplementary information (such as a date or the initial part of the item description) in a smaller font underneath it. I believe that the control should support both a simple single line of text or 2 lines for a title/sub-title.

To support this I have considered 2 options:
A. Continue to use the ScriptDictionary object but create a new optional value type called ScriptPagedListItem which has properties for the title and sub-title. When this type is used as a scriptdictionary item value it will be rendered as two lines in the paged list.
B. The other option would be to NOT use the ScriptDictionary and create a new container called something like PagedListItems and require the use of the above ScriptPagedListItem type.

I can see benefits of each and I'm not sure I have a strong opinion either way however it would be more development work to change all the new code to use something other than the PagedListItems type.


Does anyone have a preference?
« Last Edit: May 29, 2012, 09:32:28 am by John Hughes »
John Hughes
Codecore Technologies

John Hughes

  • Administrator
  • Hero Member
  • *****
  • Posts: 2852
    • View Profile
    • Codecore Technologies
Re: Binding a PagedList control to a ScriptDictionary device property
« Reply #1 on: May 29, 2012, 09:35:13 am »
After further review I believe I will need to implement a new container type.

The key is actually an IScriptObject which can be any type... not just a string. Since the ScriptDicitionary's key is always a string this will not allow for other types to be used in the paged list.
John Hughes
Codecore Technologies

Mogulbasher

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: Binding a PagedList control to a ScriptDictionary device property
« Reply #2 on: May 30, 2012, 01:02:44 pm »
Cant wait for this as it will greatly help the caller id call list feature that is currently just a \r\n delineated string

John Hughes

  • Administrator
  • Hero Member
  • *****
  • Posts: 2852
    • View Profile
    • Codecore Technologies
Re: Binding a PagedList control to a ScriptDictionary device property
« Reply #3 on: June 04, 2012, 11:03:26 pm »
Here's a little teaser screenshot.

It can also be configured to display contact details when you click on any item.
John Hughes
Codecore Technologies