• Force.platform
  • NEWBIE
  • 130 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 2
    Likes Received
  • 0
    Likes Given
  • 40
    Questions
  • 14
    Replies
Hi all,
        my inputText component is not visible in column of pageBlockTable
vf:
<apex:page controller="Add_Participant_Page_Controller">
  <apex:form >
  <apex:pageBlock >
  <apex:commandButton title="Save Item" action="{!addItemWithoutParticipant}" value="Save Item"/>
  <apex:pageBlockTable value="{!addItem}" var="add">
  
  <apex:column headerValue="Item">
  <apex:inputText value="{!Name}" />
  </apex:column> 
  
  <apex:column headerValue="Quantity"> 
  <apex:inputText value="{!Quantity}"/>
  </apex:column>
  
  <apex:column headerValue="Rate"> 
  <apex:inputText value="{!Rate}"/>
  </apex:column>
  
  </apex:pageBlockTable>
  
  </apex:pageBlock>
  </apex:form>
</apex:page>
Controller:
public class Add_Participant_Page_Controller{

public List<Menu_Item__c> addItem{get; set;} 
public Integer Quantity{get; set;}
public String Name{get; set;}
public Integer Rate{get; set;}

 
 public pageReference addItemWithoutParticipant(){
  Menu_Item__c Item = new Menu_Item__c(Name=Name,Quantity__c=Quantity,Rate__c=Rate);
  addItem.add(Item);
  insert addItem ;
 return NULL;
 } 
}
Hi all,
I want to update CustomAmmount(Custom field) on parent(Opportunity) when child(OpportunityLineItem) updated
but its not working in after delete event
Trigger:
trigger UpdateCustomAmmount on OpportunityLineItem (after insert, after update, after Undelete,after delete) {
    if(Trigger.isAfter && (Trigger.isInsert || Trigger.isUpdate || Trigger.isUnDelete))
    {
    UpdateCustomAmmount_Handler.updateAmmount(Trigger.new);
    }
    
   /if(Trigger.isAfter ||Trigger.isDelete)
    {
      UpdateCustomAmmount_Handler.updateAmmount(Trigger.old);  
    }
}

Contoller:
public class UpdateCustomAmmount_Handler {
    public static void updateAmmount(List<OpportunityLineItem> olt)
    {
       
        List<Id> listIds = new List<Id>();
        system.debug('list of opp ids---'+listIds);
        
        for (OpportunityLineItem childItem : olt) {
            listIds.add(childItem.OpportunityId);
        }
        
          list<Opportunity> parentOpp = new List<Opportunity>([SELECT id, Custom_Ammount__c, Name,(SELECT ID, TotalPrice FROM OpportunityLineItems) FROM Opportunity WHERE ID IN :listIds]);
          system.debug('list of opp with child---'+parentOpp); 
          
        for(Opportunity opp:parentOpp)
               {
                   opp.Custom_Ammount__c = 0;
            for(OpportunityLineItem item:opp.OpportunityLineItems)
            {
               
                opp.Custom_Ammount__c += item.TotalPrice; 
               }
            }
        If(parentOpp.size()>0){
            update parentOpp;  
        }    
    }
}
 
Hello All,
      can anyone provide test class for following controller.
public class Account_Pagination_With_Notes {
    public List<Account> accList{get; set;}
    public List<Account_Notes__c> noteList{get; set;}
    public List<WrapperClass> wrapperList{get; set;} 
    
    public integer totalRecs = 0;
    public integer OffsetSize = 0;
    public integer LimitSize= 10;
    
    public Account_Pagination_With_Notes(){ 
     totalRecs =[select count() from account];
     system.debug('Total Account Records'+totalRecs);
     PaginationAccountNote();
     
    }
    
    public void FirstPage()
    {
        OffsetSize = 0;
        system.debug('offset on first page'+OffsetSize);
        updateAccountNote();
        PaginationAccountNote();
    }
    
    public void previous()
    {
        OffsetSize = OffsetSize - LimitSize;
        system.debug('offset on previous page'+OffsetSize);
        updateAccountNote();
        PaginationAccountNote();
    }
    
