コード例 #1
0
 public void afterPhase(PhaseEvent event) {
   FacesContext facesContext = event.getFacesContext();
   AddResource addResource = AddResourceFactory.getInstance(facesContext);
   String jsTxt = genJavaScriptCodeForMessages(facesContext);
   if (jsTxt != null) {
     addResource.addInlineScriptAtPosition(facesContext, AddResource.HEADER_BEGIN, jsTxt);
   }
 }
コード例 #2
0
  private static void addReferences(FacesContext facesContext, AddResource addResource) {

    //        addBodyEndJavaScriptRef(facesContext, addResource, "prototype.js");
    //        addBodyEndJavaScriptRef(facesContext, addResource, "fx4web.js");
    addJavaScriptRef(facesContext, addResource, "jquery-1.10.2.js");
    //        addResource.addJavaScriptAtPosition(facesContext,
    //            AddResource.HEADER_BEGIN,
    // "http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js");
    addResource.addInlineScriptAtPosition(
        facesContext, AddResource.HEADER_BEGIN, "var $j = jQuery.noConflict();");
    addJavaScriptRef(facesContext, addResource, "initPages.js");
    addJavaScriptRef(facesContext, addResource, "prototype.js");
    addJavaScriptRef(facesContext, addResource, "fx4web.js");

    addJavaScriptRef(facesContext, addResource, "ieSpell.js");
    addStyleSheetRef(facesContext, addResource, "fx4web.css");

    // get the district id from config file and set the appropriate css
    String district =
        ConfigService.getInstance().getAttributeString("ereg", "appSettings", "district");
    addStyleSheetRef(facesContext, addResource, district.toLowerCase() + ".css");
  }