function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
tekane4tekane4 

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)]

Best Answer chosen by Admin (Salesforce Developers) 
tekane4tekane4

All Answers

Jeff MayJeff May

I think if you use  {!zav.xmlTitle} instead of  {!people.xmlTitle} inside the <apex:repeat> you'll get what you need.  

tekane4tekane4

Hey!

 

I already tried this but it doesnt work. This is what I get:

 

Error: Unknown property 'mytestclass.xmlPeopleType.xmlTitle'

Jeff MayJeff May

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

tekane4tekane4

I guess that it is XML string, because this is data from WSDL.

 

How could I do that? 

Jeff MayJeff May

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

 

 

tekane4tekane4
This was selected as the best answer