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
SFDCU$erSFDCU$er 

Create/View Comment

I want to create a custom "Create/View comment" Page where the user can create new comment as well as view all his previous comments.

ViewComment Page:


     <apex:dataTable value="{!commentdata}" var="comments">     
             
              <apex:column headerValue="Title">
                <apex:inputText value="{!title}"/>
              </apex:column>
             
     <apex:column headerValue="Comment Section">
              <apex:inputText value="{!Comment}"/>
               
              </apex:column>
              <apex:column headerValue="CreatedBy">
              <apex:inputText value="{!CreatedBy}"/>
              </apex:column>
              </apex:dataTable>
    
     <apex:column headerValue="Timestamp">
                <apex:inputText value="{!timestamp}"/>
              </apex:column>
          <apex:commandButton value="New comment" onclick="PopUp(); return false"/> //when the user clicks on this button it would open up a pop up where the user can enter the comment and click save

CretaeComment Page :

    <apex:inputTextarea value="{!Comment}"/>
    <apex:commandbutton value="Save" action="{!savecomment}"/>

When the user clicks on the save button it should update the view comment datatable on the ViewComment page and the new comment will always be on top.

how do I save value from one page to another? Here the comments are not getting stored on any salesforce custom/standard objects. It is temporarily saved on the view state. I want to save it in such a way that the recent comment should be at the top.  Any help would be appreciated.
Sri549Sri549
Hello YnaTp1,

As per requirment its very easier one that,i can suggest you to get the latest created in the  top as in query like order  by created date desc so all the records dynamically will be showing up in top where ever you are creating at any time.

related to saving your comment ,if you tel e your requirment ellaboratedly i may help you and you may achieve it.

Thanks
Srinivas
Sri549Sri549
Hello,
So your asking that with out storing any where and only temporaryly storing in view state.next what are going to achieve.

whats your task ?? please kindly explain me that?.so that i may help you.


Thanks
Srinivas