Navigation flow when clicking on an item in the list.

5 views
Skip to first unread message

Brian Hayward

unread,
Mar 21, 2013, 12:45:31 AM3/21/13
to mo...@googlegroups.com
I'd like to have a button that launches another screen.
This screen shows a list of items to select from.
When tapping on an item in the list, it issues a screen return;

Example:

list (item in Items.all())
{
   item(){label(item.name, onclick={handleTap(item);})}
}

function handleTap(it: Item)
{
    // do something with item
    screen return;
}

Unfortunately, you can't put screen return; in that spot, so is there another way to accomplish it?

Thanks,
Brian

Brian Hayward

unread,
Mar 21, 2013, 1:12:56 AM3/21/13
to mo...@googlegroups.com
Trying a different route:

group {
  list (item in Items.all())
  {
     item(){label(item.name, onclick={handleTap(item);screen return;})}
  }
}


Doesn't work from within a control: Uncaught ReferenceError: screenCallback is not defined

Going to switch to a screen() rather than a control() to see if the screenCallback error goes away - but this is going to take a little more time.



--
You received this message because you are subscribed to the Google Groups "mobl" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mobl+uns...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Chris Melman

unread,
Mar 21, 2013, 3:43:03 AM3/21/13
to mo...@googlegroups.com
Hi Brian,

Indeed the second example is the way it should work. I'm not sure why this goes wrong. It might have to do with the construct of screen en controls that you are using. Normally it gets the previous state and goes back to this state.

Greetings Chris


Date: Thu, 21 Mar 2013 00:12:56 -0500
Subject: Re: [mobl] Navigation flow when clicking on an item in the list.
From: bhay...@gmail.com
To: mo...@googlegroups.com

Brian Hayward

unread,
Mar 21, 2013, 6:50:33 PM3/21/13
to mo...@googlegroups.com

I confirmed that it works from a screen but not a control.  I will try to isolate it with a smaller program later if its supposed to work.

Regards
Brian

Reply all
Reply to author
Forward
0 new messages