• Pushkar
  • NEWBIE
  • 0 Points
  • Member since 2008

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 3
    Replies

What is the rationale behind the ability to specify multiple extensions for a VF page? In what scenarios is using multiple extensions useful?

 

Thanks,

Pushkar

Hi,

I implemented a sample Http callout from an apex class to my server. But it always gives me a "System.CalloutException: Read timed out". I could not find any relevant information while searching on salesforce.

1. How do I confirm that my server is reachable from salesforce? (i believe it is that is why it is throwing a Read timed out exception in place of unreachable destination host or host not found).

2. I am using secure http i.e. https protocol. Are there any specific settings required on salesforce for this?

3. It is a servlet that I am trying to contact. I suppose that would work and I do not necessarily need to expose a web service.

Following is the class I am using. I accessing it as a web service.

global class HttpCalloutSample
{
    webService static String getContent(String url)
    {
        Http h = new Http();
        HttpRequest req = new HttpRequest();
        req.setEndpoint(url);
        req.setMethod('GET');
        HttpResponse res = h.send(req);
        return res.getBody();
    }
}


- Pushkar
  • September 05, 2008
  • Like
  • 0
Hi,

How does the MVC pattern work for visualforce?

If I have a custom HTML element on a visual force page, can I still leverage the power to have the value reflected in the corresponding objet field in the controller.

for. e.g.

<apex: Page customController="MyController">
    <apex: form>
       <apex: PageBlockButtons >
              <apex:commandButton action="{!Save}" value="Save"/>
       </apex: PageBlockButtons>
       <apex: outputLabel value="custom label"/>
       <input id="myInputId" type="text" value="{account.Name}"/>
    </apex: form>
</apex: Page>

public class MyController{
       Account account;
       public MyController(){
             account = [Select Id, Name from Account where ...[some condition]][0];
       }

       public Account getAccount(){
             return account;
       }

       public PageReference Save(){
             /***************************************************************
              If I enter any value in the <input id="myInputId" ... />
             of the page will it be reflected in the account object ?

              **************************************************************/

             return null;
       }
}


Message Edited by Pushkar on 08-08-2008 08:13 AM
Hi,

The component Id is not available through {!$Component.<Id>} when refered to in a script at the end of the visualforce page.
Though it is available if I add a script tag just after the element.
e.g.


<apex: Page standardController="Account">
    <apex: form>
       <apex: PageBlock>
          <apex:inputField id="input_Id" value="{!account.Id}"/>
          <script type="text/javascript">
                alert("id= {!$Component.input_Id}");
          </script>
       </apex: PageBlock>
    </apex:form>
</apex: Page>


The above one works, but the following fails

<apex: Page standardController="Account">
    <apex: form>
       <apex: PageBlock>
          <apex:inputField id="input_Id" value="{!account.Id}"/>
       </apex: PageBlock>
    </apex:form>
    <script type="text/javascript">
           alert("id= {!$Component.input_Id}");
    </script>
</apex: Page>


Hi,

I implemented a sample Http callout from an apex class to my server. But it always gives me a "System.CalloutException: Read timed out". I could not find any relevant information while searching on salesforce.

1. How do I confirm that my server is reachable from salesforce? (i believe it is that is why it is throwing a Read timed out exception in place of unreachable destination host or host not found).

2. I am using secure http i.e. https protocol. Are there any specific settings required on salesforce for this?

3. It is a servlet that I am trying to contact. I suppose that would work and I do not necessarily need to expose a web service.

Following is the class I am using. I accessing it as a web service.

global class HttpCalloutSample
{
    webService static String getContent(String url)
    {
        Http h = new Http();
        HttpRequest req = new HttpRequest();
        req.setEndpoint(url);
        req.setMethod('GET');
        HttpResponse res = h.send(req);
        return res.getBody();
    }
}


- Pushkar
  • September 05, 2008
  • Like
  • 0
Hi,

How does the MVC pattern work for visualforce?

If I have a custom HTML element on a visual force page, can I still leverage the power to have the value reflected in the corresponding objet field in the controller.

for. e.g.

<apex: Page customController="MyController">
    <apex: form>
       <apex: PageBlockButtons >
              <apex:commandButton action="{!Save}" value="Save"/>
       </apex: PageBlockButtons>
       <apex: outputLabel value="custom label"/>
       <input id="myInputId" type="text" value="{account.Name}"/>
    </apex: form>
</apex: Page>

public class MyController{
       Account account;
       public MyController(){
             account = [Select Id, Name from Account where ...[some condition]][0];
       }

       public Account getAccount(){
             return account;
       }

       public PageReference Save(){
             /***************************************************************
              If I enter any value in the <input id="myInputId" ... />
             of the page will it be reflected in the account object ?

              **************************************************************/

             return null;
       }
}


Message Edited by Pushkar on 08-08-2008 08:13 AM