Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7891737
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T06:41:38+00:00 2026-06-03T06:41:38+00:00

So, i’ve been working for some time at a phonegap+jqm application. I’ve been testing

  • 0

So, i’ve been working for some time at a phonegap+jqm application. I’ve been testing with my android phone, a blackberry simulator (os7) and a blackberry device (os5). My application just fetches some data from a web service using an ajax call, and uses the data to dynamically create some pages with the only purpose of displaying that data.

What works: Ajax calls are successful and data retrieved is as expected. Also jqm styles are applied correctly (by using the usual triggers “create” and “refresh”). The entire application works well in my android device and in the bb simulator with os7.

What doesn’t work: Dynamically created and appended elements are never shown, instead the old elements (which should have been removed) stay there. This happens only when testing with the bb with os5.

Now, some code. When firing ajax calls, i use a couple of functions to get everything done. This is the standard procedure for each or the pages:

When data is received from the call, the response is passed to a specific handler, which does the job of taking data from the response:

function processListElements(response){
    alert("processListElements Start"); // THIS IS EXECUTED
    $('#anagTableList li[data-role="button"]').remove();

    $(response).find('return').each(function(){
alert("inside responseFind"); // THIS IS NEVER SHOWN            
var myNewLI=getFormattedLI($(this).find('codice').text(),$(this).find('responsabile').text());
        $('#anagTableList').append(myNewLI).listview('refresh');

    });

    $('#tablePage').trigger('create');
    $('#anagTableList').listview('refresh');
            alert("processListElements End"); // THIS IS SHOWN!
}

As you can see, the new item is created with another funcion, which formats the elements correctly:

function getFormattedLI(codice,responsabile){
    var myFormattedLI = '<li data-role="button" data-icon="arrow-r" data-iconpos="right">'+
                            '<p>'+codice+' - '+responsabile+'<\/p>'+
                        '<\/li>';

    return myFormattedLI;
}

Finally, here’s the markup for this page:

<div id='tablePage' data-role="page">

<div data-theme="a" data-role="header">
    <h1 >Commesse Tigre</h1>
</div><!-- /header -->

<ul id='anagTableList' data-filter="true" data-theme="a" data-role="listview" data-inset="true">
    <a href="#" id="advancedSearch" data-theme="c" style="color:#FF8C90;text-decoration:none">advanced search</a>
    <li id='tableHeader' data-role="header">CODICE - RESPONSABILE - ANNO</li>

</ul>



<div data-theme="a" data-role="footer">
    <div class="ui-grid-b">
        <div class="ui-block-a"><a href="#" id="pageLeft" data-role="button" data-icon="arrow-l" data-iconpos="notext" style="margin-top:7px;">Previous page</a></div>
        <div class="ui-block-b" style="text-align:center;margin-top:15px;">Page<p id='currentPage' style="display:inline">1</p> of <p  style="display:inline" id='totalPages'>2</p></div>
        <div class="ui-block-c"><a href="#" id="pageRight" data-role="button" data-icon="arrow-r" data-iconpos="notext" style="float: right;margin-top:7px;">Next page</a></div>
    </div><!-- /footer -->
</div>

So, why aren’t my new list items displayed when i change the page? am I doing something wrong?

Any help is greatly appreciated, I’ve been struggling with this for a while and i can’t find any solution. Also, sorry for the long question 🙂

Edit 1: so long i have tried changing all my jquery functions to pure javascript. Nothing changed (not that i had high hopes on this)

Edit 2: Still struggling with this, and it gets stranger every time. I have been doing some test applications, which work exactly the same way (an ul gets appended new li) and they all work, except for the application with the above posted code, where elements still do not get shown.

Edit 3: I found out that everything inside the response.find function never gets executed, but code doesn’t block, so, placing alerts inside the function are never shown. Edited the code to explain better.

Edit 4: I think it is pretty safe to say that the “find” function is not finding any ‘return’ nodes. the response comes from an axis 2 web service, and each return node is tagged as “ns:return”. This is not a problem for my android and bb7 devices, but apparently it is for my bb5. Changing the find to “ns:return” solves nothing. I’m so tired. Help!

Edit 5 (last): I have not been able to solve the problem, but i did find it. The problem is now reduced to being able to find nodes with namespaces in jquery or javascript. There are many questions in SO addressing this problem, but until now nothing works for me, since jQuery 1.7 has broken all workarounds.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T06:41:40+00:00Added an answer on June 3, 2026 at 6:41 am

    I finally solved this. The each return in the xml response is something like this:

         <ns:return xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ax21:CommessaBase">
            <ax21:codice>CODICE0</ax21:codice> 
            <ax21:responsabile>PERSON0</ax21:responsabile> 
         </ns:return>
    

    So, the above code, where it’s looking for the return, did not find anything. I tried several things, in the end, the function that worked was this:

         function processListElements(response){
    
        $('#anagTableList li[data-role="button"]').remove();
        $('#anagTableList').listview('refresh');
    
        $(response).find('*').filter('ns\\:return').each(function(){
    
            var myNewLI=getFormattedLI($(this).find('*').filter('ax21\\:codice').text(),$(this).find('*').filter('ax21\\:responsabile').text());
            $('#anagTableList').append(myNewLI);
            $('#anagTableList').listview('refresh');
    
        });
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a jquery bug and I've been looking for hours now, I can't
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I'm working with an upstream system that sometimes sends me text destined for HTML/XML
I have some data like this: 1 2 3 4 5 9 2 6
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I want to count how many characters a certain string has in PHP, but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.