Problems with Primefaces component

0

I am developing a Java Web application using the Primefaces framework, in what is css with bootstrap (AdminLTE Template), the inconvenience that I have is that when I program a component of primefaces in this case a p: selectOneMenu, when I see it On the web it does not show me the items added to the component.

Code:

<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:p="http://primefaces.org/ui"
                template="../WEB-INF/templates/menu_admin.xhtml">

    <ui:define name="header">

    </ui:define>

    <ui:define name="content">

        <p:selectOneMenu style="width:180px;height:28px;font-size:12px;font-family:Arial;"
                                                 effect="fade"
                                                 filter="false"
                                                 filterMatchMode="contains">
                                    <f:selectItem   itemLabel="[Seleccione]"
                                                    itemValue="0"
                                                    itemDisabled="false"
                                                    noSelectionOption="true"/>
                                    <f:selectItem   itemValue="M"
                                                    itemLabel="Masculino"/>
                                    <f:selectItem   itemValue="F"
                                                    itemLabel="Femenino"/>
                                </p:selectOneMenu>
    </ui:define>

</ui:composition>
    
asked by B.Torres 14.04.2018 в 23:30
source

2 answers

0

The first advice I would give you is not to mix so many technologies from FRONT, with foremost is more than enough. On the other hand, just put this on your template tag:

<html
xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:p="http://primefaces.org/ui"
xmlns:ui="http://java.sun.com/jsf/facelets"
<ui:composition  template="/WEB-INF/templates/menu_admin.xhtml">
<ui:define name="content">

<p:selectOneMenu style="width:180px;height:28px;font-size:12px;font-family:Arial;"
                                             effect="fade"
                                             filter="false"
                                             filterMatchMode="contains">
                                <f:selectItem   itemLabel="[Seleccione]"
                                                itemValue="0"
                                                itemDisabled="false"
                                                noSelectionOption="true"/>
                                <f:selectItem   itemValue="M"
                                                itemLabel="Masculino"/>
                                <f:selectItem   itemValue="F"
                                                itemLabel="Femenino"/>
                            </p:selectOneMenu>


</ui:define>

</ui:composition>

</html>
    
answered by 24.05.2018 в 20:06
0

It may be because the value you want to set is missing, just as you have properties like effect="fade" is the value property which would be something like that.

<p:selectOneMenu value="#{managedBean.miVariableString}"
                 style="width:180px;height:28px;font-size:12px;font:family:Arial;" 
                 effect="fade" filter="false" filterMatchMode="contains"> 
     <f:selectItem itemLabel="[Seleccione]" itemValue="0" itemDisabled="false" noSelectionOption="true"/>
     <f:selectItem   itemValue="M" itemLabel="Masculino"/>
     <f:selectItem   itemValue="F" itemLabel="Femenino"/>
</p:selectOneMenu>

On the other hand if you have the filter="false" it is not necessary that you have the filterMatchMode="contains" you can remove it now if you want to have the filter change it to true.

Greetings, I hope I have helped.

    
answered by 24.05.2018 в 22:09