facebook

Combobox permanent title : CLOSED

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

    Philip!!!
    Member

    Hi

    Is it possible you guys to add an option to the combo box widget so we can choose the permanent title of the combo box?

    for example, i want to add a combo box to my home screen and name it “menu”, so after i navigate in my app and then return to my home screen it will not display the name of the page i last visit, but its title … “menu”.

    #351674 Reply

    Hi philip,

    I am kind of confused with your question. Does your app navigate to secondary screens depending on selected combobox option? If yes, you can add the code to “reset” your combobox, see this thread: http://www.genuitec.com/support-genuitec/viewtopic.php?f=8&t=3820

    After modifying the snippet you can add it to your phoneui.postPageTransition function in the <project>_custom.js file.

    Let me know if you need further assistance.

    #351677 Reply

    Code_A
    Member

    I think I might be confused. Why is your combobox displaying the last page you visited? Is this the selected value in the combobox?

    If you want a permanent title, then you can place a label above it. If you want to clear the combobox selection then you can handle that programmatically. Is that what you are trying to do?

    #351678 Reply

    Philip!!!
    Member

    Ok

    take a look at the screenshots .

    the first label is menu , because i want my user to know that this is the menu of my app.

    then i want to navigate at page one, so i choose from my combo box
    “PAGE 1” and i navigate at page 1.

    then when i go back to my home screen in the combo box is “PAGE 1”

    but i want it to display “MENU” again.

    i hope i explain it better this time.

    Attachments:
    You must be logged in to view attached files.
    #351680 Reply

    Code_A
    Member

    Try using this code on your page transition back to home (index being the number of the item you want to select):

    $('select[name="combobox1"] option:eq(index)').attr('selected','selected')
    #351682 Reply

    Philip!!!
    Member

    I am not sure i am following you because i am new to this.

    where do i add the code?
    Can i add it in to my project js file?

    ->index being the number of the item you want to select

    I don’t understand that at all .
    What item i want to select?

    Thank you for your time and effort

    #351686 Reply

    Hi philip,

    Can you share the code you are using to navigate between screens? Seeing it will allow us to provide better advice.

    #351693 Reply

    Philip!!!
    Member

    Hi Octavio.

    I am using this code:

    var pageId = $(‘select[name=”combobox1″]’).val();
    phoneui.gotoPage(pageId, ‘FADE’);

    I followed this tutorial to implement:
    https://www.youtube.com/watch?v=U2ujNBpw34A

    as you will notice at the tutorial as well when he returns to his home screen
    the combo box displays the name of the screen he last visit.

    #351705 Reply

    Hi Philip,

    As Code A suggested you can use that snippet in the phoneui.postPageTransition function in the _custom.js file:

    $('select[name="combobox1"] option:eq(0)').attr('selected','selected') //used 0 as index assuming your MENU label is the first one.
    phoneui.preprocessDOM('#screen-name'); //force UI to update
    #351709 Reply

    Philip!!!
    Member

    Hi Octavio

    It doesn’t work , probably i am doing something wrong.
    is this how i am suppose to add the code?:

    phoneui.postPageTransition = function(newScreenId) {
    localStorage.setItem(“lastscreen”,”products”);
    $(‘select[name=”combobox1″] option:eq(0)’).attr(‘selected’,’selected’)
    phoneui.preprocessDOM(‘#screen-name’);
    }

    #351712 Reply

    Hi philip,

    You have to use your screen id:
    @philip wrote:

    option:eq(0)’).attr(‘selected’,’selected’)
    phoneui.preprocessDOM(‘#screen-name‘);
    }

    Example:

    phoneui.preprocessDOM('#m1-home'); 
    
    #351716 Reply

    Philip!!!
    Member

    Hi Octavio

    It worked.

Viewing 12 posts - 1 through 12 (of 12 total)
Reply To: Combobox permanent title : CLOSED

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