    public void next()
    {
        OffsetSize = OffsetSize + LimitSize;
        system.debug('offset on next page'+OffsetSize);
        updateAccountNote();
        PaginationAccountNote();
    }
    
    public void LastPage()
    {
        OffsetSize = totalrecs - math.mod(totalRecs,LimitSize);
        system.debug('offset on last page'+OffsetSize);
        updateAccountNote();
        PaginationAccountNote();
    }
    
    public boolean getprev()
    {
        if(OffsetSize == 0)
            return true;
        else
            return false;
    }
    
    public boolean getnxt()
    {
        if((OffsetSize + LimitSize) > totalRecs)
            return true;
        else
            return false;
    }
    
    public void PaginationAccountNote(){
        accList=[SELECT id, name, (SELECT id, name, Note__c from Account_Notes__r ORDER BY CreatedDate DESC LIMIT 1) from Account  ORDER BY NAME ASC LIMIT :LimitSize OFFSET :OffsetSize];
        
        wrapperList= new List<WrapperClass>();
      
        for(Account acc : accList){
            Account_Notes__c nte = new Account_Notes__c();
            
            if(acc.Account_Notes__r.size()>0){
                nte = acc.Account_Notes__r[0];
            }else{
             nte.Account__c = acc.Id;
         }
            
            wrapperList.add(new WrapperClass(acc,nte));
            system.debug('--------------'+wrapperList);
            
        }       
    }
    
    public void updateAccountNote(){
         list<Account_Notes__c> addNotes = new list<Account_Notes__c>();
         for(WrapperClass wrap : wrapperList){
            if(!String.isblank(wrap.noteRec.Note__c) || wrap.noteRec.Id != null){
                addNotes.add(wrap.noteRec);
            }   
         }
        
        upsert addNotes;
    }
    
    public class WrapperClass{
        public Account accRec {get; set;}
        public Account_Notes__c noteRec {get; set;}
        public WrapperClass(Account acc , Account_Notes__c note)
        {
            accRec = acc ;
            noteRec = note;
        }
        
    }
}
can we perform dml on wrapper class list?
 i want to perform upsert operation on wrapper class list.
wrapper class dispaly two object data on vf and also able to enter data in one object on vf. n now i have to perform upsert operation on this list.
Hello All,
  I have trigger that create no of contacts realted to account as per value entered in No_Of_Contact in account object.
Trigger:
trigger AllAccountTrigger on Account (after insert,after update, before insert, before update) {
    if(Trigger.isAfter)
    {   if(Trigger.isInsert || Trigger.isUpdate)
        { 
          AccountExample.createMultipleContact(Trigger.new);
        }
    }
    }

class method:
 public static void createMultipleContact(List<Account> acc){
         List<Contact> c= new List<Contact>();
         for( Account a:acc){
          if(a.Create_Contact__c= true && a.No_Of_Contacts_to_create__c!= 0){
          for(Integer i=1; i<=a.No_Of_Contacts_to_create__c;i++){
          Contact con=new Contact();
          con.FirstName=a.name;
          con.LastName =a.Account_Number__c+'-'+con.Contact_Count__c;
          con.Phone=a.phone;
          con.AccountId=a.Id;
          c.add(con); 
            }
            if(c.size()>0){
            insert c;
               }
              }
             }
            }
 
 but i getting error: System.FinalException: Record is read-only:
