certainly - things have changed a little, though. the ListVO has
been refactored as a class (List.as) instead of a value object - I
moved an array of value objects, ListMembershipVO, into that class
because I needed to call some functions to update that array.
still experiencing the same problem, though - what seems even
more weird is that I'm using the exact same functionality to INSERT a
new List into the database and that works fine. below is the
relevant code - thanks so much for the help!
List.as
===================================
import org.nevis.cairngorm.vo.ValueObject;
import vo.ListMembershipVO;
class business.List
{
public function List()
{
listMembers = new Array();
}
public function addListMembership( theMembership :
ListMembershipVO ) : Void
{
listMembers.addItem( theMembership );
}
public function removeListMember( theMembership :
ListMembershipVO ) : Boolean
{
}
public var DLAlias : String;
public var DLName : String;
public var Desc : String;
public var DLType : String;
public var MembershipType : String;
public var OwnerAlias : String;
public var ParentAlias : String;
public var UpdateDLActions : Boolean;
public var EditorAlias : String;
public var editFieldsEnabled : Boolean;
public var listMembers : Array;
}
-----------------------------------
ListMembershipVO.as
===================================
import org.nevis.cairngorm.vo.ValueObject;
class vo.ListMembershipVO implements ValueObject
{
public static var registered:Boolean = Object.registerClass
( "vo.ListMembershipVO", ListMembershipVO );
public var sAMAccountName : String;
public var DLAlias : String;
public var MembershipType : String;
public var MemberType : String;
public var cn : String;
public var adspath : String;
public var imagePath : String;
public var UpdateDLActions : Number=0;
}
-----------------------------------
ViewHelper.as
===================================
function updateDL():Void
{
ModelLocator.selectedList.DLAlias =
ModelLocator.selectedList.DLAlias;
ModelLocator.selectedList.listMembers =
ModelLocator.selectedList.listMembers;
ModelLocator.selectedList.OwnerAlias
= "DistListAdmin";
ModelLocator.selectedList.EditorAlias = "System";
var dlToUpdate:List = new List();
dlToUpdate = ModelLocator.selectedList;
EventBroadcaster.getInstance().broadcastEvent(
DLController.EVENT_COMMIT_UPDATED_LIST, {dlToUpdate:dlToUpdate} );
closeForm();
}
//this is the code that follows the exact same methodology and works
fine without setting the ModelLocator.selectedList.DLAlias to itself
function insertDL():Void
{
var theDLAlias:String=stringUtilities.Replace
(stringUtilities.Replace(view.DLName.text," ",""),"\\","");
var dlToInsert:List = new List();
dlToInsert = ModelLocator.selectedList;
EventBroadcaster.getInstance().broadcastEvent(
DLController.EVENT_COMMIT_NEW_LIST, {dlToInsert:dlToInsert} );
closeForm();
}
-----------------------------------
--- In [email protected], "Daniel Harfleet" <[EMAIL PROTECTED]>
wrote:
> can we see the source of you ListVO.as please ?
>
>
> --- In [email protected], "a8i364io" <[EMAIL PROTECTED]> wrote:
> > OK I think this is really weird. I've been making good progress
in
> > Cairngorm'ing an app I built but I've run across a problem. I've
got
> > this thingy that updates a database using a CFC that accepts a
> > structure as its only argument. When I don't explicitly define
each
> > of the attributes of the VO that I'm passing, they get lost
somewhere
> > in the send between Flex and CF - I get this message back from
the
> > CFC:
> >
> > "Element ATTRIBUTE_NAME is undefined in STRUCTURE_NAME"
> >
> > I know that attribute is being passed all the way through the
> > Cairngorm architure because I can trace it until just before the
CFC
> > call.
> >
> > here's the relevant code:
> >
> > ViewHelper.as
> > (if I uncomment that one line of code where I'm just setting the
> > attribute equal to itself the whole thing works like a charm!)
> > ============================
> >
> > function updateDL():Void
> > {
> > var eventObj = new Object();
> > eventObj.dlToUpdate = new ListVO();
> > eventObj.dlToUpdate = ModelLocator.selectedList;
> > //eventObj.dlToUpdate.DLAlias =
> > eventObj.dlToUpdate.DLAlias;
> > eventObj.dlToUpdate.OwnerAlias = "DistListAdmin";
> > eventObj.dlToUpdate.EditorAlias = "System";
> > EventBroadcaster.getInstance().broadcastEvent(
> > DLController.EVENT_CONCRETE_COMMAND, eventObj );
> > closeForm();
> > }
> > ----------------------------
> >
> > ConcreteCommand.as
> > ============================
> >
> > public function execute( event : Event ):Void
> > {
> > var delegate : ListDelegate = new ListDelegate(
> > this );
> > delegate.updateDL(event);
> > }
> >
> > ----------------------------
> >
> > ListDelegate.as
> > (the below alert shows the correct value whether the line
> > of code in the ViewHelper.as file is commented-out or not)
> > ============================
> >
> > public function updateDL(event:Object) : Void
> > {
> > var dlToUpdate:ListVO;
> > dlToUpdate=event.data.dlToUpdate;
> > mx.core.Application.alert(dlToUpdate.DLAlias);
> > var call = service.updateDL({dlToUpdate:dlToUpdate});
> > /...
> > }
> >
> > ----------------------------
> >
> >
> > AppHandler.CFC
> > ============================
> >
> > <cffunction name="updateDL" access="remote" returntype="string"
> > hint="updates distribution list in
> > database and LDAP">
> > <cfargument name="dlToUpdate" type="struct"
> > required="yes" />
> > ----------------------------
> >
> >
> > ANY INSIGHT/HELP MUCH APPRECIATED!
------------------------ Yahoo! Groups Sponsor --------------------~-->
Fair play? Video games influencing politics. Click and talk back!
http://us.click.yahoo.com/T8sf5C/tzNLAA/TtwFAA/nhFolB/TM
--------------------------------------------------------------------~->
--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/