Package javax.faces.context

Examples of javax.faces.context.FacesContext.addMessage()


        facesContext.addMessage(null, new FacesMessage("Toggle node: " + getNodeData() + ", source is: " + event.getSource()));
    }

    public void behaviorSelectionChangeListener(AjaxBehaviorEvent event) {
        FacesContext facesContext = FacesContext.getCurrentInstance();
        facesContext.addMessage(event.getComponent().getClientId(facesContext), new FacesMessage(
                "Selection changed, source is: " + event.getSource()));
    }

    public void processSelectionChange(TreeSelectionChangeEvent event) {
        new SelectionChangeHandler(true).processTreeSelectionChange(event);
View Full Code Here


        }

        public void processTreeSelectionChange(TreeSelectionChangeEvent event) throws AbortProcessingException {
            FacesContext facesContext = FacesContext.getCurrentInstance();

            facesContext.addMessage(getTree(event).getClientId(facesContext), createEventMessage(event, fromExpression));
        }
    }

    public static final class ToggleHandler implements TreeToggleListener {
        private boolean fromExpression = false;
View Full Code Here

            this.fromExpression = fromExpression;
        }

        public void processTreeToggle(TreeToggleEvent event) throws AbortProcessingException {
            FacesContext facesContext = FacesContext.getCurrentInstance();
            facesContext.addMessage(getTree(event).getClientId(facesContext), createEventMessage(event, fromExpression));
        }
    }

    private static final long serialVersionUID = 3368885134614548497L;
    private static final Logger LOGGER = LogFactory.getLogger(TreeBean.class);
View Full Code Here

    }

    public void processClick() {
        FacesContext context = FacesContext.getCurrentInstance();

        context.addMessage(null, new FacesMessage(getPath()));
    }

    public String toString() {
        return getClass().getSimpleName() + " [" + getName() + "]";
    }
View Full Code Here

            private static final long serialVersionUID = 1L;

            @BeforePhase(Phase.RENDER_RESPONSE)
            public void addGlobalMessage() {
                FacesContext context = FacesContext.getCurrentInstance();
                context.addMessage(null, new FacesMessage("global message"));
            }

            @AfterPhase(Phase.RENDER_RESPONSE)
            public void verifyGlobalMessageIsIgnored() {
                FacesContext context = FacesContext.getCurrentInstance();
View Full Code Here

* @author Huynh Kim Toan
*/
public class messages {
public static void taoTB(Severity s,String tieuDe,String noiDung){
        FacesContext context = FacesContext.getCurrentInstance();
        context.addMessage(null,new FacesMessage(s,tieuDe,noiDung));
    }
}
View Full Code Here

    {
      FacesMessage errorMessage = new FacesMessage(FacesMessage.SEVERITY_ERROR,
                                                   e.getMessage(), null);

      FacesContext context = FacesContext.getCurrentInstance();
    context.addMessage(null, errorMessage);

      return null;
    }

    return "success";
View Full Code Here

          method.invoke(context.getELContext(), new Object[]{context, out});
        }
        catch (Exception e)
        {
          FacesMessage error = MessageFactory.getMessage(e);
          context.addMessage(null, error);
          throw e;
        }
        out.close();
        
      }
View Full Code Here

      catch (Exception e)
      {
        hsr.reset();
        _LOG.warning(e);      
        FacesMessage message = MessageFactory.getMessage(context, DOWNLOAD_MESSAGE_ID);
        context.addMessage(null, message);
        context.renderResponse();
        return;
      }
    }
   
View Full Code Here

            facesMessageHolderList = validationResult.getFacesMessageHolderList();
            sortFacesMessageHolderList(facesMessageHolderList);

            for(FacesMessageHolder facesMessageHolder : facesMessageHolderList)
            {
                facesContext.addMessage(facesMessageHolder.getClientId(), facesMessageHolder.getFacesMessage());
            }
        }
    }

    private void sortFacesMessageHolderList(List<FacesMessageHolder> facesMessageHolderList)
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.