facebook

buttons misaligned when converted into Andriod apps

  1. MobiOne Archive
  2.  > 
  3. Getting Help – General
Viewing 6 posts - 16 through 21 (of 21 total)
  • Author
    Posts
  • #347804 Reply

    Code_A
    Member

    @jonathannew wrote:

    Hi Code A, I tried to replace with a text label as you suggested but i am not able to display my calculated results to this text label.

    As Michael shows in the example above, make sure you are using the .text() property to set the label text instead of .val().

    #347857 Reply

    jonathannew
    Member

    Dear support Michael, I would like to clarify there was an error in your code and it has to be written exactly as below.

    $('[id$=displayTxt]').text("7")

    My second question is that if I have a page2 (name:page2.mobi) which contains another dynamic text label (name: displayTxt2), I do not need to reference it like the below. I just need to have unique names for each text label in all my mobi pages to control them?

    $('#m1-page2-displayTxt2').text("other");
    #347858 Reply

    Code_A
    Member

    You should be able to reference it either way. Is your code not working? If you are using the id method then you should be using unique names.

    #347862 Reply

    jonathannew
    Member

    Dear Code A, yes, when I copied Michael’s syntax exactly, the code did not work. So I browse through the forum and found some coding related to text labels. It seems to me that double quotation marks and a close bracket are needed. After adding those 2, the code worked. In my learning of M1, I benefited much from the info on this forum and thought to correct this “if it was a mistake” so that others may benefit in the same way I did. But based on your reply, it seems Michael’s coding is correct and should work…

    To confirm the answer to my 2nd question, as long as I use this ID method, I need not reference the mobi filename in the code even if I may have multiple mobi files in 1 app ? I need to clarify further that I am putting this javascript code in the main_custom.js file, meaning pressing the number button in my calculator project will call up a javascript function which ultimately will do some calculations writing results to the text label.

    #347868 Reply

    Code_A
    Member

    1. The text value should have quotations around it as you have indicated.

    2. As long as you use unique names for your widgets the id method will work.

    #347884 Reply

    jonathannew
    Member

    Thanks for the clarifications!

Viewing 6 posts - 16 through 21 (of 21 total)
Reply To: buttons misaligned when converted into Andriod apps

You must be logged in to post in the forum log in