0
votes

My working Environment:

Ecllipse

IBM Worklight 6.1

Processor : intel i3

OS: windows 8 (Enterprise edition)

Code is generated using Phone GAP [HTML5 and Javascript]

Following is my code from my project with error:

My Project code Screen shot

Question:

Above code is working fine with Android and iOS devices so I need to confirm that windows 8 phone does not support “ListView” control? if not then what is alternative solution for this?

1
You're calling . ListView immediately after including the base jQuery library - which does not include the ListView plugin. Fix the order of your script references and make sure the javascript is included before you try to use it.vishal_g
@Mitalkumer, did you try vishal's suggestion?Idan Adar

1 Answers

0
votes

I could not reproduce this error.
I've tested the below in Windows Phone 8 using a Worklight project (with jQuery Mobile 1.4.3); everything is working...

Additionally, see @vishal_g's comment.

HTML

<!DOCTYPE HTML>
<html>
    <head>
        ...
        ...
        <link href="jqueryMobile/jquery.mobile-1.4.3.css" rel="stylesheet">
        <link rel="stylesheet" href="css/main.css">
        <script>window.$ = window.jQuery = WLJQ;</script>
        <script src="jqueryMobile/jquery.mobile-1.4.3.js"></script>
    </head>
    <body style="display: none;">
        <div data-role="page" id="page">
            <div data-role="content" style="padding: 15px">
                <ul data-role="listview" id="list" data-autodividers="true">
                    <li><a href="#">Adele</a></li>
                    <li><a href="#">Agnes</a></li>
                    <li><a href="#">Billy</a></li>
                    <li><a href="#">Calvin</a></li>
                </ul>
            </div>
            <button onclick="emptyList()">empty list</button>

        </div>
        <script src="js/initOptions.js"></script>
        <script src="js/main.js"></script>
        <script src="js/messages.js"></script>
    </body>
</html>

JavaScript

function wlCommonInit(){

}

function emptyList() {
    $("#list").listview().empty();
}