2

Please have a look at the following code

<article style="left: 640px; visibility: visible;">
 <section>
   <table>
    <tbody><tr><td><center>154 de 500</center></td></tr>
    <tr><td>First Page</td></tr>
   </tbody></table>
 </section>
</article>

This generates the following UI

enter image description here

When I select the "First Page" text, I need that text to change into "You Clicked This". How can I do this? Is there any event handler for click or any other way to do this? I am sorry if this is a simple question, this is the first time I managed to write something that really worked on PlayGround.

I know it is not like PC so you are 100% free to suggest me how to select the text. May with Voice commands, maybe with clicks or whatever, but user need to select it somehow so that text will change.

PeakGen
  • 21,894
  • 86
  • 261
  • 463

1 Answers1

1

Users can't click on the contents of timeline cards. You have to add menu items which will appear when the user taps while looking at your card. When the user selects a menu item, Google will then notify your server (see 'subscriptions' in the docs) and your server can then send a PUT request back to Google to replace the original item.

The glass dev site has a bunch of info on menus and subscriptions. The playground tool is of limited use with these things though so you'll need to work with real Glass hardware. You also need to have your subscription callback running on a server that the Google can reach.. So, not localhost on your dev PC unless you have some kind of proxy setup (I use runscope for that)

Robert Levy
  • 28,747
  • 6
  • 62
  • 94
  • Thanks for the reply. Can playground at lease pop up this menu item? So I can show if on my prototype? – PeakGen Nov 19 '13 at 02:59
  • yes, it will render the menu items beneath the card. i have not had luck getting glass to notify subscribers when menu items are clicked though – Robert Levy Nov 19 '13 at 04:45
  • Great. Thank you a lot! I also have no luck on Glass or Glass API, so you also have the same issue, have a look at this custom API - http://stackoverflow.com/questions/19995299/google-glass-developing-and-testing-using-playground. I guess you are not an Official Glass explorer, if so, how did you host and tested out things that api do? I am doing a prototype thing, so you know, I need "something" that works. Can I please know? – PeakGen Nov 19 '13 at 06:33