scripts2.xhtml

来自「openacs source for CPE wan management」· XHTML 代码 · 共 43 行

XHTML
43
字号
<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:a4j="http://richfaces.org/a4j"
                xmlns:rich="http://richfaces.org/rich">
    
    <a4j:form>
        <h:panelGrid columns="2"> 
            <h:panelGrid columns="1" width="150px">
                <a4j:region>
                    <rich:scrollableDataTable rowKeyVar="scriptrkv" height="400px" selection="#{ScriptsBean.selection}"
                                              width="150px" id="scriptList" rows="40" columnClasses="col"
                                              value="#{ScriptsBean.all}" var="script" sortMode="single">
                        
                        <rich:column width="150px">
                            <f:facet name="header"><h:outputText styleClass="headerText" value="Name" /></f:facet>
                            <h:outputText value="#{script.name}" />
                        </rich:column>
                        <a4j:support event="onselectionchange" reRender="scriptdetails"/>
                    </rich:scrollableDataTable>
                </a4j:region>
                <a4j:commandButton submitMode="ajax" value="New" action="#{ScriptsBean.prepareNew}"  reRender="scriptdetails"/>
            </h:panelGrid>
            <a4j:region>
                <h:panelGrid id="scriptdetails" columns="1">
                    <h:inputText value="#{ScriptsBean.name}"  rendered="#{!ScriptsBean.edit}"/>
                    <h:outputText value="#{ScriptsBean.name}"  rendered="#{ScriptsBean.edit}"/>
                    <h:inputText value="#{ScriptsBean.description}" id="script_description"/>
                    <h:inputTextarea  id="script_text" rows="20" cols="100" value="#{ScriptsBean.text}"/>
                    <h:panelGrid columns="2">
                        <a4j:commandButton value="Save" reRender="scriptList" action="#{ScriptsBean.editItem}" />
                        <a4j:commandButton submitMode="ajax" value="Delete" action="#{ScriptsBean.deleteItem}" reRender="scriptList,scriptdetails" 
                                           onclick="if (!confirm('Are you sure?')) { return false; }" 
                                           /> 
                    </h:panelGrid>
                </h:panelGrid>
            </a4j:region>
        </h:panelGrid>
    </a4j:form>
</ui:composition>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?