-
ChatterFeed
-
1Best Answers
-
0Likes Received
-
0Likes Given
-
10Questions
-
18Replies
Getting null in XMLStreamReader while reading attribute
public void parseXML(XmlStreamReader xsr)
{
while(xsr.hasNext())
{
if (xsr.getEventType() == XmlTag.START_ELEMENT)
{
if ('body' == xsr.getLocalName())
{
m_xmlValue += '-' + ' ' + parseRoot(xsr);
// parseRoot(xsr);
}
}
xsr.next();
}
}
public String parseRoot(XmlStreamReader xsr)
{
String value ='';
value += '---> ' + xsr.getAttributeValue('', 'chapter');
System.debug('The value of chapter is ::'+value);
while(xsr.hasNext())
{
if (xsr.getEventType() == XmlTag.END_ELEMENT)
{
break;
}
else if (xsr.getEventType() == XmlTag.CHARACTERS)
{
value += xsr.getText();
}
xsr.next();
}
return value;
}
public TestGoogleAppController()
{
try
{
//TestGoogleAppController tstGoogleApp = new TestGoogleAppController();
m_xmlValue = '';
//Playing with XML
//String xml = '<root><body chapter="1">Hello Peace</body><body chapter="2">Sumiran</body><body chapter="3">How</body></root>';
String xml = '<body chapter="1">Hello Peace</body>';
XmlStreamReader xsr = new XmlStreamReader(xml);
parseXML(xsr);
}
}
Guys, I have been stuck on this problem since morning.So please help out.
I am try to read the xml.I can read the values present between tags but I get "null" while reading attributes.Please could you point me in the right direction
- iceberg4u
- June 18, 2009
- Like
- 0
- Continue reading or reply
Questions regarding visualforce
Questions regarding visualforce. I post a thread on the discussion board but do not get good feedback.
I have a multipicklist custom field which has ten values and I want to display this custom field as checkboxes on the VF page. Now I use apex:selectCheckboxes tag, but the result is all the ten checkboxes are in one line(I don’t find any attribute on this tag to limit the numbers per line). Is there any way to display only three checkboxes in each line?
Now:
box 1 box 2 box 3 box 4 … box 10
I want:
box 1 box 2 box 3
box 4 box 5 box 6
…..
box 10
Another question is that currently I am using tabpanel and each panel is a Visualforce page. So when I click the panel, I want to go to a different vf page. I try to add javascript code 'windon.location = PAGEURL' in onclick event, but it does not seem to work. Can you give me some suggestions? Thanks!
- TheMythical
- August 06, 2009
- Like
- 0
- Continue reading or reply
Grouping selectCheckbox on VF page
Hey,
I have a question regarding the UI on VF page. I have a multipicklist custom field which has ten values and I want to display this custom field as checkboxes on the VF page. Now I use apex:selectCheckboxes tag, but the result is all the ten checkboxes are in one line(I don’t find any attribute on this tag to limit the numbers per line). Is there any way to display only three checkboxes in each line? Thanks!
Now:
box 1 box 2 box 3 box 4 … box 10
I want:
box 1 box 2 box 3
box 4 box 5 box 6
…..
box 10
Sincerely
TheMythical
- TheMythical
- August 04, 2009
- Like
- 0
- Continue reading or reply
Can I sort the data by the value in field priority?
I want to sort the data by the value in field priority. There are three values in that picklist field: High, Medium, Low.
If I only fire the query select XXX from Case order by priority. The result I get back will be High->Low->Medium (by letter order). But what I want is High->Medium->Low (based on the meanings). Are there any way I can write the SOQL to achieve this? Thanks!
Sincerely
TheMythical
- TheMythical
- July 30, 2009
- Like
- 0
- Continue reading or reply
Problems while using command line dataloader
I am starting to use command line dataloader to import data to the custom object on my org, currently I ran into a problem each time I run the dataloader there will be exception says:
Error while calling web service operation: upsert, error was: Field name provided, does not match an External ID for Portlet__c [InvalidFieldFault [ApiQueryFault [ApiFault exceptionCode=''INVALID_FIELD' exceptionMessage='Field name provided, does not match an External ID for Portalet__c']
Since I dont specify the external id for that object, are there any stuffs I need to be aware about the csv file format? Thanks!
Sincerely
theMythical
- TheMythical
- July 30, 2009
- Like
- 0
- Continue reading or reply
Question while deploying to force.com platform
Can we use ant script to directly import some custom object's data to force.com platform, if so, what is the steps to do that? Thanks!
- TheMythical
- July 28, 2009
- Like
- 0
- Continue reading or reply
Questions about keyword 'with sharing'
Hey, currently I ran into a problem that when I use the query [Select acr.Role From AccountContactRole acr where acr.AccountId = :userContact.AccountId and acr.ContactId = :userContact.Id] in a class with the keyword 'with sharing', it says: no such column Role in Object AccountContactRole, if I fire the query in a class without the keyword, it works fine.
I am wondering do with sharing provide object level security or also field level security? thanks!
Sincerely
Shuchun
- TheMythical
- July 24, 2009
- Like
- 0
- Continue reading or reply
How to enable the object and field level security Standard Object 'AccountContactRole'
- TheMythical
- July 23, 2009
- Like
- 0
- Continue reading or reply
Can we pass parameters from visualforce to apex?
I want to do something like this:
rendered="{!confirmMessagesExist('CONFIRM')},
I have a function defined in Apex class called getConfirmMessagesExist.
But each time I save the page, it says can not find function name confirmMessagesExist. Any Idea?
Can we pass parameters from visualforce to apex? Thanks!
- TheMythical
- July 17, 2009
- Like
- 0
- Continue reading or reply
The latest Force.com IDE doesn't work
Hey,
Recently, I install the Force.com IDE plug-in for eclipse, but there are some problems. My eclipse version is Ganemyde, force.com IDE version is 16.0. After refreshing files from server (I have 30-40 metadata files), every five minutes, my IDE becomes extremely slow, after sometime it says Internal Error: Out of Memory. Do you like to exit the IDE? I don't know why this will happen like every 5-8 mins. Any idea?
Mythical
- TheMythical
- July 14, 2009
- Like
- 0
- Continue reading or reply
My Force.com IDE is not working
- TheMythical
- July 10, 2009
- Like
- 0
- Continue reading or reply
How to return binary data from an External web service callout (HttpRequest)?
Can anyone tell me if it is possible to get binary data back from a web service callout?
I am using the apex Http, HttpRequest and HttpResponse classes to call an external service that returns a binary file. I then attach that file to an email programatically. Everything works fine, except that my binary data in the attachment is mangled, because of the string conversion on response.getBody(). Is there a way to retrieve the binary stream from the HttpResponse class without corrupting it?
Or is there another set of classes I should use to perform this function to get the results I'm looking for?
Thanks for any help!
Gretchen
- twix
- November 04, 2009
- Like
- 0
- Continue reading or reply
Questions regarding visualforce
Questions regarding visualforce. I post a thread on the discussion board but do not get good feedback.
I have a multipicklist custom field which has ten values and I want to display this custom field as checkboxes on the VF page. Now I use apex:selectCheckboxes tag, but the result is all the ten checkboxes are in one line(I don’t find any attribute on this tag to limit the numbers per line). Is there any way to display only three checkboxes in each line?
Now:
box 1 box 2 box 3 box 4 … box 10
I want:
box 1 box 2 box 3
box 4 box 5 box 6
…..
box 10
Another question is that currently I am using tabpanel and each panel is a Visualforce page. So when I click the panel, I want to go to a different vf page. I try to add javascript code 'windon.location = PAGEURL' in onclick event, but it does not seem to work. Can you give me some suggestions? Thanks!
- TheMythical
- August 06, 2009
- Like
- 0
- Continue reading or reply
Grouping selectCheckbox on VF page
Hey,
I have a question regarding the UI on VF page. I have a multipicklist custom field which has ten values and I want to display this custom field as checkboxes on the VF page. Now I use apex:selectCheckboxes tag, but the result is all the ten checkboxes are in one line(I don’t find any attribute on this tag to limit the numbers per line). Is there any way to display only three checkboxes in each line? Thanks!
Now:
box 1 box 2 box 3 box 4 … box 10
I want:
box 1 box 2 box 3
box 4 box 5 box 6
…..
box 10
Sincerely
TheMythical
- TheMythical
- August 04, 2009
- Like
- 0
- Continue reading or reply
Can I sort the data by the value in field priority?
I want to sort the data by the value in field priority. There are three values in that picklist field: High, Medium, Low.
If I only fire the query select XXX from Case order by priority. The result I get back will be High->Low->Medium (by letter order). But what I want is High->Medium->Low (based on the meanings). Are there any way I can write the SOQL to achieve this? Thanks!
Sincerely
TheMythical
- TheMythical
- July 30, 2009
- Like
- 0
- Continue reading or reply
Question while deploying to force.com platform
Can we use ant script to directly import some custom object's data to force.com platform, if so, what is the steps to do that? Thanks!
- TheMythical
- July 28, 2009
- Like
- 0
- Continue reading or reply
How to enable the object and field level security Standard Object 'AccountContactRole'
- TheMythical
- July 23, 2009
- Like
- 0
- Continue reading or reply
Can we pass parameters from visualforce to apex?
I want to do something like this:
rendered="{!confirmMessagesExist('CONFIRM')},
I have a function defined in Apex class called getConfirmMessagesExist.
But each time I save the page, it says can not find function name confirmMessagesExist. Any Idea?
Can we pass parameters from visualforce to apex? Thanks!
- TheMythical
- July 17, 2009
- Like
- 0
- Continue reading or reply
The latest Force.com IDE doesn't work
Hey,
Recently, I install the Force.com IDE plug-in for eclipse, but there are some problems. My eclipse version is Ganemyde, force.com IDE version is 16.0. After refreshing files from server (I have 30-40 metadata files), every five minutes, my IDE becomes extremely slow, after sometime it says Internal Error: Out of Memory. Do you like to exit the IDE? I don't know why this will happen like every 5-8 mins. Any idea?
Mythical
- TheMythical
- July 14, 2009
- Like
- 0
- Continue reading or reply
My Force.com IDE is not working
- TheMythical
- July 10, 2009
- Like
- 0
- Continue reading or reply
Getting null in XMLStreamReader while reading attribute
public void parseXML(XmlStreamReader xsr)
{
while(xsr.hasNext())
{
if (xsr.getEventType() == XmlTag.START_ELEMENT)
{
if ('body' == xsr.getLocalName())
{
m_xmlValue += '-' + ' ' + parseRoot(xsr);
// parseRoot(xsr);
}
}
xsr.next();
}
}
public String parseRoot(XmlStreamReader xsr)
{
String value ='';
value += '---> ' + xsr.getAttributeValue('', 'chapter');
System.debug('The value of chapter is ::'+value);
while(xsr.hasNext())
{
if (xsr.getEventType() == XmlTag.END_ELEMENT)
{
break;
}
else if (xsr.getEventType() == XmlTag.CHARACTERS)
{
value += xsr.getText();
}
xsr.next();
}
return value;
}
public TestGoogleAppController()
{
try
{
//TestGoogleAppController tstGoogleApp = new TestGoogleAppController();
m_xmlValue = '';
//Playing with XML
//String xml = '<root><body chapter="1">Hello Peace</body><body chapter="2">Sumiran</body><body chapter="3">How</body></root>';
String xml = '<body chapter="1">Hello Peace</body>';
XmlStreamReader xsr = new XmlStreamReader(xml);
parseXML(xsr);
}
}
Guys, I have been stuck on this problem since morning.So please help out.
I am try to read the xml.I can read the values present between tags but I get "null" while reading attributes.Please could you point me in the right direction
- iceberg4u
- June 18, 2009
- Like
- 0
- Continue reading or reply
Raw HttpResponse Data
Hi,
Is there a way to retrieve the raw http response data, headers and all, from an HttpResponse object?
Thanks,
Scott
- Scott.M
- March 26, 2009
- Like
- 0
- Continue reading or reply