• TheMythical
  • NEWBIE
  • 25 Points
  • Member since 2009

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 10
    Questions
  • 18
    Replies

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

 

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!

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

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

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

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!

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

I recently ran into a problem with standard object 'AccountContactRole', my question is how to enable the object and field level security for Standard Object 'AccountContactRole' on a particular profile such as customer portal user or customer portal manager? Thanks!

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!

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 

I installed the latest force.com IDE version 16.0, then every five minutes, there will be error: java heap out of memory. I am wondering why?

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

 

 

  • November 04, 2009
  • Like
  • 0

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!

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

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

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!

I recently ran into a problem with standard object 'AccountContactRole', my question is how to enable the object and field level security for Standard Object 'AccountContactRole' on a particular profile such as customer portal user or customer portal manager? Thanks!

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!

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 

I installed the latest force.com IDE version 16.0, then every five minutes, there will be error: java heap out of memory. I am wondering why?

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

 

Hi,

 

Is there a way to retrieve the raw http response data, headers and all, from an HttpResponse object? 

 

Thanks,

Scott