PDA

View Full Version : Card layout + select controls



jonr
6 Jun 2011, 3:55 AM
Hi,

I'd like to know if anyone has experienced the same problem as I am and any posible solution.

I've got a panel defined with layout: 'card'.
I'm switching back and forth between two items using mainPanel.setActiveItem(...).

Item A is a scrollable list. Item B is a panel with seven different docked items, two of these items are select controls.

I can go from A to B, and B to A without problems. But, if I go from A to B, I activate the select control and I select any option (or I cancel it) and then go from B to A again, I will actually get A as the active card but the whole B panel will be visible behind the A, as a background image you may say as it will not interfere with the functionality of the A card.

My impression is that there is some kind of bug that won't let me use select controls in a card layout. Is this true?

Thanks a bunch,
Jon

jmclem
6 Jun 2011, 4:08 AM
Hi,

this may be due to a JS error happening during the switch. Can you do it again and check in the JS console that no error occur?

Jean-Marie.

jonr
6 Jun 2011, 4:47 AM
jmclem, thanks, there are no Javascript errors. At least not while executing in the browser:

While looking for Javascript errors I noticed that I'm not having problems executing the page directly from the browser (on PC or Android phone), only when packaging the Phonegap app and uploading it to the Android phone.

Strange!

Does that mean that this could be a Phonegap bug? How can I debug my code from within Phonegap?

jmclem
6 Jun 2011, 6:51 AM
Hi,

you can begin with having a look at the logcat during execution on the device; it should report JS errors.

If you don't know the logcat yet:

From the command line: /path/to/adb logcat
(see how to get the android platform tools from the SDK)

From Eclipse:
Window - show view - other - android - logcat

If you need more, the JS 'console.log' are reported in the logcat.

HTH,

Jean-Marie.

jonr
6 Jun 2011, 11:08 AM
Thanks for the logcat hint, didn't really know it existed. Anyway, I don't really get any answer to why this is happening. I get a warning though, even though doesn't seem to have anything to do with this error, everytime a do a drag event (even though I'm not "dragging" anything):

06-06 21:04:29.533: WARN/webview(10917): Miss a drag as we are waiting for WebCore's response for touch down.

Furthermore, I noticed that making the A panel not scrollable makes this error disappear. Interesting!

jonr
14 Jun 2011, 5:00 AM
OUCH! I visited phonegap's web and realized they recently released a new version (0.9.5.1). Replacing my version (0.9.4) with this did the trick... PHEW!!! A loooooooooot of hours wasted for nothing.

Well. All good.