Sun Creator Table
i neeed some help in the following Problem :-
how can i bind data to Sun Creator table here is the problem:-
i have table with 2 columns "PID" "PName" and i have 2 ArrayList pid & pname how can i put in each cell in PID column just only one value from the pid ArrayList then in the 2nd cell the second value.....etc and the same in the PName Column
here's the Java Code:-[/b]
public Page1(){
ArrayList id=new ArrayList();
ArrayList name=new ArrayList();
String comming="1<firefox><>2<iexplorer><>3<winmpalyer><>4<winamp><>5<winrar";
String[] process=comming.split("<>");
int columnsCount=0;
pid.setText(" ");
pname.setText(" ");
for(int i=0;i<process.length;i++){
//staticText1.setText(staticText1.getText().toString()+"||"+process[i]);
String[] processContent=process[i].split("<");
columnsCount=processContent.length;
for(int j=0;j<processContent.length;j++){
if(j==0)
id.add(processContent[0]);
else
name.add(processContent[1]);
}
}
pid.setText(id.toString());
pname.setText(name.toString());
getSessionBean1().setProcessesID(id);
getSessionBean1().setProcessName(name);
}
JSP Code:-
><?xml version="1.0" encoding="UTF-8"?>
<jsp:root version="1.2" 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:ui="http://www.sun.com/web/ui">
<jsp:directive.page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"/>
<f:view>
<ui:page binding="#{Page1.page1}" id="page1">
<ui:html binding="#{Page1.html1}" id="html1">
<ui:head binding="#{Page1.head1}" id="head1">
<ui:link binding="#{Page1.link1}" id="link1" url="/resources/stylesheet.css"/>
</ui:head>
<ui:body binding="#{Page1.body1}" id="body1" style="-rave-layout: grid">
<ui:form binding="#{Page1.form1}" id="form1">
<ui:staticText binding="#{Page1.pid}" id="pid" style="left: 27px; top: 343px; position: absolute"/>
<ui:staticText binding="#{Page1.pname}" id="pname" style="left: 24px; top: 392px; position: absolute"/>
<ui:table augmentTitle="false" binding="#{Page1.table1}" id="table1" style="left: 49px; top: 22px; position: absolute; width: 360px"
title="Table" width="360">
<script><![CDATA[
/* -- Functions for Table Preferences Panel -- */
/*
* Toggle the table preferences panel open or closed
*/
function togglePreferencesPanel(){
var table = document.getElementById("form1:table1");
table.toggleTblePreferencesPanel();
}
/* -- Functions for Filter Panel -- */
/*
* Return true if the filter menu has actually changed,
* so the corresponding event should be allowed to continue.
*/
function filterMenuChanged(){
var table = document.getElementById("form1:table1");
return table.filterMenuChanged();
}
/*
* Toggle the custom filter panel (if any) open or closed.
*/
function toggleFilterPanel(){
var table = document.getElementById("form1:table1");
return table.toggleTableFilterPanel();
}
/* -- Functions for Table Actions -- */
/*
* Initialize all rows of the table when the state
* of selected rows changes.
*/
function initAllRows(){
var table = document.getElementById("form1:table1");
table.initAllRows();
}
/*
* Set the selected state for the given row groups
* displayed in the table. This functionality requires
* the 'selectId' of the tableColumn to be set.
*
* @param rowGroupId HTML element id of the tableRowGroup component
* @param selected Flag indicating whether components should be selected
*/
function selectGroupRows(rowGroupId, selected){
var table = document.getElementById("form1:table1");
table.selectGroupRows(rowGroupId, selected);
}
/*
* Disable all table actions if no rows have been selected.
*/
function disableActions(){
// Determine whether any rows are currently selected
var table = document.getElementById("form1:table1");
var disabled = (table.getAllSelectedRowsCount() > 0) ?false :true;
// Set disabled state for top actions
document.getElementById("form1:table1:tableActionsTop:deleteTop").setDisabled(disabled);
// Set disabled state for bottom actions
document.getElementById("form1:table1:tableActionsBottom:deleteBottom").setDisabled(disabled);
}]]></script>
<ui:tableRowGroup binding="#{Page1.tableRowGroup1}" id="tableRowGroup1" rows="10" sourceData="#{Page1.defaultTableDataProvider}" sourceVar="currentRow">
<ui:tableColumn binding="#{Page1.tableColumn1}" headerText="column1" id="tableColumn1" sort="column1">
<ui:staticText binding="#{Page1.staticText1}" id="staticText1" text="#{currentRow.value['column1']}"/>
</ui:tableColumn>
<ui:tableColumn binding="#{Page1.tableColumn2}" headerText="column2" id="tableColumn2" sort="column2">
<ui:staticText binding="#{Page1.staticText2}" id="staticText2" text="#{currentRow.value['column2']}"/>
</ui:tableColumn>
<ui:tableColumn binding="#{Page1.tableColumn3}" headerText="column3" id="tableColumn3" sort="column3">
<ui:staticText binding="#{Page1.staticText3}" id="staticText3" text="#{currentRow.value['column3']}"/>
</ui:tableColumn>
</ui:tableRowGroup>
</ui:table>
</ui:form>
</ui:body>
</ui:html>
</ui:page>
</f:view>
</jsp:root>

