• vijayk1.393339369954256E12
  • NEWBIE
  • 5 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 7
    Replies
It is possible to get image file from Rich Text Field value. 

Thanks in advance
I want to export image from rich text area field and pust into production rich text area field.

Is this possible with Apex?
Hi All,

I am trying to create a simple calculator performing total = quantity * price. But my method written in controller is not getting called. ANy help would be appreciated.

visualforce code-

<apex:page id="ProductCalculator" controller="ProductCalculator">
  <apex:pageBlock id="pbProdCalc">
      <apex:form id="fProdCalc">
          <apex:dataTable id="dtProdCalc" columns="4" value="{!Products}" var="con" styleclass="list">
              <apex:column id="prodList" headerValue="Product">
                  <apex:selectList id="slProdList" value="{!product}" size="1" multiselect="false">
                      <apex:selectOptions id="soProdList" value="{!items}"/>
                  </apex:selectList>
              </apex:column>
              <apex:column id="prodQuantity" headerValue="Quantity">
                     <apex:inputText id="Qty" value="{!quantity}"/>
              </apex:column>
              <apex:column id="prodPrice" headerValue="Price">
                  <apex:inputText id="Price" value="{!prodPrice}">
                      <apex:actionSupport action="{!calculateTotal}" event="onchange" reRender="Total"/>
                  </apex:inputText>
              </apex:column>
              <apex:column id="prodTotal" headerValue="Total">
                  <apex:outputText id="Total" value="{!prodTotal}"/>
              </apex:column>
          </apex:dataTable>
      </apex:form>
  </apex:pageBlock>
</apex:page>

Controller code-

public class ProductCalculator {

    Integer qty; Integer price; Integer total;
   
    public PageReference calculateTotal() {
        system.debug('calculate total called' );
        calcTotal();
        return null;
    }  
   
    public Integer calcTotal()
    {
        total = qty * price;
        system.debug('total is: ' + total);
        return total;
    }
  
    public Integer getQuantity() {
        return qty;
    }
   
    public void setQuantity(Integer q) {
       qty = q;
    }
   
     public Integer getProdPrice() {
        return price;
    }
   
    public void setProdPrice(Integer p)
    {
        price = p;
    }
   
     public Integer getProdTotal() {
        return total;
    }
   
    public void setProdTotal(Integer t)
    {
        total = t;
    }
   
    public List<SelectOption> getItems() {
        List<SelectOption> options = new List<SelectOption>();
        options.add(new SelectOption('Product1','Product 1'));
        options.add(new SelectOption('Product2','Product 2'));
        options.add(new SelectOption('Product3','Product 3'));
        return options;
    }

  
    String[] prod = new String[]{};
  
    public String[] getProduct() {
        return prod;
    }
   
    public void setProduct(String[] prod)
    {
        this.prod = prod;
    }

    String ProductType;
    List<Product2> products;
   
    public List<Product2> getProducts() {
        if(products == null)
            products = [select id, name from Product2 Limit 1];
        return products;
    }

}

It is possible to get image file from Rich Text Field value. 

Thanks in advance
I want to export image from rich text area field and pust into production rich text area field.

Is this possible with Apex?