Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script language="javascript">
- function displayMsg() {
- setwindowOverlayPos('popup_window', - 100, - 150);
- }
- window.onload = function () {
- // this is the enum value I want to check. if the value is cust1 , I call the popup window.
- var cust1= '#{myBean.customerType.custType == "cust1"}';
- if(cust1){
- displayMsg();
- }
- }
- </script>
- public enum CustomerTypeEnum {
- CUST1("CUST1"),
- CUST2("CUST2");
- private String custType;
- private CustomerTypeEnum(String s) {
- custType = s;
- }
- /**
- * @return customer type
- */
- public String CustomerTypeEnum() {
- return custType;
- }
- @ManagedBean(name = "home")
- @ViewScoped
- public class HomeBean extends BaseOrderStepBean {
- private CustomerTypeEnum customerType;
- public void method1(){
- customerType = CustomerTypeEnum.CUST1;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement