• chantspel
  • NEWBIE
  • 25 Points
  • Member since 2010

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 6
    Questions
  • 7
    Replies

Hi,

I am trying to overide the default edit page for my custom object but not having much luck. I think this code is pretty self explanatory, but when I click the save button - the record does not update or get saved...

 

 

<apex:page standardController="CustomObj__c" showHeader="true">
<apex:pageBlock >
<apex:form >
<apex:commandButton value="Save" action="{!save}"/>
<apex:inputText value="{!CustomObj__c.CustomObjValue__c}" size="50" />
</apex:form>
</apex:pageBlock>
</apex:page>

 

Is there something else I need to do to take the input and save it? I'd rather not have to write a controller for such a simple thing. Thanks

 

Hi,

I'm trying to add a custom button to the standard button panel on a custom object. This is the view brought up by the <apex:detail> tag. When I select a custom button, it gives me several options including Execute Javascript, url, visualforce page. How can I use it to call a function for THIS visual force page? Any ideas?

Firstly, this question requires a bit of introduction so please bear with me.

 

The high level is that I am connecting to a outside web service which will return some XML to my apex controller. The format will look something like this:

 

 <Wrapper>
	<reportTable name='table_id' title='Report Title'>
      <row>
        <Element1><![CDATA[Activewear_2010_Campaigns]]></Element1>
        <Element2><![CDATA[577373]]></Element2>
        <Element3><![CDATA[4129]]></Element3>
        <Element4 dataFormat='2' dataSuffix='%'><![CDATA[0.7151]]></Element4>
        <Element5><![CDATA[2010-04-04]]></Element5>
        <Element6><![CDATA[2010-05-03]]></Element6>
      </row>
    </reportTable>
	...
</Wrapper>

 

Now currently I am using the XMLdom utility class to map this data into a custom object "report" which contains a list of "row" objects.

 

From there I need to display the report in a table output to VisualForce. Something like this I think will work:

 

<table>
  <apex:repeat value="{!reportTables}" var="table">
      <apex:repeat value="{!table.rows}" var="row">
      <tr>
      	<apex:repeat value="{!row.ColumnValue}" var="column">
      		<apex:repeat value="{!column}" var="value">
      			<td>
      			<apex:outputText value="{!value}" />
      			</td>
      		</apex:repeat>
      	</apex:repeat>
       </tr>
      </apex:repeat>
   </apex:repeat>
</table>

 

Now you may be wondering why I don't use something easier to work with like apex:pageBlockTable - the reason is I need to be able to handle a data coming back that contains different number of columns. So far I haven't been able to figure out a way to have apex:pageBlockTable handle my XML without explicitly knowning each column in advance.

 

Questions are:

1) Does this seem like a good approach to the problem?

2) Is there a simpler/better way to consume the XML besides writing my own custom objects to map VF to?

 

Open to any and all suggestions. I really hope there is a better way than building the HTML table myself, as then I also have to deal with styling and alignment etc. Thanks.

 

 

 

Hi,

The title pretty much says it all, is there a way to mark a text field as a password on a custom object? I haven't seen a way to do this.

Thanks

Hi,

Sorry if this is a stupid question but can you not group your apex classes into packages like you can in Java?

I use the Eclipse IDE plugin and it allows you to create a folder under src/classes but I can't create any apex classes in the subfolder...

 Hi,


I'm working on a simple data push from salesforce into a custom application. The apex class that will recieve the "trigger" to do the data push needs to retrieve login paramaters, user/pass, to authenticate to our custom app.


What would be the best way/where to store this information. I can build a simple custom object to model the data, but I don't want to have the ability for multiple records to exist. There should be only 1 user/pass combination to be used by my apex class.

Hope this makes sense. Thanks.

Hi,

I'm trying to add a custom button to the standard button panel on a custom object. This is the view brought up by the <apex:detail> tag. When I select a custom button, it gives me several options including Execute Javascript, url, visualforce page. How can I use it to call a function for THIS visual force page? Any ideas?

Hi,

The title pretty much says it all, is there a way to mark a text field as a password on a custom object? I haven't seen a way to do this.

Thanks

Hi,

Sorry if this is a stupid question but can you not group your apex classes into packages like you can in Java?

I use the Eclipse IDE plugin and it allows you to create a folder under src/classes but I can't create any apex classes in the subfolder...

 Hi,


I'm working on a simple data push from salesforce into a custom application. The apex class that will recieve the "trigger" to do the data push needs to retrieve login paramaters, user/pass, to authenticate to our custom app.


What would be the best way/where to store this information. I can build a simple custom object to model the data, but I don't want to have the ability for multiple records to exist. There should be only 1 user/pass combination to be used by my apex class.

Hope this makes sense. Thanks.

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