Display footer in PrimeFaces template, when fullPage of p:layout is set to false

后端 未结 4 1652
夕颜
夕颜 2020-12-18 13:29

Footer is not displayed (actually, it is incorrectly displayed on top of the page), when fullPage is set to false in PrimeFaces template.



        
4条回答
  •  抹茶落季
    2020-12-18 13:48

    To ensure that the layout DIV has a relative height :

    1_ Every components between the BODY and the layout must have a relative height, witch should be 100%.

    2_ Always use DIV instead of SPAN between the BODY and your layout (no inline elements).

    exemple :

    
    
         
        
    
    
    

    In case, it dosent work add this code to your page, (i fixed a long time ago but its probably has a relationship with your problem) :

    function BaseWidgetInit(cpn, cfg) {
        cpn.cfg = cfg;
        cpn.id = cfg.id;
        cpn.jqId = PrimeFaces.escapeClientId(cpn.id),
        cpn.jq = $(cpn.jqId);           
        //remove script tag
        $(cpn.jqId + '_s').remove();
    }   
    if (PrimeFaces.widget.Layout)
    PrimeFaces.widget.Layout = PrimeFaces.widget.Layout.extend({
        init: function(cfg) {
            BaseWidgetInit(this, cfg);        
            this.cfg = cfg;
            this.id = this.cfg.id;
            this.jqId = PrimeFaces.escapeClientId(this.id);
            if(this.cfg.full) {                                                 //full
                this.jq = $('body');
            } else if(this.cfg.parent) {                                        //nested
                this.jq = $(PrimeFaces.escapeClientId(this.cfg.parent));
            } else {                                                            //element
                this.jq = $(this.jqId);
                this.jq.css('height', $(window).height()-10);
            }        
            var _self = this;
            $(this.jq).data("layoutContainer", null);
            $(this.jq).data("layout", null);
            if(this.jq.is(':visible')) {
                this.render();
            } 
            else {
                var hiddenParent = this.jq.parents('.ui-hidden-container:first'),
                hiddenParentWidget = hiddenParent.data('widget');
    
                if(hiddenParentWidget && hiddenParentWidget.addOnshowHandler) {
                    hiddenParentWidget.addOnshowHandler(function() {  
                        return _self.render();
                    });
                }
            }
        }
    });
    

    i also suggest you, to use the layout of PF Extention library, its more stable, a working template can be found here erp.agitech.net admin/pass

提交回复
热议问题