RE: [flexcoders] Re: Need help processing XML into Flex app

2009-04-13 Thread Tracy Spratt
I am speaking about XML namespaces.  If a node is abc:MyNode, then in the
e4 x expression you need to writhe myXML.abc::MyNode;  Or declare and use a
Namespace

 

The single node behavior suggests that you have left the resultFormat at its
default object.  And that is why you are not seeing the namespace issue,
and why you are not able to use e4x expressions.

 

resultFormat=object has a few benefits and many drawbacks.  I advise
against using it.  Look into this choice before you get too far to change.
Google or search the archives.

 

Tracy Spratt,

Lariat Services, development services available

  _  

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of Jim
Sent: Monday, April 13, 2009 7:34 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Need help processing XML into Flex app

 






--- In flexcod...@yahoogro mailto:flexcoders%40yahoogroups.com ups.com,
Tracy Spratt tspr...@... wrote:

 Have you solved the namespace issue? Do you understand what I am asking?
 
I guess I don't. I did add this to my mx:application tag:
xmlns:ws=com.draper.* and had
import com.draper.*;
in my script section, but without those it still runs fine. 

After I sent you the note about looping through the array, I discovered that
Flex is seeing an array only if there are multiple occurrances. If there is
just one role, it treats it as a regular node, so no looping is required. So
my loop became:

roleList = ;
if (item.Roles.length == undefined) {
roleList = item.Roles.RoleName;
}
else {
for (i = 0; i  item.Roles.length; i++) {
roleList = roleList + item.Roles[i].RoleName + \n;
}
}
return roleList;

Oh, and the reason I started looping was to add the line break; when I first
got results back, the values were just strung together like role1 role2
role3. 

Jim





RE: [flexcoders] Re: Need help processing XML into Flex app

2009-04-10 Thread Tracy Spratt
Have you solved the namespace issue?  Do you understand what I am asking?

 

Tracy Spratt,

Lariat Services, development services available

  _  

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of Jim
Sent: Friday, April 10, 2009 8:11 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Need help processing XML into Flex app

 






Tracy,
With the children approach, I get:

Error #1009: Cannot access a property or method of a null object reference.

Could this be due to the fact that there are multiple Roles nodes and not
just one, so that Roles isn't really a parent node except to one specific
child? That is:

Get__CompIntfc__USER_PROFILEResponse 
Name: Jim 
ID : abc
Roles:
Rolename: a
Roles: 
Rolename: b
...

instead of:

Get__CompIntfc__USER_PROFILEResponse 
Name: Jim 
ID : abc
Roles:
Rolename: a
Rolename: b
...

Jim





RE: [flexcoders] Re: Need help processing XML into Flex app

2009-04-10 Thread Tracy Spratt
Ok, but that is cheating.  I do it myself, but just so you know, looping
in XML usually means you gave up trying to figure out the right e4x
expression.

 

Tracy Spratt,

Lariat Services, development services available

  _  

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of Jim
Sent: Friday, April 10, 2009 11:37 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Need help processing XML into Flex app

 






Tracy,
I got it! It turns out that Roles are returned as an array, since the
Roles node repeats. So this did it:

protected function displayRoles (item:Object, column:DataGridColumn):String 
{
roleList = ;
for (i = 0; i  item.Roles.length; i++) {
roleList = roleList + item.Roles[i].RoleName + \n;
}
return roleList;
}

That gave me a variable roleList with each role and a newline like:

User
Portal User
Administrator

Thanks again for your help. 
Jim





RE: [flexcoders] Re: Need help processing XML into Flex app

2009-04-09 Thread Tracy Spratt
Since some of your expressions were working, I assume you have handled the
namespace issues, is that correct?

 

In your post you have Rolename but the node is RoleName.  Expressions are
case sensitive.

 

Another approach would be:

return item.Roles.children()[0].text();

 

Tracy Spratt,

Lariat Services, development services available

  _  

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of Jim
Sent: Thursday, April 09, 2009 9:15 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Need help processing XML into Flex app

 






Tracy,
Thanks for the lead. I'm having trouble getting it to recognize RoleName,
though (there is only one role name per role, by the way).

I did this for UserDescription just to prove the method:

protected function displayName (item:Object, column:DataGridColumn):String 
{
return item.UserDescription;
}
...
 mx:DataGrid...
 mx:DataGridColumn headerText=Name labelFunction=displayName / 

and that worked fine.

But for rolename, I did this (with and without the .text()):

protected function displayRoles (item:Object, column:DataGridColumn):String 
{
return item.Roles.Rolename.text();
}
...
 mx:DataGridColumn headerText=Roles labelFunction=displayRoles /  

and no matter, what I get:
Error: Unknown Property: 'Rolename'.

