MethodExpression with CommandLink dont work

UI Components for JSF
Post Reply
shakeman
Posts: 3
Joined: 28 Feb 2014, 19:24

24 Oct 2014, 18:28

I cant do this work
I read many blogs but any can help me...

please somebody coud help me....


CommandLink

Code: Select all

    private CommandLink creaBottonImage(String urlImage,String id){
        GraphicImage gi=new GraphicImage();
        gi.setUrl(urlImage);
        
        CommandLink cl=new CommandLink();
        cl.setId(id);
        cl.getChildren().add(gi);
        FacesContext fc=FacesContext.getCurrentInstance();
        Application ap=fc.getApplication();
        MethodExpression methodExpression = ap.getExpressionFactory().createMethodExpression(
                FacesContext.getCurrentInstance().getELContext(),
                "#{motorHTML.create}",
                null,
                new Class[0]);
        cl.setActionExpression(methodExpression);
        return cl;
    }

Method Executed

Code: Select all

    public void create(){
        System.out.println("!!!-->>>>>method Works !!!!! ");
    }

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 23 guests