facebook

Dynamically Set List Item Action

💡
Our Forums Have Moved

For help with installation, bugs reports or feature requests, please head over to our new forums.
Genuitec Community on GitHub

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

    Hi,

    I am creating an app based on the Dynamic List Demo(rss). My app will open pdfs from a remote server. I need to be able to dynamically set the list item onclick action (url) to the link from the rss feed instead
    of passing it to the html widget. is this possible?

    function viewMsg() {
    
        var selItem = $(event.srcElement).closest('li[data-listitem-index]');
        var itemId = $(selItem).attr("data-listitem-index");
        var list_items = $(":root").data("msg");
        var item = list_items[itemId];
        
        var title = item["title"];
        var desc = item["desc"];
        var image = item["image"];
        var cont = item["content"];
        
        $("#m1-view_msg-htmDesc").html(cont); (has to be dynamically set here instead of passing it to the HTML widget.)
    
    }

    Many Thanks

    Ben

    #340869

    Any Idea’s?

    #340870

    I have found the following line of code in a .js file

    'action13':function() { phoneui.showURL('http://www.test.com', '_child', {showLocationBar: true, showAddress: true, showNavigationBar: true, });},

    What I need to do is to be able to dynamically set the test.com.au to what ever is required.

    Is this possible?

    #340889

    Hi,

    Assuming that your content var is the url to the pdf file I would do something like this:



    var title = item[“title”];
    var desc = item[“desc”];
    var image = item[“image”];
    var cont = item[“content”];

    $(“#m1-view_msg-hyperLink1 a”).click(function() { phoneui.showURL(content, ‘_child’, {showLocationBar: true, showAddress: true, showNavigationBar: true, });});
    }

    Note that you should add a Hyper Link widget into your view_msg screen.

    Hope this is helpful for you. Let me know how it goes for you.

    #340900

    Thanks for the help….

    I tried your solution but I get an error saying failed at the bottom of the popup screen…..

    I can submit my code if you like.

    #340901

    I would also like to add that I would rather the second screen not open at all…. Just open the pdf ..

    #340921

    Hi,

    >I can submit my code if you like.
    Yes please, also share Mobione version and where you are testing it. Also a screenshot of the error message would be helpful. If you want to keep data in privacy you can send it to support at genuitec dot com use title mobione data from advancedservers

Viewing 7 posts - 1 through 7 (of 7 total)
Reply To: Dynamically Set List Item Action

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