I'm copying the actual XML here in case you can see something I'm missing. I
changed all the  to a  plus a space and all the / to /  so nothing
should be lost when I submit this. 

Thanks, 
Jim

 SOAP-ENV:Get__CompIntfc__USER_PROFILEResponse
xmlns:SOAP-ENV=http://xmlns.
http://xmlns.oracle.com/Enterprise/Tools/schemas/M405276.V1
oracle.com/Enterprise/Tools/schemas/M405276.V1
 SOAP-ENV:UserIDjgo1216 /SOAP-ENV:UserID
 SOAP-ENV:UserDescriptionJames G. Ogletree /SOAP-ENV:UserDescription
 SOAP-ENV:PrimaryPermissionListHCPPST_JGO1216
/SOAP-ENV:PrimaryPermissionList
 SOAP-ENV:RowSecurityPermissionListHCDPALL
/SOAP-ENV:RowSecurityPermissionList
 SOAP-ENV:Encrypted1 /SOAP-ENV:Encrypted
 SOAP-ENV:SymbolicIDSYSADM1 /SOAP-ENV:SymbolicID
 SOAP-ENV:LanguageCodeENG /SOAP-ENV:LanguageCode
 SOAP-ENV:MultiLanguageEnabled1 /SOAP-ENV:MultiLanguageEnabled
 SOAP-ENV:CurrencyCodeUSD /SOAP-ENV:CurrencyCode
 SOAP-ENV:AccountLocked0 /SOAP-ENV:AccountLocked
 SOAP-ENV:ProcessProfilePermissionListALLPAGES
/SOAP-ENV:ProcessProfilePermissionList
 SOAP-ENV:NavigatorHomePermissionListHCSPNAVHP
/SOAP-ENV:NavigatorHomePermissionList
 SOAP-ENV:FailedLogins0 /SOAP-ENV:FailedLogins
 SOAP-ENV:ExpertEntry0 /SOAP-ENV:ExpertEntry
 SOAP-ENV:Opertype0 /SOAP-ENV:Opertype
 SOAP-ENV:UserIDAlias/ 
 SOAP-ENV:AllowSwitchUser0 /SOAP-ENV:AllowSwitchUser
 SOAP-ENV:WorklistEntriesCount9 /SOAP-ENV:WorklistEntriesCount
 SOAP-ENV:ReassignUserID/ 
 SOAP-ENV:ReassignWorkN /SOAP-ENV:ReassignWork
 SOAP-ENV:WorklistUserN /SOAP-ENV:WorklistUser
 SOAP-ENV:EmailUserN /SOAP-ENV:EmailUser
 SOAP-ENV:AlternateUserID/ 
 SOAP-ENV:SupervisingUserID/ 
 SOAP-ENV:EmailAddresses
 SOAP-ENV:EmailTypeBUS /SOAP-ENV:EmailType
 SOAP-ENV:EmailAddresst...@draper. mailto:tree%40draper.com com
/SOAP-ENV:EmailAddress
 SOAP-ENV:PrimaryEmailY /SOAP-ENV:PrimaryEmail
 /SOAP-ENV:EmailAddresses
 SOAP-ENV:EmailAddresses
 SOAP-ENV:EmailTypeOTH /SOAP-ENV:EmailType
 SOAP-ENV:EmailAddresst...@draper. mailto:tree%40draper.com com
/SOAP-ENV:EmailAddress
 SOAP-ENV:PrimaryEmailN /SOAP-ENV:PrimaryEmail
 /SOAP-ENV:EmailAddresses
 SOAP-ENV:IDTypes
 SOAP-ENV:IDTypeNON /SOAP-ENV:IDType
 SOAP-ENV:Attributes
 SOAP-ENV:Fieldname/ 
 SOAP-ENV:Recname/ 
 SOAP-ENV:AttributeValue/ 
 SOAP-ENV:AttributeName/ 
 /SOAP-ENV:Attributes
 /SOAP-ENV:IDTypes
 SOAP-ENV:Roles
 SOAP-ENV:RoleNameAPP_MSG_ADMINISTRATOR /SOAP-ENV:RoleName
 SOAP-ENV:DynamicN /SOAP-ENV:Dynamic
 /SOAP-ENV:Roles
 SOAP-ENV:Roles
 SOAP-ENV:RoleNameDL_ACCTS_MGR /SOAP-ENV:RoleName
 SOAP-ENV:DynamicN /SOAP-ENV:Dynamic
 /SOAP-ENV:Roles
 SOAP-ENV:Roles
 SOAP-ENV:RoleNameDL_ACCTS_MGR_WF_ALT /SOAP-ENV:RoleName
 SOAP-ENV:DynamicN /SOAP-ENV:Dynamic
 /SOAP-ENV:Roles
 /SOAP-ENV:Get__CompIntfc__USER_PROFILEResponse