JavaDabbaDoo.org -Tu comunidad Java parlante Houston,tenemos un problema
Inicio | Houstons

Cómo puedo añadir una botonera en la cabecera de una tabla

Quisiera incrustar botones en un componente Table de Woodstock tal y como se puede ver en algunas tablas de la consola del servidor GlassFish.

aaaa

Respuesta

Este el el código de la pagina JSP Page1.jsp

<?xml version="1.0" encoding="UTF-8"?>
<jsp:root version="2.1" xmlns:f="http://java.sun.com/jsf/core"  xmlns:h="http://java.sun.com/jsf/html" xmlns:jsp="http://java.sun.com/JSP/Page"  xmlns:webuijsf="http://www.sun.com/webui/webuijsf">
 <jsp:directive.page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"/>
 <f:view>
  <webuijsf:page id="page1">
   <webuijsf:html id="html1">
    <webuijsf:head id="head1">
     <webuijsf:link id="link1" url="/resources/stylesheet.css"/>
    </webuijsf:head>
    <webuijsf:body id="body1" style="-rave-layout: grid">
     <webuijsf:form id="form1">

      <webuijsf:table augmentTitle="false" id="table1"
         style="position: absolute; left: 48px; top: 48px" title="Table" width="450">
       <webuijsf:tableRowGroup id="tableRowGroup1" rows="10"         sourceData="#{Page1.defaultTableDataProvider}" sourceVar="currentRow">
       <webuijsf:tableColumn headerText="column1" id="tableColumn1" sort="column1">
        <webuijsf:staticText id="staticText1" text="#{currentRow.value['column1']}"/>
       </webuijsf:tableColumn>
       <webuijsf:tableColumn headerText="column2" id="tableColumn2" sort="column2">
        <webuijsf:staticText id="staticText2" text="#{currentRow.value['column2']}"/>
       </webuijsf:tableColumn>
       <webuijsf:tableColumn headerText="column3" id="tableColumn3" sort="column3">
        <webuijsf:staticText id="staticText3" text="#{currentRow.value['column3']}"/>
       </webuijsf:tableColumn>
       </webuijsf:tableRowGroup>
       
<f:facet name="actionsTop">
        <webuijsf:panelLayout
id="layoutPanel1" panelLayout="flow">
         
<webuijsf:button actionExpression="#{Page1.button1_action}"
                          id="button1"text="Button"
         />
         
<webuijsf:button actionExpression="#{Page1.button2_action}"
                          id="button2" text="Button"/>
         <webuijsf:button actionExpression="#{Page1.button3_action}"
                          id="button3" text="Button"/>
         
</webuijsf:panelLayout>
       </f:facet>
      </webuijsf:table>

     </webuijsf:form>
    </webuijsf:body>

   </webuijsf:html>
  </webuijsf:page>
 </f:view>
</jsp:root>

Esta es la taba tal y como se ve en el IDE NetBeans

aaaa

Y esta es la tabla con los tres botones cuando ejecutamos la aplicación Web

aaaa

Ignasi Pérez Valls
asesor-formador independiente
ignasiperez[ARROBA]javadabbadoo[PUNTO]org
JavaDabbaDoo.org
Tu comunidad Java parlante. Cursos abiertos, tutoriales y mucho mucho más ...