• Nick Van Dusen
  • NEWBIE
  • 0 Points
  • Member since 2010

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 2
    Replies

I'm coding a custom list controller to retrieve a list of images from a third-party site. I'd like to show filename, size, and eventually buttons for interacting with the images via RESTful HTTP calls. I'm new to Apex, and am stumbling around trying to figure out how to create properties so I can list them on a Visualforce page.

 

Here's my Visualforce code:

<apex:page standardController="Inventory_Unit__c" extensions="InventoryImageListExtension">
<apex:pageBlock>
    <apex:pageBlockTable value="{!listImages}" var="img"> 
        <apex:column value="{!img.fileName}"/> 
    </apex:pageBlockTable>    
</apex:pageBlock>
</apex:page>

 

And my Apex class (such as it is)

public class InventoryImageListExtension {
    private Final Inventory_Unit__c controller;
    public InventoryImageListExtension(ApexPages.StandardController c) { 
        this.controller = (Inventory_Unit__c)c.getRecord();
    }
    
    public Map<String,String> getListImages() {
        Map<String,String> imageMap = new Map<String,String>();
        imageMap.put('fileName','test.jpg');
        return imageMap;
    }
}

 

I'm sure I should be using Lists or maybe a Map with another Map inside it, but I'm just completely confused on how to get something like {!img.propertyName} to work. Can anyone help? Thanks!

I'm using Cases, and need the Case Origin picklist to be required, but also default to -None- so that people working the case are forced to choose an option. It's defaulting to Phone as the origin, even though that is not set as default in the layout.

 

What can I do to make the default selection -None-?

I'm coding a custom list controller to retrieve a list of images from a third-party site. I'd like to show filename, size, and eventually buttons for interacting with the images via RESTful HTTP calls. I'm new to Apex, and am stumbling around trying to figure out how to create properties so I can list them on a Visualforce page.

 

Here's my Visualforce code:

<apex:page standardController="Inventory_Unit__c" extensions="InventoryImageListExtension">
<apex:pageBlock>
    <apex:pageBlockTable value="{!listImages}" var="img"> 
        <apex:column value="{!img.fileName}"/> 
    </apex:pageBlockTable>    
</apex:pageBlock>
</apex:page>

 

And my Apex class (such as it is)

public class InventoryImageListExtension {
    private Final Inventory_Unit__c controller;
    public InventoryImageListExtension(ApexPages.StandardController c) { 
        this.controller = (Inventory_Unit__c)c.getRecord();
    }
    
    public Map<String,String> getListImages() {
        Map<String,String> imageMap = new Map<String,String>();
        imageMap.put('fileName','test.jpg');
        return imageMap;
    }
}

 

I'm sure I should be using Lists or maybe a Map with another Map inside it, but I'm just completely confused on how to get something like {!img.propertyName} to work. Can anyone help? Thanks!

Hi,

My problem is
Fatal error: Uncaught SoapFault exception: [HTTP] Could not connect to host in /***/soapclient/SforceBaseClient.php:113
Stack trace:
#0 [internal function]: SoapClient->__doRequest('<?xml version="...', 'https://www.sal...', '', 1, 0)
#1 [internal function]: SoapClient->__call('login', Array)
#2 /***/soapclient/SforceBaseClient.php(113): SoapClient->login(Array)
#3 /***/test.php(7): SforceBaseClient->login('username@domain...', 'mypassword')
#4 {main} thrown in /***/soapclient/SforceBaseClient.php on line 113

Settings:
Apache/1.3.37 (Unix)
PHP 5.2.1

curl
cURL support  enabled 
cURL Information  libcurl/7.16.1 OpenSSL/0.9.7e zlib/1.2.3 

openssl
OpenSSL support  enabled 
OpenSSL Version  OpenSSL 0.9.7e-p1 25 Oct 2004 

soap
Soap Client  enabled 
Soap Server  enabled 
Directives
soap.wsdl_cache 1
soap.wsdl_cache_dir /tmp
soap.wsdl_cache_enabled 1
soap.wsdl_cache_limit 5
soap.wsdl_cache_ttl 86400

php.ini
allow_url_fopen = On

Same script is working from my local computer (apache 2.2, php 5.2.3 on windows) with exactly same settings.
I don't see any requirement about Apache version as long as PHP 5 works but it is the only difference beside windows - unix?

Thanks for helping!

Suat