Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <apex:page standardcontroller="Learning_Review__c" extensions="LearningReviewPageController" showHeader="false" sideBar="false" action="{!initReviewPage}">
- <apex:includeScript value="{!URLFOR($Resource.jQuery, '/js/jquery-1.10.2.js')}"/>
- <apex:includeScript value="{!URLFOR($Resource.jQuery, '/js/jquery-ui-1.10.4.custom.min.js')}"/>
- <apex:stylesheet value="{!URLFOR($Resource.jQuery, '/css/ui-lightness/jquery-ui-1.10.4.custom.css')}"/>
- <apex:pageMessages id="msg"/>
- <apex:form id="createReview">
- <apex:pageBlock title="Review for {!LIName}?" mode="edit">
- <apex:pageBlockButtons ><apex:outputPanel id="buttons">
- <apex:commandButton rendered="{!reviewed=FALSE}" value="Add Review" action="{!saveReview}" status="closer" rerender="statusMsg, buttons, msg"/>
- <apex:commandButton value="Cancel" onclick="window.close()"/>
- <apex:actionStatus startText="(Thank you for your review.)" stopText="" onStop="MyCloseWindow();" id="closer">
- <apex:facet name="start">
- <apex:outputPanel style="margin: 0 10px;">
- <apex:image url="/img/loading.gif"/>
- </apex:outputPanel>
- </apex:facet>
- </apex:actionStatus>
- </apex:outputPanel>
- </apex:pageBlockButtons>
- <apex:pageBlockSection rendered="{!reviewed=FALSE}" title="Review Information" columns="1" id="pbs">
- <apex:outputPanel id="RatingImport" >
- <apex:outputLabel value="Your Rating" for="RatingRepeat"/>
- <apex:repeat value="{!Nodes}" var="node" id="RatingRepeat">
- <apex:commandLink action="{!SaveRating}" rerender="RatingImport" title="{!node.Rights__c}">
- <apex:param name="Location" assignTo="{!Location}" value="{!node.Isbn__c}" />
- <apex:image url="{!node.lmscons__Version__c}" />
- </apex:commandLink>
- </apex:repeat>
- </apex:outputPanel>
- <apex:inputfield id="title" value="{!Learning_Review__c.Review_Title__c}"/>
- <apex:inputTextarea id="review" value="{!Learning_Review__c.Review__c}" rows="10"/>
- <apex:inputfield id="anon" value="{!Learning_Review__c.isAnon__c}" label="Make Comments Confidential"/>
- <apex:inputHidden id="statusMsg" value="{!reviewedMsg}"/>
- <script>
- var status = document.getElementById('{!$Component.statusMsg}');
- </script>
- </apex:pageBlockSection>
- </apex:pageBlock>
- </apex:form>
- <script type="text/javascript">
- function MyCloseWindow() {
- alert(status.value);
- if(status.value == 'Saved'){
- window.opener.refreshTable();
- self.close();
- }
- }
- </script>
- public LearningReviewPageController(apexpages.Standardcontroller con){
- master_sc = con;
- location = 0;
- newReview = (Learning_Review__c)con.getRecord();
- reviewedMsg = 'Not';
- }
- // save the new rating and reload the page
- public PageReference SaveRating() {
- CurrentRating = Location;
- system.debug(' n ----------> CurrentRating in SaveRating = ' + CurrentRating);
- getNodes();
- reviewedMsg = 'Saved';
- return null;
- }
- public PageReference saveReview(){
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement