I'm having a page(say VF1) and in another page(VF2) I'm getting all the values of page1.Here my problem is in my page1 Im having repeated values and need to save them
In my VF1
<apex:dataTable value="{!items}" var="item" style="margin-left:60px;" >
<apex:column headervalue="Payment For"></apex:column >
{!item.iTemname}
<apex:column headervalue="Unit Price"></apex:column >
{!item.unitprice}
</apex:dataTable>
and class
public list<string> items{get;set;}
public string itemlist{get;set;}
items.add(itemlist);
I have written it in second page as
<apex:dataTable value="{!items}" var="item" style="margin-left:60px;" >
<apex:column headervalue="Payment For"></apex:column >
{!item.payfor}
<apex:column headervalue="Unit Price"></apex:column >
{!item.price}
</apex:dataTable>
and in my constructor
tempinvoiceid = apexpages.currentpage().getparameters().get('tempinvoiceid');
List<object__c> tempin =[select item_name__c,price__c from object__c where id=:tempinvoiceid];
for(integer i=0;i<items.size();i++){
payfor = tempin[i].Item_Name__c;
price = tempin[i].price__c;
}
then getting error as Unknown property 'string.payfor' How should I display in my Page2....Any Help!!!!
Attribution to: Eagerin Sf
Possible Suggestion/Solution #1
<apex:dataTable value="{!items}" var="item" style="margin-left:60px;" >
<apex:column headervalue="Payment For"></apex:column >
{!tempin.Item_Name__c}
<apex:column headervalue="Unit Price"></apex:column >
{!tempin.price__c}
</apex:dataTable>
In the controller make a getter and setter of the List of object you want to show data of .
Attribution to: Mohith Shrivastava
This content is remixed from stackoverflow or stackexchange. Please visit https://salesforce.stackexchange.com/questions/4541