function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
JBabuJBabu 

To show values in visualforce page

Hi,

 

I have a visualforce page. Where it accepts opportunities (20 opportunities) .

I have used inputfield for this to accept opportunities.I am storing first 10 opportunties in str1 and 2nd 10  in str2 (with comma seperated values in each of the strings).

 

These are getting saved in the opportunity table in str1 and str2 columns. But when I refresh the page I dont see the values which I stored in the earlier run in the VF page. I mean the values which are stored are not displayed.

 

My requirement is when I come to the page newly/refresh the page I need to see the values which I stored earlier and I need to edit them (if needed).

 

VF Page:

 

    <apex:page standardController="Opportunity" extensions="VisualForceBigOpportunityExtension" title="Edit Big Opportunity">
    <apex:sectionHeader title="Edit Big Opportunitys"/><apex:pageMessages ></apex:pageMessages>
        <apex:form >
        <apex:pageBlock title="Big Opportunitys" mode="detail">
            <apex:pageBlockButtons >
                <apex:commandButton action="{!save}" value="Save"/>
                <apex:commandButton action="{!cancel}" value="Cancel"/>
            </apex:pageBlockButtons>
            <apex:pageBlockSection title="Big Opportunitys" collapsible="true" columns="1">
                <apex:pageBlockTable value="{!BigOpportunity}" var="BigOpportunity" columns="2">
                  <apex:column headerValue="Opportunity">
                        <apex:inputField value="{!BigOpportunity.Opportunity1__c}"/>
                 </apex:column>
                 <apex:column headerValue="Opportunity">
                        <apex:inputField value="{!BigOpportunity.Opportunity2__c}"/>
                 </apex:column>
       </apex:pageBlockTable>
     </apex:page>          

 

Please let me know where I am missing things.

 

Thanks,

JBabu.

 

 

Suresh RaghuramSuresh Raghuram

from your post what i understand is your are storing values by inputField tag, 

And you want to see the values that are stored ,

 

But where are you retrieving the values on to the VF page,

 

for example in using ouput field or a page block table retrive values 

 

If my understanding is wrong plz correct me lets sort out this together

 

JBabuJBabu

Hi Suree,

 

I am accepting values through input field. After data is saved, is there any way I can output stored data on the same place ? (where values are stored and which can be editable) - this output needs to be shown when I open the same VF page/or refresh the page after saving data.

 

 

Thanks,

JBabu.

chirugantachiruganta

inorder to display the list of oppoertunities,

 

List<Opportunity> opp=new List<Opportunity>();

public List<Opportunity> getopplist()

{

return opp;

}

 vf page:

 

<apex:pageblocktable value="{!opplist}" var="ol">

<apex:column>

<apex:commandlink action={!yourfunctioname} />

<apex:commandlink action={!yourfuncname} />

</apex:column>

 

<apex:column>

<apex:outputtext value="{ol.Name}" />

</apex:column>

 

<apex:column>

<apex:outputtext value="{!ol.fieldname}" />

</apex:column>

</apex:pageblocktable>

</apex:pageblocksection>

 

 

 

it will display the values what you have entered and write the function for the edit method by taking the id using script .

i think u got the sollution

Suresh RaghuramSuresh Raghuram

you are saving and also want to edit them with in the same page you can do this as follows.

 

 

when you are saving that is your current process place it under the following condition

public boolean editmode = false;

 

If(editMode == false){

do the current process which you are doing for the save process.

 

}else{

retrieve the fields which you were used for save using (but in edit mode)

}

 

 

JBabuJBabu

Hi Suree,

 

We can retrieve the fields using outputfield but there output will be like read-only not editable.

How do I make that editable?

 

Thanks,

JBabu.

JBabuJBabu

Hi Chiruganta,

 

Is there is any easier method, I mean instead of java scripts can we display the output at the same input field area?

So that it can be used for future edits.

 

Thanks,

JBabu.