3 Replies Latest reply on Feb 12, 2013 2:09 AM by Bhuvana V

    Whats wrong in this code.. pl help.

      Hi,

       

      We need to show a list of options to the user on a sepcific event gets fired..

      for testing purpose i hardcoded the values and created this file in index.html.

      But the problem is i am able to see the title not the menu items.. I dont know whats wrong in this code but pl help me.

      And also for one of the items i need to indicate an icon also depends on the status of the item associated.

       

       

      <html>
          <head>
              <script type="text/javascript" src="../src/asl.js"></script>
              <script type="text/javascript">
                  asl.title('My items');
                  asl.options([
                      {
                          'title': 'Menu Option 1',
                          'callback': function() {/*do something*/
                          }
                      },
                      {
                          'title': 'Menu Option 2',
                          'callback': asl.exit
                      },
                      {
                          'title': 'Menu Option 3',
                          'callback': asl.exit
                      },
                      {
                          'title': 'Menu Option 4',
                          'callback': asl.exit
                      }]);

              </script>
          </head>
          <body>
          <center>
          </center>
      </body>
      </html>

       

      Thank you in advance.

      Bhuvana.

        • Re: Whats wrong in this code.. pl help.
          Robert Galvin

          Try doing the options call inside the asl loaded event. Also, try tapping the right hand corner where the Options graphic should be anyway and let me know if you see the options menu appear. I was noticing that sometimes the graphic's CSS attribute does not get change from display:none to display:block (making it not visible) but the options menu is still really there. Not sure why/when that is happening.

           

          asl.events.subscribe(asl.events.types.loaded, function(){
                                        asl.options([{
                                                                      'title':'Exit',
                                                                      'callback': function(){
                                                                                asl.exit();
                                                                      }
                                                                                }]); 
                              });
          
          1 of 1 people found this helpful
            • Re: Whats wrong in this code.. pl help.

              Dear Robert,

              Thank you for the response.

              Well when i tried with the posted code i was not able to see the options on the top right hand corner.

              I will check and get back to you shortly.

              But my major concern is that i dont have the asl.css files at all ..

              I posted the query for the link to that file or atleast sample code of the MVM-DEMO application which is having the button (which means the css should be there ).

               

              Please help.

               

              BR,

              Bhavana.

              1 of 1 people found this helpful
              • Re: Whats wrong in this code.. pl help.

                Dear Robert,

                 

                I tried and it works. I presume it was supposed to work even with my code also but..

                The other interesting thing i noticed is that the Options menu is not visible once in 10 times..

                Now the other challenge what i have is the Options list..

                 

                <div class="pager">

                <div>

                <div class="pager">

                <ul>

                <li>

                <span>option 1</span>

                </li>

                <li>

                <span>option 1</span>

                </li>

                <li>

                <span>option 1</span>

                </li>

                <li>

                <span>option 1</span>

                </li>

                </ul>

                <div>

                <a class="disabled"></a>

                <span>1/1</span>

                <a></a>

                </div>

                </div>

                </div>

                 

                This is some sample code given in the presentation.. when i tries same kidn of stuff on the device and  verify the UI is coming like a normal html file.

                I guess the asl.css contains the class and other parameters defination but i dont have asl.css file.

                 

                Could you pl help in this regard?

                 

                 

                Bhavana