Problem displaying ListView

69 views
Skip to first unread message

zone66x

unread,
Jun 4, 2012, 11:42:54 AM6/4/12
to The-M-Project
Hi all,

I've been trying to get a list view with static list item to display
properly by to no avail. I have 3 list item called List Item 1, List
Item 2 and List Item 3 and when I display the page I this as the
output with no formating:

null
null
List Item 1
null
null
List Item 2
null
null
List Item 3


There must be something I'm missing but after trying to figure it out
for an hour I just don't know.

Here's the code:

http://pastebin.com/W8VhiRNJ


Thanks

hano

unread,
Jun 5, 2012, 5:24:29 AM6/5/12
to The-M-Project
Hi zone,
in your menu template 'views/MainMenuItemView.js' you are using each
menu item as page: 'test2.MainMenuItemView = M.PageView.design({ '
The template is used for each menu item so it should be from the type
'ListItemView' : 'test2.MainMenuItemView = M.ListItemView.design({'

Do you used 'espresso generate -v MainMenuItemView' to generate the
ListItemView?
Probably we should implement another command for generating pages and
other views. A little bit of missleading to generate a view and what
you get is always a page. What is your opinion on that subject. Would
be great to hear your opinion.

greets Marco

zone66x

unread,
Jun 5, 2012, 12:28:22 PM6/5/12
to The-M-Project
Thanks Marco,
Yeah I used espresso to generate the view. I knew it was going to be
something simple (>_<). This is actually quite informative because the
behaviour I was experiencing must means that M.PageView is a singleton
of sorts which makes a lot of sense.

I think adding an optional parameter to the -v option wouldn't be a a
bad idea. The command template would be:

espresso generate -v viewtype viewname

Where viewtype would be the name of the view class you would like to
generate a file for like:

PageView
ListItemView
etc.

If viewtype is omitted then the command would just behave like it does
now which is generating a PageView.

PS.
Coming from just testing out Sencha Touch and jQuery Mobile I found
that neither of them fit the criteria I was looking for. I'm hoping
that the The-M-Project will give similar performance and features as
Sencha Touch along with the broader browser support that jQuery Mobile
offers. So far I like what I see. The documentation and code structure
seems a lot more intuitive than Sencha's. Keep up the good work and
looking forward to the next release with the carousel (^_^)

hano

unread,
Jun 6, 2012, 3:24:50 AM6/6/12
to The-M-Project
Hi again,
thanks for your feedback and you kind words.
I started an feature request for this issue on github.
https://github.com/mwaylabs/Espresso/issues/96
If you have further ideas just let us know.
regards marco

sebastianw

unread,
Apr 1, 2013, 7:18:10 AM4/1/13
to themp...@googlegroups.com
Hi Brad,

yes, this seems to be the bug. Every Object deriving from M.Object has this property. You need to rename the property inside your app.

For our upcoming big release (TMP 2.0) we're rewriting the framework and these properties (private ones) will be prefixed by an "_", to circumvent these issues beside other reasons.

Best regards
Sebastian



Reply all
Reply to author
Forward
0 new messages