Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 1

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();
invoices.add(iw);
}
}
public void show(){
List<InvoiceWrap> selected=new List<InvoiceWrap>();
for(InvoiceWrap iw:invoices){
if(iw.flag==true){
selected.add(iw);
}
}
invoices.clear();
invoices.addAll(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="{!a.flag}" />
</apex:column>
<apex:column headerValue="InvoiceNo">
<apex:inputText value="{!a.invNo}" />
</apex:column>
<apex:column headervalue="Amount" >
<apex:inputText value="{!a.amount}" />
</apex:column>
<apex:column headerValue="Tax" >
<apex:inputText value="{!a.tax}" />
</apex:column>
</apex:pageBlockTable>
</apex:pageBlock>
</apex:form>
</apex:page>

You might also like