on 01-01-2014 1:33 PM
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?
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.
All the best
Regards
Yokesvaran Kumarasamy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Is this issue resolved ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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?
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.