Opened 10 years ago

Closed 10 years ago

Last modified 9 years ago

#11077 closed enhancement (fixed)

dojox.mobile: Heading uses late view resolution

Reported by: foobarfighter Owned by: Jared Jurkiewicz
Priority: high Milestone: 1.5
Component: DojoX Mobile Version: 1.5.0b1
Keywords: Cc:
Blocked By: Blocking:

Description

I'm working on a dojox.phonegap module that uses dojox.mobile to render apps in HTML for the iphone (on the net) as well as using phonegap on the iphone (native iphone app).

The code is in a major state of flux right now, but you can see what I have here: http://github.com/foobarfighter/dojox/tree/master/phonegap/

At any rate, here is the enhancement that I would like to see:

Current Behavoir:

When the dojox.mobile.Heading widget renders it does not resolve it's parent view. When buttons are clicked the parent view widget is resolved and performTransition is called on the parent view.

The widget hierarchy looks like this:

dojox.mobile.View

| -- dojox.mobile.Heading (dijit.byNode(this.domNode.parentNode) resolves to the dojox.mobile.View

Desired Behavoir: This presents some challenges for me when trying to create my module. For my module to correctly render in either the browser or phonegap environment, I have provided a mediator object that decides which rendering engine it needs to require (dojox.mobile or PhoneGap?). An example interface looks like this:

<div id="home" dojoType="dojox.mobile.View" selected="true">

<h1 id="heading" dojoType="dojox.phonegap.widgets.Heading">My Heading</h1> <div dojoType="foo.baz.Bar">...</div>

</div>

dojox.phonegap.widgets.Heading calls out to dojox.mobile to render the Heading if the phone is executing in a browser environment.

In this case, I do a little fancy dom trickery in order to get around some issues that I was having with the parser. I create a container node, add a cloned heading node, and replace the original heading markup with the new container node.

At this point everything renders correctly but I have changed the normal widget hierarchy which now looks like this:

dojox.mobile.View

| -- dojox.phonegap.widgets.Heading

| -- dojox.mobile.Heading

Since dijit.byNode(this.domNode.parentNode) no longer resolves to dojox.mobile.View, I get an error reporting that performTransition is not a method on the dojox.phonegap.widgets.Heading object.

If the dojox.mobile.Heading widget resolves its view earlier than the onclick event, then I am able to safely set the view property on dojox.mobile.Heading object post instantiation.

This should be a very minor patch and I can't think of any real use case that this might break. Please keep me posted.

Regards, foobarfighter

Attachments (1)

patch_fix_late_view_resolution.diff (993 bytes) - added by foobarfighter 10 years ago.
patch

Download all attachments as: .zip

Change History (5)

Changed 10 years ago by foobarfighter

patch

comment:1 Changed 10 years ago by Adam Peller

Owner: changed from Adam Peller to Jared Jurkiewicz

comment:2 Changed 10 years ago by Jared Jurkiewicz

Resolution: fixed
Status: newclosed

This should be addressed in [22096].

comment:3 Changed 9 years ago by bill

Component: DojoxDojoX Mobile

comment:4 Changed 9 years ago by bill

Milestone: tbd1.5
Note: See TracTickets for help on using tickets.