【问题标题】:Assigning Static Resource to apex:image from Apex class将静态资源分配给顶点:来自 Apex 类的图像
【发布时间】:2014-04-25 18:31:52
【问题描述】:

我想根据选择列表选择将静态资源图像分配给 .知道如何使用 apex 类来做到这一点。我可以使用 javascript 函数来实现这一点,但是我需要将此页面呈现为不支持 javascript 的 PDF。

任何想法/指针????

【问题讨论】:

    标签: salesforce apex static-resource


    【解决方案1】:

    使用 Apex:variable 动态分配图像路径。

    这是一个示例代码。

    公共类 TestStaticResource{

    public string ImagePath{
        get;set;
    }
    public TestStaticResource(){
        ImagePath='images/yourImage.png';
    }
    

    }

     <apex:form>
          <apex:variable var="var" value="{!ImagePath}"/> 
          <apex:image url="{!URLFOR($Resource.StaticResuorceName, var)}"/> 
     </apex:form>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-01-03
      • 1970-01-01
      • 1970-01-01
      • 2011-07-12
      相关资源
      最近更新 更多