Why using select boxes with data-native-menu="false" in chained dialogs generates url hashes that leads to closing the current dialog? - jquery-mobile

I use chained dialog boxes to collect some input data. Every dialog has a select box, a next button and a popup menu that enables the user to jump back to every dialog in the chain before the current one.
On a startpage a button opens the first dialog box. When you select an entry from the select box and go over to the next dialog by clicking the next-button everything works fine. Jumping back to the first dialog by selecting the entry in the popup-menu also works fine. But after clicking again on the next-button to get back to the second dialog, selecting an entry in its select-box leads to closing the dialog and showing the startpage again.
Why is that? I think it has something to do with the ui-state=dialog-URL-adds in the hash (issue 949), issue 1030)
I use data-native-menu="false" in my select boxes. When I use the default data-native-menu="true" everything works fine.
JQ V1.8.2
JQM V1.2.0
Tested in FF, Safari
I also started an issue ticket on the JQM githup page.

The mentioned ticket brought the solution. This behaviour will be fixed in the next release. Here you can test my problem and here you can try the solution that brings the next release.
By the way: In the meantime you can use this piece of code to make the current release work:
$.mobile.pushStateEnabled = false;

Related

JQuery mobile data-native-menu="false" popup and changePage

So this is kind of a weird issue... I'm using JQuery mobile 1.4 and I am getting some unusual behavior. Here's what I have...
On my main page is a selectmenu with the data-native-menu set to false. The selectmenu (which is dynamically set) can sometimes have a lot of elements. When it does, the menu becomes a popup. I have another page that is accessed from a button using
$.mobile.changePage('#lbsPage', {transition:'flip'} );
Here's the strange part. When I go to the lbsPage from the main page, go back, then access the selectmenu (with the popup values), after selecting an option it goes back to the previous page.
Now in case this explanation sucks, here's a link to my site where you can see it for yourself. Here's what you can do... Go to Menu -> Import BeerXML -> Back. Then go to The Fermentables -> Select 'Grain' from the Type menu -> Then open and select anything from the Fermentable menu. You'll notice that it goes back to the Import BeerXML page. What causes this to happen?
So I was able to find the solution to my problem. For some reason that I don't remember, I set the configuration option hashListeningEnabled to false. After removing that option (which defaults to true), my page is reacting as it should.

jQuery Mobile app not not displaying elements correctly

SO...my app has a few issues, but I am DESPERATE to solve this one first. Any thoughts and suggestions are welcomed. Here is the app:
http://pocketfacilitator.com
Here's the issue - (NOTE, Firefox doesn't even allow this issue to fire, so maybe try Chrome or Safari, or a mobile browser):
From the home page, click on Portables > List All Portables. Now, click on any of the PLUS signs on the right (or two or three, doesn't matter). Now, check the "TODAY" page (in the very bottom nav bar). It will display the list of games you clicked on, but the way they are displayed is totally jacked. BUT...if you RELOAD the page (or just click the red CLEAR button), and repeat the process, it looks normal. What have I done wrong?
If you dare: in Firefox, it won't even let me add an activity -- clicking on the "+" button yield NO effect.
I appreciate any help. Cheers!
Try to call refresh() method on your listview after you dynamically add items
$(this).parent().appendTo('#todaylist');
$('#todaylist').listview('refresh');
See Updating lists
If you add items to a listview, you'll need to call the refresh()
method on it to update the styles and create any nested lists that are
added.

Open up a pop-up window, select an item and go back to main window in Rails 3.2

Inside a page called Program edit, there will be a button named Select image and as it is clicked, a Pop-up window will open which shows list of images. After selecting an image from the list and click to the Add button, pop-up will close up and selected pictures ID will be passed to main window. It should be available to use at program's params after closing image list popup.
Here is the scenario I would like to have.
Which way should I follow while doing this?
You need a version of responds_to_parent rails plugin. That can do the trick.
I've learnt that I can do it via JavaScript and AJAX. Similar to this: http://snipplr.com/view/7461/get-selected-value/

jqm 1.1.0 closing dialogs when hashListeningEnabled=false

i've got a page that displays a dialog on an href. am setting hashListeningEnabled=false because if someone refreshes the page, they need to be greeted with the first 'page' again. when the dialog is clicked it comes up fine, clicking the close button however does nothing - it changes the href (via history.back()), but as listening is disabled, it doesn't actually close the dialog.
anyone think of a workaround?
that'd be right - as soon as i post the question on SO, i work it out myself. you simply turn hashListeningEnabled on when the dialog is shown, then you can turn it back off.

JQM back button binds itself to every click event when it isn't targeted

Using jQuery Mobile (jquery.mobile-1.0b3.min.js). If i apply a click event to a form, the back button seems to get the click event binding as well. It does this no matter how specifically targeted to an element the selector is. For example:
Using this to set the back button:
Copy code
<div id="pagename-page" data-role="page" data-add-back-btn="true" data-back-btn-theme="b">
And this in a script file:
Copy code
$('#awards-details-page').live('pagecreate', function(event){
$('#awards-details-page input[name=submit]').bind('vclick', function() {
console.log('I'm going to be hijacked by the back button.');
});
});
Clicking on the back button will produce the message in the console when tested in a browser.
Every time you visit the page with the script, it will add another duplicate binding. Attempts to unbind the click event on the pagehide event worked with the targeted element, but back button's bindings persisted.
Can anyone shed some light on this?
Thank you in advance.
dont use vclick you will ge ghost, they have improved CLICK so just use that
also live is not bind... bind is to an element that exist, live is for all elements that have that shared property, before after and during. you past pages exist so you have a set of binded items now not just one for the page you are on. i would scrap the whole back button element and have your own clickable item, for this you can do your own back code and add attributes like data-backto = "#page1", you can then control better what happens when a back button is clicked, especially as android phones have there own back button too.

Resources