flex-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Cosma Colanicchia <cosma...@gmail.com>
Subject Re: Extending s:Panel to allow multiple content areas (Need help please)
Date Fri, 22 Feb 2013 08:10:01 GMT
To provide an additional group skin part, and to allow declaring its
content in MXML (much like the controlBar area of Panel) you should add a
getter and a setter of type Array, and manage it as the MXML content to be
placed in the skin part (immediately if available, or deferring it in the
partAdded overriden method).

For example, for the header container:


/* skin parts */
 /**
 * The content group that will contain additional
 * content to be placed in the header container.
 */
[SkinPart(required="false")]
public var headerContentGroup:Group;


/* headerContent property */
 /**
 * @private
 * Storage for the headerContent property.
 */
 protected var _headerContent:Array = [];
 /**
 * The MXML content of the header content group.
 */
[ArrayElementType("mx.core.IVisualElement")]
 public function get headerContent():Array {
return _headerContent;
}

/**
 * @private
 */
public function set headerContent(value:Array):void {
 _headerContent= value;
if (headerContentGroup) {
headerContentGroup.mxmlContent = value;
 }
}


/* overriden methods */

/**
 * @inheritDoc
 * Add logic to manage the additional headerContentGroup skin part.
 */
override protected function partAdded(partName:String,
instance:Object):void {
super.partAdded(partName, instance);
 if (instance == headerContentGroup) {
headerContentGroup.mxmlContent = _headerContent;
}
 }






2013/2/21 Lionel Pierre <lionelp@medez.com>

> Thank you Jonathan,
>
> That is pretty much my approach.
> However, some detail is preventing me from getting it working.
>
>
> *
> Lionel A. Pierre*
>
> *Senior Developer
> **Integrated Software Solutions Corp.
> *7450 Griffin Road, Suite 150
> Davie, FL 33314
> *P:* *954.332.4700 x 207
> **F:* *954.332.4705
> **E:* *LionelP@medez.com*
>
> **** HIPAA CONFIDENTIALITY AND PRIVACY NOTICE ***
> **This email message and its contents contain confidential and privileged
> information intended only for the use of the individual(s) or entity named
> above.  Any unauthorized review, use, disclosure or distribution is
> strictly prohibited.  If you have received this message in error, please
> contact the sender by email immediately and destroy all copies of the
> original message.*
>
>
> On Thu, Feb 21, 2013 at 2:19 PM, Jonathan Campos <jonbcampos@gmail.com
> >wrote:
>
> > You actually are probably over thinking the issue.
> >
> > Extend the Panel and then add 3 skinParts, each a Group. Then in your
> skin
> > you layout the 3 added parts. That would be all that you're needing to do
> > unless you are wanting to add additional listeners to the added groups.
> >
> > Let me know if you have more questions.
> >
> > J
> >
> >
> > On Thu, Feb 21, 2013 at 12:12 PM, Lionel Pierre <lionelp@medez.com>
> wrote:
> >
> >> Greetings,
> >>
> >> Below is a picture of what I am trying to achieve (Target.png)
> >>
> >> *[image: Inline image 1]*
> >>
> >> The image is of a panel described (in pseudo MXML) with
> >>
> >> *Panel*
> >>
> >> *                VGroup*
> >>
> >> *                                HGroup*
> >>
> >> *                                                (Header backgound)*
> >>
> >> *                                                (Header content)*
> >>
> >> *                                HGroup*
> >>
> >> *                                                VGroup*
> >>
> >> *                                                                (Left
> >> panel background)*
> >>
> >> *                                                                (Left
> >> panel content)*
> >>
> >> *                                                VGroup*
> >>
> >> *                                                                (Right
> >> panel background)*
> >>
> >> *                                                                (Right
> >> panel content)*
> >>
> >> * *
> >>
> >> I want to create a component (extending s:Panel) that allows a junior
> >> developer to achieve the same result by simply writing (again pseudo
> MXML)
> >>
> >>
> >>
> >> *CustomPanel*
> >>
> >> *                headerContainer*
> >>
> >> *                                (Header content)*
> >>
> >> *                leftContainer*
> >>
> >> *                                (Left panel content)*
> >>
> >> *                rightContainer*
> >>
> >> *                                (Right panel content)*
> >>
> >> * *
> >>
> >> I was looking at a tutorial from
> >> http://saturnboy.com/2010/07/multiple-content-area-containers/ and have
> >> not been successful getting the results I am aiming for.
> >>
> >>  I have subclassed s:Panel  (ThreeTieredPanel.as) and created a custom
> >> skin for it (ThreeTieredPanelSkin). In the subclass I have added three
> new
> >> groups (searchGroup, masterGroup, detailGroup), but cannot get their
> >> content to be displayed. I think if I can get beyond that point (getting
> >> the content to display), then I will be able to format as needed.
> >>
> >> Attached are an image and my exported Flex project.
> >> I am using FB4.7 and Flex SDK 4.9
> >>
> >>
> >> Thank you for any help you can provide.*
> >> *
> >>
> >>
> >
> >
> > --
> > Jonathan Campos
> >
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message