+ Start a Discussion
cml9cml9 

Need help with Visual Force.

User-added image

I have finished the visual force page and the wrapper and now what I wanted to happen is that when a record/s has been Selected then the action page will redirect wherein users will be able to edit the PRICE and add QUANTITY then it will be SAVED to another OBJECT called Sales Product (Sales_Product__c) which is related to Product_Entry__c.

Should I create new visual force page or something? Can someone code this for me?

Here is the code that I used now.
 
<apex:page controller="wrapperExample3">
<apex:form >
    <apex:pageBlock >
        <apex:pageBlockButtons location="both">
        <apex:commandButton value="Select and Create Sales Product" /> 
     <!-- I have no Action for the Save yet :( -->
        <apex:commandButton value="Cancel" />
        </apex:pageBlockButtons>
        <apex:pageBlockSection >
        <apex:pageBlockTable value="{!lstWrapperString}" var="wrap">
        <apex:column headerValue="Action">
            <apex:inputCheckbox />
        </apex:column>
        
        <apex:column headerValue="Name">
            {!wrap.Name}
        </apex:column>
        
        <apex:column headerValue="Price">
             {!wrap.Price}
        </apex:column>
        </apex:pageBlockTable>
        </apex:pageBlockSection>
    </apex:pageBlock>
</apex:form>
  
</apex:page>

and here is the wrapper.
 
public class wrapperExample3 {

  List <Product_Entry__c> ProdList=new List<Product_Entry__c>();
  List <wrapper> lstw =new List<wrapper>();
  
        public List<wrapper> getlstWrapperString() 
        { 
                ProdList=[select name,Price__c from Product_Entry__c];
                for (Product_Entry__c pe : ProdList)   
                {
                        lstw.add(new wrapper( pe.name, pe.Price__c ) );
                }              
                return lstw;
        }
                      
        public Class wrapper 
        {  
                public string name {get;set;}
                public decimal price {get;set;}
                public wrapper(string Name,decimal Price) 
                {
                        this.Name = Name;
                        this.Price = Price; 
                }
    
    }
}

Thank you all for the Help!