1

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!!!!

2
  • Not sure what you want. But I guess you are Listing all the items in first page and when user is clicking the same you are redirecting the user to a second page. This is what you want?
    – Avidev9
    Commented Nov 19, 2012 at 12:18
  • yes absolutely right.....I'm having two objects object1__c & object2__c with lookup relationship and i'll be inserting values in page1.now need to get the values in page2
    – Eagerin Sf
    Commented Nov 19, 2012 at 13:15

1 Answer 1

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 .

3
  • if you don't mind can u tell me how can I get the values from page1 to page2 of itemname and Unitprice
    – Eagerin Sf
    Commented Nov 19, 2012 at 9:42
  • You can use components to get that Commented Nov 19, 2012 at 10:07
  • <apex:component> tag Commented Nov 19, 2012 at 10:07

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .