- This topic has 5 replies, 2 voices, and was last updated 12 years ago by
support-octavio.
-
AuthorPosts
-
PauldivaniiiMemberI am setting the current “State” (as in California, Alabama) in my combo box to a default value. That is working but when I see the screen in the Test Center it shows me the default set on the form. When I go to set the value the item I set programmatically is actually set but it is not scrolled into position. Is there something I have to set in order to scroll it into position on the list? My initialization code looks like this:
$(‘select[name=”cbOfficerState”] option:contains(“‘ + officerState + ‘”)’).attr(‘selected’, true);
On another note, my customer wants me to set the input format so that they can enter in basically numeric text strings, like height (5’10”) and weight (146 lbs) as well as social security numbers and other fields that are primarily numeric. I can’t use number
And lastly: Is there a way to exit the application. When I press the End App button on the iPhone the phone goes back to the Application list but when I pick the app again it comes up where it was the last time. I would at least like to respond to some kind of lost focus event that would allow me to reset the application to the first page.
Thanks and sorry for the long list.
June 14, 2013 at 6:40 pm #339974
support-octavioMemberHi Paul
Next snipet should be helpful for you.
$(‘select[name=”combobox1″] option[value=”valueX“]’).attr(‘selected’,’selected’)
phoneui.preprocessDOM(‘#m1-<screenName>‘);You need to change the highlighted values.
June 30, 2013 at 4:21 pm #340456
PauldivaniiiMemberThanks for the hint on refreshing the page to make the selected item sync up with the setting.
On my other question: How do you exit/close the application from within the application? I haven’t figured out a way to do that. Or how do you detect when the Home button has been pressed on the phone so I can try a window.close(); call?
Thanks
July 1, 2013 at 1:22 pm #340471
support-octavioMemberHi Paul,
Apple does not believe that an app should programmatically exit. Thus iOS does not include an exit api.
July 1, 2013 at 1:39 pm #340473
PauldivaniiiMemberThanks, now is there an event to respond to in order to determine when your application is the active application so you can reset it? That way I can at least reset the application so it looks like it restarted.
July 2, 2013 at 5:50 pm #340515
support-octavioMemberHi Paul,
Take a look at deviceready and resume: http://docs.phonegap.com/en/2.2.0/cordova_events_events.md.html#Events
-
AuthorPosts