• piyush316
  • NEWBIE
  • 0 Points
  • Member since 2010

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 3
    Replies

This is my code in which im able to add a new row on click of the Add button..

 

1) I have a delete button for each row whenever the row is add..

2) I want to delete a particular row when i click the delete button....

3) Can i make use of indexes to get the particular row id to delete a particular row..How can i achieve the delete functionality

 

 

<!-- This is my visual force page-->

 

<apex:page standardController="Account" extensions="adddel">
    <apex:form >
        <apex:pageBlock >
       
            <apex:pageBlockButtons >
                <apex:commandButton value="Save" action="{!save}" rerender="error"/>
                <apex:commandButton value="Add Row" action="{!addRow}" rerender="table,error"/>
            </apex:pageBlockButtons>
       
       
       
            <apex:pageBlockTable value="{!accts}" var="a" id="table" >
                <apex:column >
                    <apex:commandButton value="Del Row" action="{!delRow}" rerender="table,error"/>
                </apex:column> 
       
                <apex:column headerValue="Name">
                    <apex:inputField value="{!a.Name}"/>
                </apex:column>
               
                              
                 <apex:column headerValue="Phone">
                    <apex:inputField value="{!a.Phone}"/>
                </apex:column>          
            </apex:pageBlockTable>
           
        </apex:pageBlock>
    </apex:form>
</apex:page>

 

 

<!--This is My Controller Class-->

 

public class adddel
{

    public List<Account> accts {get; set;}
   
   
    public adddel(ApexPages.StandardController ctlr)
    {
        accts = new List<Account>();
        accts.add(new Account());
       
    }
   
   
   
    public void addrow()
    {
        accts.add(new Account());
    }
   
   public void delrow()
   {
       

   }
   
    public PageReference save()
    {
        insert accts;
        //PageReference home = new PageReference('/home/home.jsp');
           //home.setRedirect(true);
        return null;
    }

}

Hi all,

 

Wondered where would be the best place to test SOQL queries? I need to run some simple queries such as below [Select u.Contact.AccountId From User u where id = :uid and contactid != null]; and need to see the return results...

 

Many thanks, 

  • February 15, 2010
  • Like
  • 0
 I have newly installed eclipse Unable to see File > New > Force.com Project in eclipse there are several other projects but I dont see force.com project