maia/.svn/pristine/29/2984ac9e9b36ae1baf2bdaede08...

107 lines
6.4 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">
<h:form id="formPersonPhone">
<h:panelGrid columns="1" id="controls" styleClass="m-controls">
<p:commandButton id="btnCrearTelefono" value="#{msg_general.btn_create}" disabled="#{juridicalPersonController.isDisableSave}"
update=":formTable:tabcompany:formPhone:pEditPhone"
oncomplete="PF('dialogPhone').show()" icon="ui-icon-plus"
action="#{juridicalPersonController.phonesController.create()}" process="@this" >
</p:commandButton>
</h:panelGrid>
<p:panelGrid id="data-content" columns="1" styleClass="m-data-content">
<f:facet name="header">
<h:outputText value="#{msg_general.htbl_phones}" />
</f:facet>
<p:dataTable id="phones" var="row" value="#{juridicalPersonController.phonesController.lrecord}" rows="200" style="min-width: 500px; width: auto;" rowKey="#{row.rowkey()}" selectionMode="single">
<p:column headerText="#{msg_general.lbl_phonetype}" resizable="true" sortBy="#{row.phonetypecatalog}">
<h:outputText value="#{row.modifiedData['phonetype']}" />
</p:column>
<p:column headerText="#{msg_general.lbl_area}" resizable="true" sortBy="#{row.areacode}">
<h:outputText value="#{row.areacode}" />
</p:column>
<p:column headerText="#{msg_general.lbl_numphone}" resizable="true" sortBy="#{row.phonenumber}">
<h:outputText value="#{row.phonenumber}" />
</p:column>
<p:column headerText="#{msg_general.lbl_numextension}" resizable="true" sortBy="#{row.extension}">
<h:outputText value="#{row.extension}" />
</p:column>
<p:column styleClass="m-action-column">
<p:commandButton value="#{msg_general.btn_edit}" disabled="#{juridicalPersonController.isDisableSave}"
update=":formTable:tabcompany:formPhone:pEditPhone"
oncomplete="PF('dialogPhone').show()" styleClass="m-action-button" icon="ui-icon-pencil" process="@this, phones">
<f:setPropertyActionListener target="#{juridicalPersonController.phonesController.record}" value="#{row}" />
</p:commandButton>
</p:column>
<p:column styleClass="m-action-column">
<p:commandButton value="#{msg_general.btn_delete}" disabled="#{juridicalPersonController.isDisableSave}"
update=":formTable:tabcompany:formPersonPhone:phones" styleClass="m-action-button" icon="ui-icon-trash"
action="#{juridicalPersonController.phonesController.remove()}" process="@this, phones">
<f:setPropertyActionListener target="#{juridicalPersonController.phonesController.record}" value="#{row}" />
</p:commandButton>
</p:column>
</p:dataTable>
</p:panelGrid>
</h:form>
<p:dialog widgetVar="dialogPhone" 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="formPhone">
<p:messages id="messages" autoUpdate="true" globalOnly="true"/>
<h:panelGrid id="pEditPhone" columns="4" bodyrows="1" >
<p:outputLabel for="phonetypecatalog" value="#{msg_general.lbl_phonetype}:" />
<pe:keyFilter/>
<p:selectOneMenu id="phonetypecatalog" value="#{juridicalPersonController.phonesController.record.phonetypecatalog}" var="p"
style="width:135px" panelStyle="width:135px" required="true">
<f:selectItem itemLabel="" itemValue="" />
<f:selectItems value="#{juridicalPersonController.phonesController.lphonetype}" var="id"
itemLabel="#{id.description}" itemValue="#{id.pk.catalog}" />
</p:selectOneMenu>
<p:message for="phonetypecatalog" />
<p:outputLabel for="areacode" value="#{msg_general.lbl_area}:" />
<pe:keyFilter for="areacode" mask="int"/>
<p:inputText id="areacode" value="#{juridicalPersonController.phonesController.record.areacode}"
maxlength="4" style="width:145px" />
<p:message for="areacode" />
<p:outputLabel for="phonenumber" value="#{msg_general.lbl_numphone}:" />
<pe:keyFilter for="phonenumber" mask="int"/>
<p:inputText id="phonenumber"
value="#{juridicalPersonController.phonesController.record.phonenumber}"
maxlength="12" required="true"
style="width:145px;" />
<p:message for="phonenumber" />
<p:outputLabel for="extension" value="#{msg_general.lbl_numextension}:" />
<pe:keyFilter for="extension" mask="int"/>
<p:inputText id="extension" value="#{juridicalPersonController.phonesController.record.extension}"
maxlength="6" style="width:145px;" />
<p:message for="extension" />
</h:panelGrid>
<h:panelGrid columns="2" >
<p:commandButton value="#{msg_general.btn_update}"
update=":formTable:tabcompany:formPersonPhone:phones,:formTable:tabcompany:formPhone"
action="#{juridicalPersonController.phonesController.update()}" process="@this, pEditPhone"
icon="ui-icon-disk" oncomplete="if(args.validationFailed){return false;} PF('dialogPhone').hide()" />
<p:commandButton value="#{msg_general.btn_cancell}" oncomplete="PF('dialogPhone').hide()" icon="ui-icon-trash" process="@this" />
</h:panelGrid>
</h:form>
</p:dialog>
</ui:composition>