You need to sign in to do that
Don't have an account?
Variable output - list
Hey!
I need your help. My VisualForce includes this code:
<apex:page controller="mytestclass"> <!-- {!people} --> <apex:repeat value="{!people}" var="zav"> {!zav} <br/><br/> </apex:repeat> </apex:page>
This is what it outputs. I get xmlPeopleType more times with different data, which is OK. What I would need is geting out date like xmlStatus, or xmlTitle seperated. How can I do that? If i write {!people.xmlTitle} it doesnt work.
Any help would be apricieted.
xmlPeopleType:[apex_schema_type_info=(http://Partner.com/, true, false), field_order_type_info=(xmlNumber, xmlSubNumber, xmlStatus, xmlTitle, xmlAddress, xmlPeopleFlag, xmlOpFlag, xmlDateReg, xmlDType, xmlLocation, ...), xmlDateReg=null, xmlDateReg_type_info=(xmlDateReg, http://www.w3.org/2001/XMLSchema, dateTime, 1, 1, true), xmlNumber=125214, xmlNumber_type_info=(xmlNumber, http://www.w3.org/2001/XMLSchema, string, 0, 1, false), xmlDType=1525, xmlDType_type_info=(xmlDType, http://www.w3.org/2001/XMLSchema, string, 0, 1, false), xmlSubNumber=124532, xmlSubNumber_type_info=(xmlSubNumber,http://www.w3.org/2001/XMLSchema, string, 0, 1, false), xmlAddress=SOME ADDRESS 12412, xmlAddress_type_info=(xmlAddress, http://www.w3.org/2001/XMLSchema, string, 0, 1, false), xmlTitle=SOME TITLE 2123, xmlTitle_type_info=(xmlTitle, http://www.w3.org/2001/XMLSchema, string, 0, 1, false), xmlOpFlag=false, xmlOpFlag_type_info=(xmlOpFlag, http://www.w3.org/2001/XMLSchema, boolean, 1, 1, false), xmlStatus=70, xmlStatus_type_info=(xmlStatus,http://microsoft.com/wsdl/types/, char, 1, 1, false), xmlAddInfos=(ArrayOfAnyTypeTRR:[MyAnyTypeTRR=xmlAddInfosType:[apex_schema_type_info=(http://Partner.com/, true, false), field_order_type_info=(xmlInfoNum, xmlInfoType, xmlInfoTypeName, xmlInfoDateO, xmlInfoDateL, xmlInfoFlag, xmlInfoDateC), xmlInfoDateO=2009-03-06 00:00:00, xmlInfoDateO_type_info=(xmlInfoDateO, http://www.w3.org/2001/XMLSchema, dateTime, 1, 1, false), xmlInfoDateL=2012-02-22 00:00:00, xmlInfoDateL_type_info=(xmlInfoDateL, http://www.w3.org/2001/XMLSchema, dateTime, 1, 1, false), xmlInfoDateC=2099-12-31 23:59:59, xmlInfoDateC_type_info=(xmlInfoDateC, http://www.w3.org/2001/XMLSchema, dateTime, 1, 1, false), xmlInfoTypeName=SOME TYPE NAME23, xmlInfoTypeName_type_info=(xmlInfoTypeName, http://www.w3.org/2001/XMLSchema, string, 0, 1, false), xmlInfoNum=0214444-124124214, xmlInfoNum_type_info=(xmlInfoNum, http://www.w3.org/2001/XMLSchema, string, 0, 1, false), xmlInfoType=84, xmlInfoType_type_info=(xmlInfoType, http://microsoft.com/wsdl/types/, char, 1, 1, false), xmlInfoFlag=false, xmlInfoFlag_type_info=(xmlInfoFlag, http://www.w3.org/2001/XMLSchema, boolean, 1, 1, false)], MyAnyTypeTRR_type_info=(anyType, http://Partner.com/, xmlAddInfosType, 0, 1, false), apex_schema_type_info=(http://Partner.com/, true, false), field_order_type_info=(MyAnyTypeTRR)]), xmlAddInfos_type_info=(xmlAddInfos, http://Partner.com/, ArrayOfAnyType, 0, 1, false), xmlLocation=08, xmlLocation_type_info=(xmlLocation,http://www.w3.org/2001/XMLSchema, string, 0, 1, false), xmlPeopleFlag=false, xmlPeopleFlag_type_info=(xmlPeopleFlag, http://www.w3.org/2001/XMLSchema, boolean, 1, 1, false)]
Hey
Thanks for your help. I managed it with help of this post: http://boards.developerforce.com/t5/Apex-Code-Development/putting-values-into-NESTED-MAPS/td-p/157840
All Answers
I think if you use {!zav.xmlTitle} instead of {!people.xmlTitle} inside the <apex:repeat> you'll get what you need.
Hey!
I already tried this but it doesnt work. This is what I get:
Error: Unknown property 'mytestclass.xmlPeopleType.xmlTitle'
The key lies in your controller class and what 'people' is returning. If 'people' is really an XML string, but you want individual fields, you could change the controller to have a 'peopleclass' which contains members for each of the nodes in the XML
I guess that it is XML string, because this is data from WSDL.
How could I do that?
In your controller change the 'people' member from a string to a class, for example 'peopleInfo'.
Create the peopleInfo class, then write controller code that parses the XML string and populates the peopleInfo class. I found this link that might be useful (I've not used it) http://developer.force.com/cookbook/recipe/parsing-xml-using-the-apex-dom-parser
Hey
Thanks for your help. I managed it with help of this post: http://boards.developerforce.com/t5/Apex-Code-Development/putting-values-into-NESTED-MAPS/td-p/157840