maia_modificado/.svn/pristine/34/34f82f97e3c20721402a63a0d66...

110 lines
6.0 KiB
Plaintext
Executable File

<ui:composition
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:p="http://primefaces.org/ui"
xmlns:pe="http://primefaces.org/ui/extensions"
template="/WEB-INF/templates/template.xhtml"
xmlns:maia="http://java.sun.com/jsf/composite/maiaComponents">
<ui:define name="content">
<h:form id="formTable">
<maia:pageEvents controller="#{moduleController}"
queryProcess=":formTable:filters"
queryUpdate=":formTable:catalog"
saveProcess=""
saveUpdate=""
focusContainer=":formTable:filters" />
<p:panelGrid id="filters" columns="4" styleClass="m-filters">
<f:facet name="header">
<h:outputText value="#{msg_general.lbl_filters}" />
</f:facet>
<p:outputLabel for="fpk" value="#{msg_general.lbl_code}:" />
<p:inputText id="fpk" value="#{moduleController.mfilters['pk']}" maxlength="4" style="width: 80px;">
<pe:keyFilter regEx="/[\d\-]/"/>
</p:inputText>
<p:outputLabel for="fdesc" value="#{msg_general.lbl_description}:" />
<p:inputText id="fdesc" value="#{moduleController.mfilters['description']}" maxlength="60" style="width: 400px;" onkeyup="Maia.forceupper(event, this);"/>
</p:panelGrid>
<h:panelGrid columns="7" id="controls" styleClass="m-controls">
<maia:pageControls controller="#{moduleController}"
queryProcess=":formTable:filters"
queryUpdate=":formTable:filters :formTable:catalog"
createUpdate=":formCatalogo:pEdit"
dialogWidgetVar="dialog" />
</h:panelGrid>
<p:panelGrid id="data-content" columns="1" styleClass="m-data-content">
<f:facet name="header">
<h:outputText value="#{msg_general.htbl_module}" />
</f:facet>
<p:dataTable id="catalog" var="row" value="#{moduleController.lrecord}" rows="200" style="min-width: 500px; width: auto;" rowKey="#{row.rowkey()}" selectionMode="single">
<p:column headerText="#{msg_general.lbl_code}" resizable="true" style="width:150px" sortBy="#{row.pk}">
<h:outputText value="#{row.pk}" />
</p:column>
<p:column headerText="#{msg_general.lbl_description}" resizable="true" sortBy="#{row.description}">
<h:outputText value="#{row.description}" />
</p:column>
<p:column styleClass="m-action-column">
<p:commandButton value="#{msg_general.btn_edit}" update=":formCatalogo:pEdit" oncomplete="PF('dialog').show()" styleClass="m-action-button" icon="ui-icon-pencil" process="@this, catalog">
<f:setPropertyActionListener target="#{moduleController.record}" value="#{row}" />
<f:setPropertyActionListener target="#{moduleController.showRow}" value="#{false}" />
<f:setPropertyActionListener target="#{moduleController.newRow}" value="#{false}" />
</p:commandButton>
</p:column>
<p:column styleClass="m-action-column">
<p:commandButton value="#{msg_general.btn_delete}" update=":formTable:catalog" styleClass="m-action-button" icon="ui-icon-trash" action="#{moduleController.remove()}" process="@this, catalog">
<f:setPropertyActionListener target="#{moduleController.record}" value="#{row}" />
</p:commandButton>
</p:column>
</p:dataTable>
</p:panelGrid>
</h:form>
<p:dialog widgetVar="dialog" resizable="false" closeOnEscape="true" modal="true" appendTo="@(body)" showEffect="explode" hideEffect="explode"
styleClass="m-dialog">
<f:facet name="header">
<h:outputText value="#{msg_general.lbl_createoredit}" />
</f:facet>
<h:form id="formCatalogo">
<p:messages id="messages" autoUpdate="true" globalOnly="true"/>
<h:panelGrid id="pEdit" columns="3" bodyrows="1" >
<p:outputLabel for="codigo" value="#{msg_general.lbl_code}:" />
<h:outputText rendered="#{!moduleController.newRow}"
value="#{moduleController.record.pk}"/>
<p:inputText id="codigo"
rendered="#{moduleController.newRow}"
value="#{moduleController.record.pk}"
required="true" maxlength="4"
style="width:160px;">
<pe:keyFilter regEx="/[\d\-]/"/>
</p:inputText>
<p:message for="codigo" />
<p:outputLabel for="descripcion" value="#{msg_general.lbl_description}:" />
<h:outputText rendered="#{moduleController.showRow}"
value="#{moduleController.record.description}" />
<p:inputText id="descripcion"
rendered="#{!moduleController.showRow}"
value="#{moduleController.record.description}"
required="true" maxlength="60"
onkeyup="Maia.forceupper(event, this);" style="width:480px;" />
<p:message for="descripcion" />
</h:panelGrid>
<h:panelGrid columns="2">
<maia:dialogControls controller="#{moduleController}"
process=":formCatalogo:pEdit"
update=":formCatalogo:pEdit, :formTable:catalog"
dialogWidgetVar="dialog" />
</h:panelGrid>
</h:form>
</p:dialog>
</ui:define>
</ui:composition>