- This topic has 0 replies, 1 voice, and was last updated 12 years, 5 months ago by StephenNott.
-
AuthorPosts
-
StephenNottMemberHi
iPhone 4S
I refer to my previous post in Examples – How to , “Display selected list item in text area”, re the above.
My app has ( at least ) 2 “list” screens and a summary screen.
Each “list” screen has 3 list items and i need just one selection from this list to be displayed on the summary screen at any one time.
The code I used ( basically from yr example and detailed in my previous post ) works fine and clears the textArea1 of the selected item when returning
to the list screen(s) when performed in the emulator…… but not when built & downloaded to my 4S, it PERSISTS in showing
2 selections in the textArea1.
I get same result in chrome browser.
I have tried various other methods ( see below for just one of them ).
Can u give a definitive code for achieving what i require.
///////////////////////////
/**
* Notification that the UI is about to transition to a new page.
* Perform custom prepage-transition logic here.
* @param {String} currentPageId
* @param {String} targetPageId
* @returns {boolean} true to continue transtion; false to halt transition
*/
phoneui.prePageTransition = function(currentPageId,targetPageId) {
// add custom pre-transition code here
// return false to terminate transitionif (targetPageId == ‘#m1-summary’) {
summarize();
refresh();
}return true;
}/**
* Notification that the UI has transition to a new page.
*
* @param {String} newPageId
*/
phoneui.postPageTransition = function(newPageId) {}
/**
* Notification that device orientation has changed.
*
* @param {String} newOrientation
*/
phoneui.postOrientationChange = function(newOrientation) {}
/**
* Called when document is loaded.
*/
phoneui.documentReadyHandler = function() {
}function summarize() {
var summary = “”;//multiple select list: get selected items as array
$(‘select[name=”list1″] :selected’).each(
function(i, selected) {
summary += $(selected).text() + “::” + $(selected).val() + “\n”;
});$(‘#m1-summary-textArea1’).text(summary);
}
// Remove selectionsfunction refresh(){
$(‘.m1-selection-list>li’).each(function(i){
$(this).removeClass(m1Design.css(“selected”));});
phoneui.preprocessDOM();
}
/////////////////////////////////
Thks -
AuthorPosts