Advertisement
Guest User

Untitled

a guest
Jul 30th, 2014
227
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.17 KB | None | 0 0
  1. <apex:page standardcontroller="Learning_Review__c" extensions="LearningReviewPageController" showHeader="false" sideBar="false" action="{!initReviewPage}">
  2.  
  3. <apex:includeScript value="{!URLFOR($Resource.jQuery, '/js/jquery-1.10.2.js')}"/>
  4. <apex:includeScript value="{!URLFOR($Resource.jQuery, '/js/jquery-ui-1.10.4.custom.min.js')}"/>
  5. <apex:stylesheet value="{!URLFOR($Resource.jQuery, '/css/ui-lightness/jquery-ui-1.10.4.custom.css')}"/>
  6.  
  7. <apex:pageMessages id="msg"/>
  8. <apex:form id="createReview">
  9. <apex:pageBlock title="Review for {!LIName}?" mode="edit">
  10.  
  11. <apex:pageBlockButtons ><apex:outputPanel id="buttons">
  12. <apex:commandButton rendered="{!reviewed=FALSE}" value="Add Review" action="{!saveReview}" status="closer" rerender="statusMsg, buttons, msg"/>
  13. <apex:commandButton value="Cancel" onclick="window.close()"/>
  14. <apex:actionStatus startText="(Thank you for your review.)" stopText="" onStop="MyCloseWindow();" id="closer">
  15. <apex:facet name="start">
  16. <apex:outputPanel style="margin: 0 10px;">
  17. <apex:image url="/img/loading.gif"/>
  18. </apex:outputPanel>
  19. </apex:facet>
  20. </apex:actionStatus>
  21. </apex:outputPanel>
  22. </apex:pageBlockButtons>
  23.  
  24. <apex:pageBlockSection rendered="{!reviewed=FALSE}" title="Review Information" columns="1" id="pbs">
  25. <apex:outputPanel id="RatingImport" >
  26. <apex:outputLabel value="Your Rating" for="RatingRepeat"/>
  27. <apex:repeat value="{!Nodes}" var="node" id="RatingRepeat">
  28. <apex:commandLink action="{!SaveRating}" rerender="RatingImport" title="{!node.Rights__c}">
  29. <apex:param name="Location" assignTo="{!Location}" value="{!node.Isbn__c}" />
  30. <apex:image url="{!node.lmscons__Version__c}" />
  31. </apex:commandLink>
  32. </apex:repeat>
  33. </apex:outputPanel>
  34. <apex:inputfield id="title" value="{!Learning_Review__c.Review_Title__c}"/>
  35. <apex:inputTextarea id="review" value="{!Learning_Review__c.Review__c}" rows="10"/>
  36. <apex:inputfield id="anon" value="{!Learning_Review__c.isAnon__c}" label="Make Comments Confidential"/>
  37. <apex:inputHidden id="statusMsg" value="{!reviewedMsg}"/>
  38. <script>
  39. var status = document.getElementById('{!$Component.statusMsg}');
  40. </script>
  41. </apex:pageBlockSection>
  42. </apex:pageBlock>
  43. </apex:form>
  44. <script type="text/javascript">
  45. function MyCloseWindow() {
  46.  
  47. alert(status.value);
  48. if(status.value == 'Saved'){
  49. window.opener.refreshTable();
  50. self.close();
  51.  
  52. }
  53. }
  54. </script>
  55.  
  56. public LearningReviewPageController(apexpages.Standardcontroller con){
  57. master_sc = con;
  58. location = 0;
  59. newReview = (Learning_Review__c)con.getRecord();
  60. reviewedMsg = 'Not';
  61. }
  62. // save the new rating and reload the page
  63. public PageReference SaveRating() {
  64. CurrentRating = Location;
  65. system.debug(' n ----------> CurrentRating in SaveRating = ' + CurrentRating);
  66. getNodes();
  67. reviewedMsg = 'Saved';
  68. return null;
  69. }
  70.  
  71. public PageReference saveReview(){
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement