0% found this document useful (0 votes)
29 views1 page

Invoice Management with Apex CommandButton

The InvoiceLines class creates a list of InvoiceWrap objects and adds 3 of them to the invoices list. It has a show method that clears the invoices list and adds only the InvoiceWrap objects where the flag is true. The Visualforce page uses an InvoiceLines controller and displays a page block table to edit the invoices list, with a command button to call the show method.

Uploaded by

R P
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
29 views1 page

Invoice Management with Apex CommandButton

The InvoiceLines class creates a list of InvoiceWrap objects and adds 3 of them to the invoices list. It has a show method that clears the invoices list and adds only the InvoiceWrap objects where the flag is true. The Visualforce page uses an InvoiceLines controller and displays a page block table to edit the invoices list, with a command button to call the show method.

Uploaded by

R P
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

public class InvoiceLines {

public List<InvoiceWrap> invoices {set;get;}


public InvoiceLines(){
invoices=new List<InvoiceWrap>();
for(Integer i=1;i<=3;i++){
InvoiceWrap iw=new InvoiceWrap();
[Link](iw);
}
}
public void show(){
List<InvoiceWrap> selected=new List<InvoiceWrap>();
for(InvoiceWrap iw:invoices){
if([Link]==true){
[Link](iw);
}
}
[Link]();
[Link](selected);
}
}

Visualforce Page :

<apex:page controller="InvoiceLines">
<apex:form >
<apex:pageBlock >
<apex:pageBlockButtons >
<apex:commandButton value="Submit" action="{!show}" />
</apex:pageBlockButtons>
<apex:pageBlockTable value="{!invoices}" var="a">
<apex:column >
<apex:facet name="header"><apex:inputCheckBox /></apex:facet>
<apex:inputCheckBox value="{![Link]}" />
</apex:column>
<apex:column headerValue="InvoiceNo">
<apex:inputText value="{![Link]}" />
</apex:column>
<apex:column headervalue="Amount" >
<apex:inputText value="{![Link]}" />
</apex:column>
<apex:column headerValue="Tax" >
<apex:inputText value="{![Link]}" />
</apex:column>
</apex:pageBlockTable>
</apex:pageBlock>
</apex:form>
</apex:page>

You might also like