Advertisement
Guest User

Untitled

a guest
Nov 26th, 2014
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. <script language="javascript">
  2.  
  3. function displayMsg() {
  4. setwindowOverlayPos('popup_window', - 100, - 150);
  5. }
  6.  
  7. window.onload = function () {
  8.  
  9. // this is the enum value I want to check. if the value is cust1 , I call the popup window.
  10.  
  11. var cust1= '#{myBean.customerType.custType == "cust1"}';
  12.  
  13. if(cust1){
  14. displayMsg();
  15. }
  16.  
  17. }
  18. </script>
  19.  
  20. public enum CustomerTypeEnum {
  21.  
  22.  
  23. CUST1("CUST1"),
  24. CUST2("CUST2");
  25.  
  26. private String custType;
  27.  
  28. private CustomerTypeEnum(String s) {
  29. custType = s;
  30. }
  31.  
  32. /**
  33. * @return customer type
  34. */
  35. public String CustomerTypeEnum() {
  36. return custType;
  37. }
  38.  
  39. @ManagedBean(name = "home")
  40. @ViewScoped
  41. public class HomeBean extends BaseOrderStepBean {
  42.  
  43. private CustomerTypeEnum customerType;
  44.  
  45. public void method1(){
  46.  
  47. customerType = CustomerTypeEnum.CUST1;
  48. }
  49.  
  50.  
  51. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement