cancel
Showing results for 
Search instead for 
Did you mean: 

Require help in Hybrid App Development , SMP2.3

Former Member
0 Kudos

I am pretty new guy in hybrid app development , not much acquainted with all the functions provided to us by Custom.js file that get generated during the generated hybrid functionality.

I am still trying to understand it , and require a little guidance as to how we can achieve to get auto complete feature for a text box , i.e. as soon as a user types he get the list generated below. (as done using ajax snippets). I have that a particular text field  can be linked to an MBO with a particular field, but still unaware how this can be achieved?

Accepted Solutions (1)

Accepted Solutions (1)

former_member186566
Active Participant
0 Kudos

Hi Amit,

Sure we can do this.

First we have to get the data and load it into array variable. Then you can implement the Javascript auto complete method into text field.

step1:

Use the getcurrent Message value collection method to get the data and store it in a array. For example

var message = getCurrentMessageValueCollection(); 

var itemList = message.getData("CountryList");  // CountryList - List view key name in Hybrid app

var items = itemList.getValue();

var noOfItems = items.length; 

var i = 0;

var countryList= new Array();

while (i < noOfItems) {

  var theItems = items[i];

  var fileNameObj=theItems.getData("Country_attribute_Key"); 

// Country_attribute_Key - attribute within the list

  var countryList[i] = fileNameObj.getValue(); 

i = i + 1;

}

Use this method in Custom before navigation forward method. Also you can refer this link Hybrid App Message Data Functions

Step 2;

Implement the auto completion method. i hope you have your own auto complete text field method or you can refer the below link for a sample.

Autocomplete | jQuery UI

All the best

Regards

Yokesvaran Kumarasamy

Answers (3)

Answers (3)

Former Member
0 Kudos

I am not able to work on it same , cornering other developments right and still in progress once i am able to finish it , i will update the same , whether successful or not.

midhun_vp
Active Contributor
0 Kudos

Is this issue resolved ?

Former Member
0 Kudos

Hi,

when using jquey code in my custom.js , and debugging  in chrome i am getting the following error :

$('#TestAutocomplete').children().eq(1).hide();

Uncaught ReferenceError: $ is not defined


in the folder structure , i have

jquery-1.7.1.js    
   jquery.mobile.custom.js     

   jquery/jquery.mobile-1.1.0.js

while when i generated the code in the generated files :

1.Manifest.xml > these are included

2.hybridapp_jQM.html > these are included

3.hybridapp_Custom.html > these are not included by default

But still i am facing the error. what could be reason for it?



former_member186566
Active Participant
0 Kudos

Hi Amit,

It could be common java script issue. when you declaring jquery in header section of html, try to use type of the javascript.

For example

<script type="text/javascript" src="js/jquery/jquery-1.6.4.js"></script>

Try it, this was working in Webapplication, i hope it should work with mobile apps too.

Regards

Yokesvaran Kumarsamy

Former Member
0 Kudos

I think , the jquery lib .js file is alredy being defined in the customApp.html file, so do i need to define explicitly again somewhere or need to import , to make make code written in jquey to get executed

midhun_vp
Active Contributor
0 Kudos

The data-filter='true' functionality available in JQuery mobile helps you to do this. This will work exactly as per your requirement.

Here is an example,

- Midhun VP