Guest User

Untitled

a guest
Jan 24th, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.29 KB | None | 0 0
  1. <apex:page>
  2. <apex:outputPanel id="blockPanel">
  3. <c:subBlockCmp projectObject="{!projectObject}" />
  4. </apex:outputPanel>
  5. </apex:page>
  6. -----------------------------------------------
  7.  
  8. <apex:component controller="ProjectController" language="{!LOWER(projectObject.Primary_Contact__r.Language_Selected__c)}" >
  9. <script>
  10. window.onload = function() {
  11. reloadLabel();
  12. }
  13. </script>
  14. <apex:outputPanel rendered="true">
  15.  
  16. <apex:attribute name="projectObject" type="ProjectObject__c" description="This is the projectObject attribute for the component."/>
  17.  
  18. <apex:actionFunction action="{!reloadLabel}" name="reloadLabel" rerender="blockPanel"/>
  19.  
  20. <apex:outputPanel>
  21. <apex:inputTextarea value="{!projectObject.SampleText__c}"/>
  22. </apex:outputPanel>
  23.  
  24. </apex:outputPanel>
  25.  
  26. </apex:component>
  27.  
  28. public class ProjectController{
  29.  
  30. public ProjectObject__c projectObject;
  31.  
  32. public ProjectController(){
  33. projectObject = new ProjectObject__c();
  34. projectObject.SampleText__c = Label.SampleText;
  35. }
  36.  
  37. public void reloadLabel(){
  38. // Label.SampleText with the changed language attribute in the component
  39. projectObject.SampleText__c = Label.SampleText;
  40. }
  41. }
Add Comment
Please, Sign In to add comment