i have to pass parametet with commandbutton which is outside of table.
this is my vf: 
<apex:form styleClass="myFormStyle " >
  <center>
  <!----------------pageBlock--------------------------------------->
  <apex:pageBlock title="My Bucket"  >
  
  <apex:pageMessages id="msg"> </apex:pageMessages>
  <!-------------first section-display table and take quantity from user----------------->
  <apex:pageblockSection >
  <apex:pageBlockTable value="{!itemInBucket}" var="i">
   <apex:column value="{!i.Product_Name__c}" />
   
    <apex:column value="{!i.price__c}"  />
    
    <apex:column value="{!i.Quantity__c}" headerValue="Available Quantity"/ >
    
    <apex:column headerValue="Required Quantity" >
    <apex:commandButton value="+" action="{!incrementCounter}" reRender="bucket"/>
    <apex:inputText value="{!count}" style="width: 25px !important;" styleClass="qty " id="bucket"/>
    <apex:commandButton value="-" action="{!decrementCounter}" reRender="bucket"/>
    </apex:column>
    
    <apex:Column >
    <apex:commandLink value="Place Order" action="{!placeOrderForSinglePro}" >
    <apex:param name="Pname" value="{!i.Product_Name__c}"/>
    <apex:param name="price" value="{!i.price__c}" />
     <apex:param name="quantity" value="{!i.Quantity__c}" />
    </apex:commandLink>
    </apex:column>
    
    <apex:Column >
    <apex:commandLink value="cancel" action="{!cancelOrder}" rendered="true" >
    </apex:commandLink>
    </apex:column>
    </apex:pageBlockTable> 
    </apex:pageblockSection>
    <!---------------------second section- take address and name from user--------------->
    <apex:pageBlockSection >
    <apex:inputText value="{!n}" label="Name" />
    <apex:inputTextarea title="Address" value="{!a}" label="Address"/>
    </apex:pageBlockSection>
   
   <!---------------commandButton is in pageBlock------------------------------->
   <apex:commandButton value="Place Order for All Products" action="{!placeOrderForAllPro}"/>
  </apex:pageBlock>
  </center>
  
  <apex:commandLink value="View Order" action="{!openOrderPage}"/>
  <apex:commandLink value="Previous Page" style="float:right;" action="{!redirect}"/>
  </apex:form>
</apex:page>

here i am taking quantity name and address from user and storing all that into Order__C object. now my inputFileds are in diffrent pageBlockSection and my command button is in pageBlock. so how can i insert  that  to Order__c when i click on commandButton.
I have to pass quantity and  price of product with commandbutton which is out of pageBlockTable.
<center> <!--------------category selection result-------------->
              <apex:pageBlock rendered="{!showpageblocktable}" >
              <center>
              <apex:pageBlockTable value="{!selectedProWrapper}" var="p" >
             
             <apex:column style="width:25%">
                    <apex:inputCheckBox value="{!p.selected}"/>
               </apex:column>
               
               <apex:column style="width:25%" headerValue="Product Name">
               <apex:outputLink title="View Product Detail" onclick="return openPopUp('{!p.Eprod.id}') ">
               {!p.Eprod.name}
               </apex:outputLink>
               </apex:column>
               
              <apex:column headerValue=" Image">
                <apex:outputText value="{!p.Eprod.Image__c}" escape="false" />
              </apex:column>
             
               <apex:column value="{!p.Eprod.Price__c}"/>
               
               <apex:column value="{!p.Eprod.Quantity__c}"/>
               
               <apex:Column style="width:25%">
               <apex:commandLink value="Add to Bucket" action="{!AddToCartButton}" >
               <apex:param name="PQuantity" value="{!p.Eprod.Quantity__c}"/>
               <apex:param name="price" value="{!p.Eprod.Price__c}"/> 
               <apex:param name="PId" value="{!p.Eprod.Id}"/>
               </apex:commandLink>
               </apex:column>
                             
              </apex:pageBlockTable>
              </center>
              <!--@@@@@@@@@@ here i have to pass quantity and price @@@@@@------->
              <apex:commandButton value="Add All to Bucket" action="{!AddToCartButton}" >
              <apex:param name="PQuantity" value="{!p.Eprod.Quantity__c}"/>
               <apex:param name="price" value="{!p.Eprod.Price__c}"/> 
               <apex:param name="PId" value="{!p.Eprod.Id}"/>
              </apex:commandButton>
              </apex:pageBlock>
              </center>
                              
    </apex:form>
</apex:page>

but i am getting error:
Error: Unknown property 'Landing_Page_Controller.p'    becoz this commandButton is outside of pageBlockTable and 'P' is variable of pageBlockTable. so how i can do this?
I have to display product image in pageBlockTable:
vf:
<apex:column>
                  <apex:image value="servlet/servlet.FileDownload?file={!p.Image__c}" height="50" width="50"/>
</apex:column>
image is stored in document:
url--https://c.ap6.content.force.com/servlet/servlet.FileDownload?file=0150K000006JMkx 

but image is not displaying in columns properly

 
Hello, 
I have visualforce page, that recive input value from user. page have twi fields inputText(name),inputText(name) and InputTextArea(Address),
i want to add validation that, when user click on save button, these three fields should not empty.
public class EComm_Bucket_Controller 
{public String n{get; set;}
public String a{get; set;}
public Integer q{get; set;}

public pageReference placeOrderForSinglePro()
  {
    Id Prodname=ApexPages.currentPage().getParameters().get('Pname');
    Decimal Proprice = Decimal.valueOf(ApexPages.currentPage().getParameters().get('price'));
   if(!(n!=null))
   {
   
    ApexPages.addmessage(new ApexPages.message(ApexPages.severity.WARNING,'Please enter value'));
   }else
   {
    EOrder__c ord=new EOrder__c(EP_del__c=Prodname,
                                OQuantity__c=q,
                                Contact_Name__c=n,
                                Delivery_Address__c=a,
                                Order_Status__c='Placed',
                                Total_Order_Ammount__c=q*Proprice );
    insert ord;
    }
}

I have added <apex:pageMessage> on vf. but its not working. i have to check for 3 fields. Oquantity is number field. 
Hello all, 
i have inputText and InputTextArea field on vf and i want to give label to them. how can i do that? 
<apex:pageblockSection> 
<apex:inputText title="Name" value="{!n}" />
<apex:inputTextarea title="Address" value="{!a}"/>
 </apex:pageblockSection> 
Hello All,
        I am new to salesforce, my requirment is, i have pageBlockTbale that recive data from user and i have anather two text and textArea field outside of table that fields also recive user input. n i want to save all data in one object when user click on save button. how can we do this?
Hello All,
   i want to show data on vf in pageBlockTable format. but its not showing.
vf:
<apex:page controller="View_Order_Controller" sidebar="false">
  <apex:sectionHeader title="My Order"/>
  <apex:pageBlock >
  <apex:pageBlockSection >
  <apex:pageBlockTable value="{!finalOrder}" var="v">
  
  <apex:column value="{!v.name}" />
  <apex:column value="{!v.Contact_Name__c}" />
  <apex:column value="{!v.Delivery_Address__c }" />
        
  </apex:pageBlockTable>
  </apex:pageBlockSection>
  </apex:pageBlock>
</apex:page>

Controller:
public class View_Order_Controller {
  
Public List<EOrder__C> finalOrder{get; set;}

public pageReference viewOrder()
   {
   finalOrder=[select id,name,Contact_Name__c,Delivery_Address__c from EOrder__c where Contact_Name__c='fggffh'];
   return null;
   }
   
}
Its showing empty table
Hello All, my requirement is, when user dont enter quntity in inputText on vf and try to place order then warning message should disoplay.
but its not showing warning.
VF page:
<apex:page controller="EComm_Bucket_Controller" action="{!itemInMyBucket}" >
<style>
        .myFormStyle {
            background-color: Moccasin ;
            border:2px solid Violet;
        }
    </style>
    
    <style>
  /*for page block */     
.bPageBlock{
        width : 100%;
        }
        </style>
        
        <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.0/jquery.min.js"></script>
    <script>
    $(document).ready(function(){
        $(".bPageBlock").css("background-color","Aquamarine");
        $(".bPageBlock").css("border-color","Aquamarine");
    });
    </script>
    
<apex:form styleClass="myFormStyle " >
  <apex:pageBlock title="My Bucket" >
  <apex:pageMessages > </apex:pageMessages>
  <apex:pageblockSection >
  <apex:pageBlockTable value="{!itemInBucket}" var="i">
  
    <apex:column value="{!i.name}"/>
    <apex:column value="{!i.Product_Name__c}"/>
    
    <apex:column headerValue="Quantity" >
    <apex:inputText value="{!q}" />
    </apex:column>
    
    <apex:column headerValue="Name" >
    <apex:inputText value="{!n}" />
    </apex:column>
    
    <apex:column headerValue="Address" >
    <apex:inputText value="{!a}" />
    </apex:column>
    
    <apex:Column >
    <apex:commandLink value="Place Order" action="{!placeOrderForSinglePro}">
    <apex:param name="Pname" value="{!i.Product_Name__c}"/>
    <!--<apex:param name="quantity" value="{!q}" assignTo="{!q}"/>-->
    </apex:commandLink>
    </apex:column>
    </apex:pageBlockTable> 
  </apex:pageblockSection> 
  </apex:pageBlock>
  <apex:commandLink value="View Order" action="{!openOrderPage}"/>
  <apex:commandLink value="Previous Page" style="float:right;" action="{!redirect}"/>
  </apex:form>
</apex:page>

Controller:
public class EComm_Bucket_Controller 
{  
Public List<EOrder_Item__c> itemInBucket{get; set;}
public Integer q{get; set;}
public String n{get; set;}
public String a{get; set;}

  public pageReference itemInMyBucket()
  {
     itemInBucket=[select id,name,Quantity__C,Product_Name__c from EOrder_Item__c WHERE Name!=NULL AND Flag__c=TRUE];
     System.debug('list=='+itemInBucket);
     return null;
  }
  
  //------------------Place Order Button-for single record-------------------------
  public pageReference placeOrderForSinglePro()
  {
    Id Prodname=ApexPages.currentPage().getParameters().get('Pname');
    string var = ApexPages.currentPage().getParameters().get('quantity');
  //----------to check q has value or zero
  
  
    
    EOrder__c ord=new EOrder__c(EP_del__c=Prodname,OQuantity__c=q,Contact_Name__c=n,Delivery_Address__c=a,Order_Status__c='Placed');
    if(ord.OQuantity__c==NULL)
    {
     ApexPages.addmessage(new ApexPages.message(ApexPages.severity.WARNING,'Please enter value'));
    return null;
    }
    else
    {
    insert ord;
    }
    
   //------------------show only one item on bucket page----------
    List<EOrder_Item__c> processeditemInBucket = [select id,name, Quantity__C,Product_Name__c from EOrder_Item__c WHERE Name!=NULL AND Flag__c=TRUE];
    for(EOrder_Item__c v:processeditemInBucket)
        {
            v.Flag__c =FALSE;
            
        }
      update  processeditemInBucket;
    return null;
  }
  
  //----------------------Place order for All-for multiple record-----------------------
  public PageReference placeOrderForAllPro()
  {
   return null;
  }

 public PageReference redirect()
    {
   PageReference pr = new PageReference('/apex/EComm_Landing_Page');
   return pr;
   }
   
   
   
   public PageReference openOrderPage()
    {
   PageReference pr = new PageReference('/apex/Final_Order_Page');
   return pr;
   }
}
how to change color of pagebolck on vf
how to reduce width of pageBlock and pageBlockSection on vf page
I have two object EProduct__C and EOrder__C. lookup filed on EOrder__C is EP_Del__C. and there are anather two field
Quantity__C on EProduct__C and
OQuantity__C on  EOrder__C 
I want to update Quantity on EProduct when on updation in Quantity of EOrder. update parent quantity when child quantity is updated
Hello All,
      I am new to salesforce, I am stuck with outputPanel. I look out visualforce developer guide but still i m confused about it. can anyone exaplain me, why and when to use outputPanel with better example. 
Hello All,
   I have vf page, on this i have search functionality, when i enter any product name in serch box then related products display in pageBlock  in table format. but requirement, this pageBlock should dispaly only after when we click on search button, not before.
below is my code,
<apex:commandButton value="Clear Products" action="{!clear}" style="float:right;" reRender="panel"/> 
       <apex:commandButton value="Search Products" action="{!search}" style="float:right;"/>
       <apex:inputText value="{!searchstring}" label="Input" style="float:right;"/>
       
       <!-- pageBlockTable for search result-->
       <apex:outputPanel id="panel">
        <apex:pageBlock title="Search Result"> 
        <apex:pageblockTable value="{!SerchPro}" var="a"> 
        <apex:column headerValue="Product Name">
               <apex:outputLink title="View Product Detail" onclick="return openPopUp('{!a.id}') ">
               {!a.name}
               </apex:outputLink>
               </apex:column>
         <!-- <apex:column value="{!a.Quantity__c}"/>-->
        <apex:column >
        <apex:commandLink value="Add to Bucket" action="{!AddToCartButton}">
        <apex:param name="PQuantity" value="{!a.Quantity__c}"/> 
        <apex:param name="PId" value="{!a.Id}"/>
        </apex:commandLink>
        </apex:column>
        
       </apex:pageBlockTable> 
      </apex:pageBlock> 
      </apex:outputPanel> 
I have two objects:
1)EProduct__c with field Quantity__C
2)EOrder__C with field OQuantity__c
my req. is when order get placed Quantity on product should get reduce as per quantity in order
 
Hello All.
   i want to display record on vf using pageblocktable:
vf page:
<apex:page controller="EComm_Bucket_Controller" >
<apex:form >
  <apex:pageBlock title="My Bucket" >
  <apex:pageblockSection >
  <apex:pageBlockTable value="{!itemInBucket}" var="i">
    <apex:column value="{!i.name}"/>
    <apex:column value="{!i.Product_Name__c}"/>
  </apex:pageBlockTable> 
  </apex:pageblockSection> 
  </apex:pageBlock>
  <apex:commandLink value="Previous Page" style="float:right;" action="{!redirect}"/>
  </apex:form>
</apex:page>

Controller:
public class EComm_Bucket_Controller 
{  
Public List<EOrder_Item__c> itemInBucket{get; set;}

  public pageReference itemInMyBucket()
  {
     itemInBucket=[select id, Quantity__C,Product_Name__c from EOrder_Item__c];
     System.debug('list=='+itemInBucket);
     return null;
  }

 public PageReference redirect()
    {
   PageReference pr = new PageReference('/apex/EComm_Landing_Page');
   return pr;
   }
}
but it is not showing any table or data on vf.
i have to write trigger for,
When Opportunity ‘Close Date’  is populated, should not be less than current date and time. If it is less, show an appropriate error msg.
how to do this?

 
i am trying to create contact upon account insertion
public static Account createContact()
   {   List<account> acc= new List<Account>();
       for(Account a : Trigger.new)
       {
       Contact c=new Contact();
       C.LastName='Sharma';
       c.Description=a.name;
       acc.add(c);
       } 
        insert acc;     
   }
but there is error    
unexpected token: 'Account'
Hi all,
I want to update CustomAmmount(Custom field) on parent(Opportunity) when child(OpportunityLineItem) updated
but its not working in after delete event
Trigger:
trigger UpdateCustomAmmount on OpportunityLineItem (after insert, after update, after Undelete,after delete) {
    if(Trigger.isAfter && (Trigger.isInsert || Trigger.isUpdate || Trigger.isUnDelete))
    {
    UpdateCustomAmmount_Handler.updateAmmount(Trigger.new);
    }
    
   /if(Trigger.isAfter ||Trigger.isDelete)
    {
      UpdateCustomAmmount_Handler.updateAmmount(Trigger.old);  
    }
}

Contoller:
public class UpdateCustomAmmount_Handler {
    public static void updateAmmount(List<OpportunityLineItem> olt)
    {
       
        List<Id> listIds = new List<Id>();
        system.debug('list of opp ids---'+listIds);
        
        for (OpportunityLineItem childItem : olt) {
            listIds.add(childItem.OpportunityId);
        }
        
          list<Opportunity> parentOpp = new List<Opportunity>([SELECT id, Custom_Ammount__c, Name,(SELECT ID, TotalPrice FROM OpportunityLineItems) FROM Opportunity WHERE ID IN :listIds]);
          system.debug('list of opp with child---'+parentOpp); 
          
        for(Opportunity opp:parentOpp)
               {
                   opp.Custom_Ammount__c = 0;
            for(OpportunityLineItem item:opp.OpportunityLineItems)
            {
               
                opp.Custom_Ammount__c += item.TotalPrice; 
               }
            }
        If(parentOpp.size()>0){
            update parentOpp;  
        }    
    }
}
 
can we perform dml on wrapper class list?
 i want to perform upsert operation on wrapper class list.
wrapper class dispaly two object data on vf and also able to enter data in one object on vf. n now i have to perform upsert operation on this list.
i have to pass parametet with commandbutton which is outside of table.
this is my vf: 
<apex:form styleClass="myFormStyle " >
  <center>
  <!----------------pageBlock--------------------------------------->
  <apex:pageBlock title="My Bucket"  >
  
  <apex:pageMessages id="msg"> </apex:pageMessages>
  <!-------------first section-display table and take quantity from user----------------->
  <apex:pageblockSection >
  <apex:pageBlockTable value="{!itemInBucket}" var="i">
   <apex:column value="{!i.Product_Name__c}" />
   
    <apex:column value="{!i.price__c}"  />
    
    <apex:column value="{!i.Quantity__c}" headerValue="Available Quantity"/ >
    
    <apex:column headerValue="Required Quantity" >
    <apex:commandButton value="+" action="{!incrementCounter}" reRender="bucket"/>
    <apex:inputText value="{!count}" style="width: 25px !important;" styleClass="qty " id="bucket"/>
    <apex:commandButton value="-" action="{!decrementCounter}" reRender="bucket"/>
    </apex:column>
    
    <apex:Column >
    <apex:commandLink value="Place Order" action="{!placeOrderForSinglePro}" >
    <apex:param name="Pname" value="{!i.Product_Name__c}"/>
    <apex:param name="price" value="{!i.price__c}" />
     <apex:param name="quantity" value="{!i.Quantity__c}" />
    </apex:commandLink>
    </apex:column>
    
    <apex:Column >
    <apex:commandLink value="cancel" action="{!cancelOrder}" rendered="true" >
    </apex:commandLink>
    </apex:column>
    </apex:pageBlockTable> 
    </apex:pageblockSection>
    <!---------------------second section- take address and name from user--------------->
    <apex:pageBlockSection >
    <apex:inputText value="{!n}" label="Name" />
    <apex:inputTextarea title="Address" value="{!a}" label="Address"/>
    </apex:pageBlockSection>
   
   <!---------------commandButton is in pageBlock------------------------------->
   <apex:commandButton value="Place Order for All Products" action="{!placeOrderForAllPro}"/>
  </apex:pageBlock>
  </center>
  
  <apex:commandLink value="View Order" action="{!openOrderPage}"/>
  <apex:commandLink value="Previous Page" style="float:right;" action="{!redirect}"/>
  </apex:form>
</apex:page>

here i am taking quantity name and address from user and storing all that into Order__C object. now my inputFileds are in diffrent pageBlockSection and my command button is in pageBlock. so how can i insert  that  to Order__c when i click on commandButton.
I have to pass quantity and  price of product with commandbutton which is out of pageBlockTable.
<center> <!--------------category selection result-------------->
              <apex:pageBlock rendered="{!showpageblocktable}" >
              <center>
              <apex:pageBlockTable value="{!selectedProWrapper}" var="p" >
             
             <apex:column style="width:25%">
                    <apex:inputCheckBox value="{!p.selected}"/>
               </apex:column>
               
               <apex:column style="width:25%" headerValue="Product Name">
               <apex:outputLink title="View Product Detail" onclick="return openPopUp('{!p.Eprod.id}') ">
               {!p.Eprod.name}
               </apex:outputLink>
               </apex:column>
               
              <apex:column headerValue=" Image">
                <apex:outputText value="{!p.Eprod.Image__c}" escape="false" />
              </apex:column>
             
               <apex:column value="{!p.Eprod.Price__c}"/>
               
               <apex:column value="{!p.Eprod.Quantity__c}"/>
               
               <apex:Column style="width:25%">
               <apex:commandLink value="Add to Bucket" action="{!AddToCartButton}" >
               <apex:param name="PQuantity" value="{!p.Eprod.Quantity__c}"/>
               <apex:param name="price" value="{!p.Eprod.Price__c}"/> 
               <apex:param name="PId" value="{!p.Eprod.Id}"/>
               </apex:commandLink>
               </apex:column>
                             
              </apex:pageBlockTable>
              </center>
              <!--@@@@@@@@@@ here i have to pass quantity and price @@@@@@------->
              <apex:commandButton value="Add All to Bucket" action="{!AddToCartButton}" >
              <apex:param name="PQuantity" value="{!p.Eprod.Quantity__c}"/>
               <apex:param name="price" value="{!p.Eprod.Price__c}"/> 
               <apex:param name="PId" value="{!p.Eprod.Id}"/>
              </apex:commandButton>
              </apex:pageBlock>
              </center>
                              
    </apex:form>
</apex:page>

but i am getting error:
Error: Unknown property 'Landing_Page_Controller.p'    becoz this commandButton is outside of pageBlockTable and 'P' is variable of pageBlockTable. so how i can do this?
I have to display product image in pageBlockTable:
vf:
<apex:column>
                  <apex:image value="servlet/servlet.FileDownload?file={!p.Image__c}" height="50" width="50"/>
</apex:column>
image is stored in document:
url--https://c.ap6.content.force.com/servlet/servlet.FileDownload?file=0150K000006JMkx 

but image is not displaying in columns properly

 
Hello, 
I have visualforce page, that recive input value from user. page have twi fields inputText(name),inputText(name) and InputTextArea(Address),
i want to add validation that, when user click on save button, these three fields should not empty.
public class EComm_Bucket_Controller 
{public String n{get; set;}
public String a{get; set;}
public Integer q{get; set;}

public pageReference placeOrderForSinglePro()
  {
    Id Prodname=ApexPages.currentPage().getParameters().get('Pname');
    Decimal Proprice = Decimal.valueOf(ApexPages.currentPage().getParameters().get('price'));
   if(!(n!=null))
   {
   
    ApexPages.addmessage(new ApexPages.message(ApexPages.severity.WARNING,'Please enter value'));
   }else
   {
    EOrder__c ord=new EOrder__c(EP_del__c=Prodname,
                                OQuantity__c=q,
                                Contact_Name__c=n,
                                Delivery_Address__c=a,
                                Order_Status__c='Placed',
                                Total_Order_Ammount__c=q*Proprice );
    insert ord;
    }
}

I have added <apex:pageMessage> on vf. but its not working. i have to check for 3 fields. Oquantity is number field. 
Hello All,
   I have vf page, on this i have search functionality, when i enter any product name in serch box then related products display in pageBlock  in table format. but requirement, this pageBlock should dispaly only after when we click on search button, not before.
below is my code,
<apex:commandButton value="Clear Products" action="{!clear}" style="float:right;" reRender="panel"/> 
       <apex:commandButton value="Search Products" action="{!search}" style="float:right;"/>
       <apex:inputText value="{!searchstring}" label="Input" style="float:right;"/>
       
       <!-- pageBlockTable for search result-->
       <apex:outputPanel id="panel">
        <apex:pageBlock title="Search Result"> 
        <apex:pageblockTable value="{!SerchPro}" var="a"> 
        <apex:column headerValue="Product Name">
               <apex:outputLink title="View Product Detail" onclick="return openPopUp('{!a.id}') ">
               {!a.name}
               </apex:outputLink>
               </apex:column>
         <!-- <apex:column value="{!a.Quantity__c}"/>-->
        <apex:column >
        <apex:commandLink value="Add to Bucket" action="{!AddToCartButton}">
        <apex:param name="PQuantity" value="{!a.Quantity__c}"/> 
        <apex:param name="PId" value="{!a.Id}"/>
        </apex:commandLink>
        </apex:column>
        
       </apex:pageBlockTable> 
      </apex:pageBlock> 
      </apex:outputPanel> 
I have two objects:
1)EProduct__c with field Quantity__C
2)EOrder__C with field OQuantity__c
my req. is when order get placed Quantity on product should get reduce as per quantity in order
 
i want to write trigger to popolate account owner name into SalesRep__c(Text) field on the account object.
can we update lookup field value by workflow rule?