fork download
  1. <apex:page controller="AccountTransactionController">
  2. <style>
  3. .highlight-green {
  4. background-color: #4CAF50;
  5. color: white;
  6. }
  7. </style>
  8. <apex:form>
  9. <apex:pageMessages />
  10. <apex:pageBlock title="Account Transaction">
  11. <apex:pageBlockSection>
  12. <apex:inputText value="{!accountNumber}" label="Account Number"/>
  13. <apex:commandButton value="Check Account" action="{!checkAccount}" rerender="transactionSection, errorMessages"/>
  14. </apex:pageBlockSection>
  15. <apex:outputPanel id="transactionSection">
  16. <apex:pageBlockSection rendered="{!accountExists}">
  17. <apex:outputText value="Account Balance: {!accountBalance}"/>
  18. <apex:selectRadio value="{!transactionType}">
  19. <apex:selectOption itemLabel="Debit" itemValue="Debit"/>
  20. <apex:selectOption itemLabel="Credit" itemValue="Credit"/>
  21. </apex:selectRadio>
  22. <apex:inputText value="{!transactionAmount}" label="Transaction Amount"/>
  23. <apex:commandButton value="Submit" action="{!performTransaction}" rerender="transactionSection, transactionList"/>
  24. </apex:pageBlockSection>
  25. </apex:outputPanel>
  26. <apex:outputPanel id="errorMessages">
  27. <apex:pageMessages />
  28. </apex:outputPanel>
  29. <apex:outputPanel id="transactionList">
  30. <apex:pageBlockSection title="Last Transactions">
  31. <apex:dataTable value="{!lastTransactions}" var="transaction">
  32. <apex:column headerValue="Transaction Date" value="{!transaction.Date__c}"/>
  33. <apex:column headerValue="Transaction Type" value="{!transaction.Type__c}"/>
  34. <apex:column headerValue="Amount" value="{!transaction.Amount__c}"/>
  35. <apex:column styleClass="{!IF(transaction.Id == lastTransactionId, 'highlight-green', '')}">
  36. <apex:facet name="header">Last Transaction</apex:facet>
  37. </apex:column>
  38. </apex:dataTable>
  39. </apex:pageBlockSection>
  40. </apex:outputPanel>
  41. </apex:pageBlock>
  42. </apex:form>
  43. </apex:page>
  44.  
Success #stdin #stdout #stderr 0.01s 7800KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
./prog:1: expected expression