Eslam Hamdy
Eslam Hamdy

Reputation: 7396

How to put a p:commandButton inside a p:panel footer

I want to put a primefaces commandButton inside a panel footer but it seems that primefaces panel footers take only text, i want to do something like that :

            <p:panel id="JunglePanel" header="Jungle" footer="<p:commandButton action="#{JungleBean.navigate}"
                            ajax="false" value="Navigate"">
           </p:panel>

but it didn't work, does anyone know how to achieve that ?

Upvotes: 1

Views: 7816

Answers (3)

Rocky
Rocky

Reputation: 23

That facet is not dialogs's, it belongs to form, take it outside.

Upvotes: 0

Rong Nguyen
Rong Nguyen

Reputation: 4189

If you want footer have the same css as header, you can apply header's css to footer, i have tested and it work:

         <h:form>
            <p:panel id="JunglePanel" header="Jungle">
                <f:facet name="footer" >
                    <div class="ui-panel-titlebar ui-widget-header ui-helper-clearfix ui-corner-all">
                        <p:commandButton value="xxx" />
                    </div>
                </f:facet>
                Content here
            </p:panel>
        </h:form>

Upvotes: 3

Alexandre Lavoie
Alexandre Lavoie

Reputation: 8771

You can't put tags inside EL, do it like this :

<p:panel id="JunglePanel" header="Jungle">
    <f:facet name="footer">
        <p:commandButton action="#{JungleBean.navigate}" ajax="false" value="Navigate" />
    </f:facet>
</p:panel>

Upvotes: 1

Related Questions