+ Start a Discussion

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 headerValue="Comment Section">
              <apex:inputText value="{!Comment}"/>
              <apex:column headerValue="CreatedBy">
              <apex:inputText value="{!CreatedBy}"/>
     <apex:column headerValue="Timestamp">
                <apex:inputText value="{!timestamp}"/>
          <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.
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.

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.