TableView FXML problems

Hello,
I'm currently trying to learn some FXML and have at least 4 problems with the TableView component:
1) TableView shows some strange behavior after maximizing the window:
https://dl.dropbox.com/u/1030857/maximized.PNG
and minimizing it afterwards:
https://dl.dropbox.com/u/1030857/normalaftermax.PNG
When resizing (particularily making the window bigger) the unstyled table is visible too:
https://dl.dropbox.com/u/1030857/resizing.PNG
I set some some constraints on the columns and I am using the CONSTRAINED_RESIZE_POLICY and here is the FXML:
<TableView fx:id="taskTable" prefHeight="-1.0" prefWidth="-1.0" VBox.vgrow="ALWAYS">
            <placeholder><Label text="" /></placeholder>
            <columnResizePolicy><TableView fx:constant="CONSTRAINED_RESIZE_POLICY" /></columnResizePolicy>
            <columns>
                <TableColumn text="Completed" minWidth="75" prefWidth="75" maxWidth="75" >
                     <cellValueFactory><PropertyValueFactory property="completed" /></cellValueFactory>
                </TableColumn>
                <TableColumn text="Task">
                    <cellValueFactory><PropertyValueFactory property="name" /></cellValueFactory>
                </TableColumn>
                <TableColumn text="Progress" minWidth="100" prefWidth="100" maxWidth="100">
                    <cellValueFactory><PropertyValueFactory property="progress" /></cellValueFactory>
                </TableColumn>
            </columns>
            <items>
                <FXCollections fx:factory="observableArrayList">
                    <Task completed="false" name="Random" progress="0" />
                    <Task completed="false" name="Srandom" progress="3" />
                    <Task completed="true" name="Andom" progress="5" />
                </FXCollections>
            </items>
</TableView>The TableView Control sits in a VBox which sits in the center of a BorderPane.
2) I have found some code to hide the table header:
Pane header = (Pane) table.lookup("TableHeaderRow");
header.setVisible(false);
table.setLayoutY(-header.getHeight());
table.autosize();but I don't know where I can call it. I have a controller for the Main Window and if I use the Initializable interface I obviously get NullPointerException, because the TableView isn't created yet.
3) Is it possible to remove the resize lines / column borders? I tried changing CSS of the column-resize-line substructure of the TableView, but with no success...
4) I haven't found anything reliable on the net: How can I set a Checkbox Cell Factory in the table using FXML? I did it earlier using DataFX cell factories, but only in pure Java.
Kind regards,
Daniel

i solved this problem by creating a CustomTableView which extends from TableView and setting columnResizePolicy="CONSTRAINED_RESIZE_POLICY" in constructor.

Similar Messages

  • JSP TableView Sorting Problem

    I have been trying to get a tableview to be sortable by clicking on the header of columns.  I have been reviewing existing threads on the forum in particular the one below.
    https://forums.sdn.sap.com/thread.jspa?threadID=16417
    I seem to understand the concept but for some reason my table does not sort, it just does nothing.  Could someone take a look and see if you can find any problems - I can't wait to give points.
    Here is all my code.
    Here is the Java....
    package MSSPackage;
    import MSSBeanPackage.PositionOverviewBean;
    import MSSPackage.SortTableModel;
    import com.sapportals.htmlb.page.DynPage;
    import com.sapportals.htmlb.page.PageException;
    import com.sapportals.portal.htmlb.page.JSPDynPage;
    import com.sapportals.portal.htmlb.page.PageProcessorComponent;
    import com.sapportals.portal.prt.component.IPortalComponentContext;
    import com.sapportals.portal.prt.component.IPortalComponentProfile;
    import com.sapportals.portal.prt.component.IPortalComponentRequest;
    import com.sapportals.portal.prt.component.IPortalComponentSession;
    import com.sapportals.htmlb.event.*;
    import com.sapportals.htmlb.*;
    import com.sapportals.htmlb.table.*;
    import com.sapportals.htmlb.table.DefaultTableViewModel;
    import javax.servlet.http.*;
    // SAP RFC Imports
    import com.sap.mw.jco.IFunctionTemplate;
    import com.sap.mw.jco.JCO;
    import com.sapportals.portal.prt.service.jco.IJCOClientPoolEntry;
    import com.sapportals.portal.prt.service.jco.IJCOClientService;
    import com.sapportals.portal.prt.runtime.PortalRuntime;
    import java.util.*;
    public class PositionOverview extends PageProcessorComponent {
      public DynPage getPage(){
         return new PositionOverviewDynPage();
      public static class PositionOverviewDynPage extends JSPDynPage{
         JCO.Repository mRepository;
         public JCO.Table tblRelations;
         public JCO.Table tblPositions;     
         public SortTableModel tableModel;
         public int visibleRow = 1;     
         private boolean OrgUnitSelected = false;
         public void doInitialization(){
              IPortalComponentSession oSession = ((IPortalComponentRequest)getRequest()).getComponentSession();
              PositionOverviewBean oBean = new PositionOverviewBean();
              // Table Start row
              oBean.setvisibleRow(new Integer(this.visibleRow).toString());          
              oSession.putValue("myBean", oBean);
              // Define request, context and profile containers         
              IPortalComponentRequest request = (IPortalComponentRequest) this.getRequest();
              IPortalComponentContext myContext = request.getComponentContext();
              IPortalComponentProfile myProfile = myContext.getProfile();
              // Define bean reference to bean
              PositionOverviewBean myBean = new PositionOverviewBean();
              // Table Start row
              myBean.setvisibleRow(new Integer(this.visibleRow).toString());
              // Place bean in user profile.          
              myProfile.putValue("myBean", myBean);
         public void doProcessAfterInput() throws PageException {
         public void doProcessBeforeOutput() throws PageException {
              String NavType = "RCORGUNIT";
              String OType = "O";
              //String OBjid = "10004399";
              String OBjid = "";
              String sapSystem = "SAP_R3_HumanResources";          
              IPortalComponentSession oSession = ((IPortalComponentRequest)getRequest()).getComponentSession();
              PositionOverviewBean myBean = (PositionOverviewBean) oSession.getValue("myBean");
              // Define request, context and profile containers         
              IPortalComponentRequest request = (IPortalComponentRequest) this.getRequest();
    /*          IPortalComponentContext myContext = request.getComponentContext();
              IPortalComponentProfile myProfile = myContext.getProfile();
              //HttpSession session = request.getServletRequest().getSession();          //dmm
              //Get Bean from Profile
              PositionOverviewBean myBean = (PositionOverviewBean) myProfile.getValue("myBean");
              //PositionOverviewBean myDataBean = (PositionOverviewBean) session.getValue("POviewBean");               //dmm
              String ddlbSelection = "";
              String ddlbValue = "";
              DropdownListBox ddlbOrgUnits = (DropdownListBox) getComponentByName("ddlbOrgUnits");
              if (ddlbOrgUnits != null)
                   ddlbSelection = ddlbOrgUnits.getSelection();
                   ddlbValue = ddlbOrgUnits.getValueAsDataType().getValueAsString();
                   OBjid = ddlbValue;
                   myBean.setObjId(OBjid);
              else
                   OBjid = "";
                   myBean.setObjId(OBjid);                 
              IJCOClientService clientService;
              IJCOClientPoolEntry poolEntry;          
              JCO.Client client;          
              try
                   clientService = (IJCOClientService) PortalRuntime.getRuntimeResources().getService(IJCOClientService.KEY);
                   poolEntry = clientService.getJCOClientPoolEntry(sapSystem, request);
                   client = poolEntry.getJCOClient();
                // connect to SAP system, logon
                   client.connect();
                // Create Jco Repository Object
                   mRepository = new JCO.Repository("R3USERMENU", client);
                // Reset function object
                   JCO.Function function = null;
                // Run RFC Module on SAP system
                   function = this.createFunction("HRWPC_GET_NAV_OBJECTS");
                   JCO.ParameterList input = function.getImportParameterList();
                   input.setValue("RCORGUNIT", "NAVTYPE");               
                   client.execute(function);
                   tblRelations = function.getTableParameterList().getTable("RESULT_OBJEC");
                   myBean.setRowcnt(tblRelations.getNumRows());
                   if (tblRelations.getNumRows() != 0)               
                        myBean.setOrgUnits(tblRelations);
                        if (ddlbOrgUnits == null)
                             // check to see if there is not a position id already assigned
                             tblRelations.setRow(0);
                             OBjid = tblRelations.getString("OBJID");
                             myBean.setObjId(OBjid);
                             //myBean.sTemp = OBjid;                         
                   // GET THE POSITION DETAILS
                   function = null;
                   input = null;
                   function = this.createFunction("Z_GET_POSITION_OVERVIEW");
                   input = function.getImportParameterList();               
                   input.setValue(NavType, "NAVTYPE");               
                   input.setValue(OType, "OTYPE");
                   input.setValue(OBjid, "OBJID");               
                   client.execute(function);
                   tblPositions = function.getTableParameterList().getTable("RESULT_OBJEC");
                   myBean.setRowcnt(tblPositions.getNumRows());
                   tableViewFormat();
                   tableModel.setTesting("Startxxxx");
                   myBean.settableModel(tableModel);
                   //tableModel.setTesting("SSSS");               
                   //myDataBean.settableModel(tableModel);                                             //dmm               
                   //session.setAttribute("POviewBean", myDataBean);                                //dmm
                   oSession.putValue("myBean", myBean);
              //Release pool entry
              poolEntry.release();                           
           catch(Exception ex)
                //name = ex.getMessage();                         
           //String sTest = "this is a test";      
           //request.getComponentSession().putValue("Test", sTest);
           //myProfile.putValue("Testx", sTest);
           this.setJspName("PositionOverviewJSP.jsp");
         public void getPositions()
              String NavType;
              String Root_Ot;
              String Root_ObjId;
         public void tableViewFormat()
              // Define the vectors used to build tableView
              Vector tempRec = new Vector();
              Vector dataRec = new Vector();
              String sDate = "";
              String sPosLink = "";
              String sPosVal = "";
              String sENameLink = "";
              String sENameVal = "";
              String sStatus = "";
              // Loop at company code list and add to vectors
              for (int i = 0; i < tblPositions.getNumRows(); i++)
                   tblPositions.setRow(i);
                   tempRec = new Vector();
                   sStatus = (String) tblPositions.getString("STATUS");
                   if (sStatus != null)
                        if (sStatus.equals("0"))                    
                             sDate = tblPositions.getString("ZHR_VACANT_BEGDA");
                             sDate = sDate.substring(5, 7) + "/" + sDate.substring(8, 10) + "/" +  sDate.substring(0, 4);                         
                        else
                             sDate = "";                    
                   sPosVal = tblPositions.getString("STEXT");
                   sENameVal = tblPositions.getString("ENAME");
                   if (sPosVal.equals(""))
                        sPosLink = sPosVal;
                   else
                        sPosLink = "<a HREF="myLink" onclick="return EPCM.doNavigate('ROLES://portal_content/com.sap.portal.migrated/ep_5.0/pages/com.sap.pct.hcm.positionprofile?CKey=000000" + tblPositions.getString("OBJID") + "', 1)">" + tblPositions.getString("STEXT") + "</a>";
                   if (sENameVal.equals(""))
                        sENameLink = sENameVal;
                   else
                        sENameLink = "<a HREF="myLink" onclick="return EPCM.doNavigate('ROLES://portal_content/com.phi/com.phi.mgt/com.phi.mss/com.phi.hr/com.phi.pages/com.phi.mgt.mss.hr.pages.positionholder?CKey=000000" + tblPositions.getString("OBJID") + "', 1)">" + tblPositions.getString("ENAME") + "</a>";
                   tempRec.addElement(sStatus);
                   tempRec.addElement(tblPositions.getString("OBJID"));
                   tempRec.addElement(sPosLink);
                   tempRec.addElement(sENameLink);
                   tempRec.addElement(sDate);               
                   dataRec.addElement(tempRec);
              // Then define the technical column names
              Vector colNames = new Vector();
              colNames.addElement("STATUS");
              colNames.addElement("OBJID");
              colNames.addElement("STEXT");     
              colNames.addElement("ENAME");
              colNames.addElement("ZHR_VACANT_BEGDA");
              // Now we build the actual tableView
              //tableModel = new DefaultTableViewModel(dataRec, colNames);
              tableModel = new SortTableModel(dataRec, colNames, 5);     
              // Define tableView parameters
              tableModel.setKeyColumn(2);
              TableColumn column = tableModel.getColumn("STATUS");
              column.setEncode(false);
              column.setType(com.sapportals.htmlb.enum.TableColumnType.USER);
              column.setTitle("Vacant");
              column = tableModel.getColumn("OBJID");
              column.setTitle("Position Number");
              column = tableModel.getColumn("STEXT");
              column.setTitle("Position");
              column = tableModel.getColumn("ENAME");
              column.setTitle("Holder of Position");          
              column = tableModel.getColumn("ZHR_VACANT_BEGDA");
              column.setTitle("Vacant as of");
         //     * Navigation Button Clicked
         public void myOnNavigate(Event event)
              TableNavigationEvent tne = (TableNavigationEvent) event;
              visibleRow = tne.getFirstVisibleRowAfter();
              // Define request, context and profile containers         
              IPortalComponentRequest request = (IPortalComponentRequest) this.getRequest();
              IPortalComponentContext myContext = request.getComponentContext();
              IPortalComponentProfile myProfile = myContext.getProfile();
              // Get Bean from profile
              PositionOverviewBean myBean = (PositionOverviewBean) myProfile.getValue("myBean");
              // Table Start row
              myBean.setvisibleRow(new Integer(this.visibleRow).toString());
         public void onHeaderClick(Event event)
              IPortalComponentSession oSession = ((IPortalComponentRequest)getRequest()).getComponentSession();
              PositionOverviewBean myBean = (PositionOverviewBean) oSession.getValue("myBean");
              TableHeaderClickEvent tne = (TableHeaderClickEvent) event; // get the event
              SortTableModel tblModel = myBean.gettableModel();
              //tblModel.sort();
              int col = 3;
              tblModel.sortByColumn(col);
              myBean.settableModel(tblModel);
              oSession.putValue("myBean", myBean);
         // Create Function object for RFC Calls
         public JCO.Function createFunction(String name) throws Exception
              try
                   IFunctionTemplate ft = mRepository.getFunctionTemplate(name.toUpperCase());
                   if (ft == null)
                        return null;
                   return ft.getFunction();
              catch (Exception ex)
                   ex.printStackTrace();
                   throw new Exception("Problem retrieving JCO.Function object");
         public void onSelectddlbOrgUnits(Event event) throws PageException
              OrgUnitSelected = true;          
    Here is the JSP
    <%@ page import="com.sap.mw.jco.*" %>
    <%@ page import="com.sapportals.htmlb.enum.*" %>
    <%@ page import="MSSPackage.TableViewCellRenderer" %>
    <%@ page import="com.sapportals.portal.prt.component.IPortalComponentRequest" %>
    <%@ page import="javax.servlet.http.*" %>
    <%@ page import="com.sapportals.portal.prt.component.IPortalComponentContext" %>
    <%@ taglib uri="tagLib" prefix="hbj" %>
    <hbj:content id="myContext" >
         <hbj:page title="PageTitle">
              <hbj:form id="myFormId" >  
              <jsp:useBean id="myBean" scope="session" class="MSSBeanPackage.PositionOverviewBean" />     
                   <hbj:gridLayout rowSize="1" columnSize="1" cellSpacing="1">
                        <hbj:gridLayoutCell columnIndex="1" rowIndex="1">
                             <hbj:textView id="ddlbLable" text="Select organizational unit to display positions" design="STANDARD" />
                        </hbj:gridLayoutCell>                         
                        <hbj:gridLayoutCell columnIndex="1" rowIndex="2">
                             <hbj:dropdownListBox id="ddlbOrgUnits" onSelect="onSelectddlbOrgUnits" selection="<%=myBean.getObjId()%>">                                                       
                                  <%                         
                                       JCO.Table org_units = null;                                                       
                                       org_units = myBean.getOrgUnits();
                                       for (int i = 0; i < org_units.getNumRows(); i++)
                                            org_units.setRow(i);
                                            String sUnit = org_units.getString("STEXT");
                                            String Unit_Id = org_units.getString("OBJID");
                                  %>
                                  <hbj:listBoxItem key="<%=Unit_Id%>" value="<%=sUnit%>" />
                                  <%
                                  %>
                             </hbj:dropdownListBox>                                                                                                   
                        </hbj:gridLayoutCell>
                        <hbj:gridLayoutCell columnIndex="1" rowIndex="3">
                             <hbj:textView id="listLable" text="To designate a vacant position, click the icon in the 'Create Form' column" design="STANDARD" />                    
                        </hbj:gridLayoutCell>                    
                        <hbj:gridLayoutCell columnIndex="1" rowIndex="4">     
                             <hbj:tableView
                                  id="myTableView"
                                  headerVisible="true"
                                  footerVisible="true"
                                  fillUpEmptyRows="true"
                                  selectionMode="NONE"                              
                                  navigationMode="BYPAGE"
                                  onNavigate="myOnNavigate"                                        
                                  visibleFirstRow="<%= myBean.getvisibleRow() %>"                                                  
                                  visibleRowCount="5" >                                                            
                                  <%
                                  myTableView.setOnHeaderClick("onHeaderClick");
                                  myTableView.setUserTypeCellRenderer(new TableViewCellRenderer());                                                             
                                  myTableView.setModel(myBean.gettableModel());
                                  myTableView.setColumnType(TableColumnType.LINK, 3);
                                  myTableView.setColumnType(TableColumnType.LINK, 4);                              
                                  %>
                             </hbj:tableView>
                        </hbj:gridLayoutCell>                                        
                   </hbj:gridLayout>   
              </hbj:form>
         </hbj:page>
    </hbj:content>
    Here is the BEAN
    package MSSBeanPackage;
    //import com.sapportals.htmlb.enum.TableColumnType;
    import MSSPackage.SortTableModel;
    import com.sapportals.htmlb.table.DefaultTableViewModel;
    //import com.sapportals.htmlb.table.TableColumn;
    //import com.sapportals.htmlb.table.TableView;
    //import com.sapportals.htmlb.table.TableViewModel;
    import com.sap.mw.jco.JCO;
    import com.sap.mw.jco.JCO.Table;
    public class PositionOverviewBean {
    //     public DefaultTableViewModel tableModel;
         public SortTableModel tableModel;
         public JCO.Table OrgUnits;
         public String ObjId;
         public String visibleRow;
         public int rowcnt;
         public String sTemp;
         // Get and Set methods for table model
    //     public DefaultTableViewModel gettableModel() { return tableModel; }
    //     public void settableModel(DefaultTableViewModel tableModel)     { this.tableModel = tableModel;     }
         public SortTableModel gettableModel() { return tableModel; }
         public void settableModel(SortTableModel IntableModel)     { this.tableModel = IntableModel;     }     
         public JCO.Table getOrgUnits()     { return OrgUnits; }
         public void setOrgUnits(JCO.Table value) { this.OrgUnits = value; }
         // Get and Set methods for visiblerow
         public String getvisibleRow() {     return visibleRow; }
         public void setvisibleRow(String visibleRow) { this.visibleRow = visibleRow; }     
         public int getRowcnt() { return this.rowcnt; }
         public void setRowcnt(int rowcnt) { this.rowcnt = rowcnt; }
         public String getObjId() { return this.ObjId; }
         public void setObjId(String value) { this.ObjId = value; }     
    Here is the sorting class
    package MSSPackage;
    import java.util.Collections;
    import java.util.Comparator;
    import java.util.Vector;
    import com.sapportals.htmlb.table.DefaultTableViewModel;
    public class SortTableModel extends DefaultTableViewModel implements Comparator {
         //protected int currCol;
         public int currCol;
         protected Vector ascendCol; // this vector stores the state (ascending or descending) of each column
         protected Integer one = new Integer(1);
         protected Integer minusOne = new Integer(-1);
         public String testing;
         public SortTableModel()
              super();
              ascendCol = new Vector();
         public SortTableModel(Vector vec)
              super(vec);
              ascendCol = new Vector();
         public SortTableModel(Vector vec, Vector vec2, int numberOfColumns)
              super(vec, vec2);
              ascendCol = new Vector();
              setSortOrder(numberOfColumns);
         public int compare (Object v1, Object v2)
              // the comparison is between 2 vectors, each representing a row
              // the comparison is done between 2 objects from the different rows that are in the column that is being sorted
              int ascending = ((Integer)ascendCol.get(currCol)).intValue();
              if (v1 == null && v2 == null)
                   return 0;
              else if (v2 == null)
              { // Define null less than everything.
                   return 1 * ascending;
              else if (v1 == null)
                   return -1 * ascending;
              Object o1 = ((Vector)v1).get(currCol);
              Object o2 = ((Vector)v2).get(currCol);
              // If both values are null, return 0.
              if (o1 == null && o2 == null)
                   return 0;
              else if (o2 == null)
              { // Define null less than everything.
                   return 1 * ascending;
              else if (o1 == null)
                   return -1 * ascending;
              if (o1 instanceof Number && o2 instanceof Number)
                   Number n1 = (Number)o1;
                   double d1 = n1.doubleValue();
                   Number n2 = (Number)o2;
                   double d2 = n2.doubleValue();
                   if (d1 == d2)
                        return 0;
                   else if (d1 > d2)
                        return 1 * ascending;
                   else {
                        return -1 * ascending;
              else if (o1 instanceof Boolean && o2 instanceof Boolean)
                   Boolean bool1 = (Boolean)o1;
                   boolean b1 = bool1.booleanValue();
                   Boolean bool2 = (Boolean)o2;
                   boolean b2 = bool2.booleanValue();
                   if (b1 == b2)
                        return 0;
                   else if (b1)
                        return 1 * ascending;
                   else
                        return -1 * ascending;
              else
                   // default case
                   if (o1 instanceof Comparable && o2 instanceof Comparable)
                        Comparable c1 = (Comparable)o1;
                        Comparable c2 = (Comparable)o2; // superflous cast, no need for it!
                        try
                             return c1.compareTo(c2) * ascending;
                        catch (ClassCastException cce)
                        // forget it... we'll deal with them like 2 normal objects below.
                   String s1 = o1.toString();
                   String s2 = o2.toString();
                   return s1.compareTo(s2) * ascending;
         * This method sorts the rows using Java's Collections class.
         * After sorting, it changes the state of the column -
         * if the column was ascending, its new state is descending, and vice versa.
         public void sort()
              Collections.sort(dataVector, this);          
              //Collections.sort(dataVector);
              Integer val = (Integer)ascendCol.get(currCol);
              ascendCol.remove(currCol);
              if (val.equals(one)) // change the state of the column
                   ascendCol.add(currCol, minusOne);
              else
                   ascendCol.add(currCol, one);
         public void sortByColumn(int column)
              this.currCol = column;
              sort();
         public void setSortOrder(int numberOfColumns)
              for (int i = 0; i < numberOfColumns; i++)
                   ascendCol.add(one);
         public void setTesting(String inStr)
              testing = inStr;
    Any help would be greatly apprciated and rewarded...

    Hi Don,
    be aware that after the method onHeaderClick(Event event) is executed the method doProcessBeforeOutput() is executed as well.
    I look over your code and found the following:
    1) In method onHeaderClick you sort the table model and store the table model in the bean
    2) In method doProcessBeforeOutput() you create a new table model from scratch (in helper method tableViewFormat())and store it in the bean. Thus you overwrite the sorted model.
    I suggest that you move the initial creation of the table model in method doInitialization(). Do not forget to store the created table in the bean. In method doProcessBeforeOutput() you retrieve the table model from the bean instead of creating a new one for every request.
    Best regards,
    Martin

  • Htmlb:TableView title problem

    Hello,
    recently we installed some support packages (now at SP59). After the installation my TableView titles are not shown correctly. Before the installation the titles were displayed completely, now after the installation the width of the column is only determined by the shown values in the columns.
    The problem I have now is that vor a column which only contains the values A or B, the title "Status" is not shown. Any suggestions?
    ALEX

    If you are using an iterator,
    use the method IF_HTMLB_TABLEVIEW_ITERATOR~GET_COLUMN_DEFINITIONS
    there you can edit the width of your columns:
    APPEND INITIAL LINE TO p_column_definitions ASSIGNING <tv_column>.
      <tv_column>-columnname               = c_type.
      <tv_column>-sort                     = c_x.
      <tv_column>-title                    = c_energy_type.
      <tv_column>-disable_filter           = c_x.
      <tv_column>-edit                     = '1'.
      <tv_column>-width                    = 15.
    grtz
    Koen
    Message was edited by: Koen Labie

  • TableView refreshing problem

    Hi,
    I use Java FX 2.2 version and I have a problem with TableView refreshing. I am writing this post because I have not found any clear solution, but I know that there is a few post about this. Below is my pseudocode:
                table.getItems().clear();
                ObservableList<Entity> entities = {getting list of entities from DB}
                table.setItems(list of entitites);The code works with Java FX 2.0.2 version but after upgrade to new version it does'nt work. I am getting new portion of data from db and replace list but table rows doesnt refresh.
    I have been searching the solution for hours, but nothing works. It is a bug?
    Edited by: user12049238 on 2012-06-12 14:24

    Below is my simple test case. When you click refresh data in the table does not change, but when you make column name invisible and the next visible data will change.
    public class TestCase extends Application {
        public static void main(String[] args) {
            launch(args);
        @Override
        public void start(Stage primaryStage) {
            primaryStage.setTitle("Test case");
            primaryStage.setX(0);
            primaryStage.setY(0);
            Button refreshButton = new Button("Refresh");
            final TableView<Person> table = new TableView<>();
            table.setTableMenuButtonVisible(true);
            TableColumn c1 = new TableColumn("Id");
            TableColumn c2 = new TableColumn("Name");
            c1.setCellValueFactory(new PropertyValueFactory<Person, Long>("id"));
            c2.setCellValueFactory(new PropertyValueFactory<Person, String>("name"));
            table.getColumns().addAll(c1, c2);
            refreshButton.setOnAction(new EventHandler<ActionEvent>() {
                @Override
                public void handle(ActionEvent arg0) {
                    table.getItems().clear();
                    List<Person> person = getPerson2();
                    table.setItems(FXCollections.observableList(person));
            BorderPane pane = new BorderPane();
            pane.setCenter(table);
            pane.setBottom(refreshButton);
            primaryStage.setScene(new Scene(pane, 400, 400));
            primaryStage.show();
            List<Person> person = getPerson1();
            table.setItems(FXCollections.observableList(person));
        private List<Person> getPerson1() {
            List<Person> p = new ArrayList<>();
            Person p1 = new Person();
            p1.setId(1l);
            p1.setName("name1");
            Person p2 = new Person();
            p2.setId(2l);
            p2.setName("name2");
            p.add(p1);
            p.add(p2);
            return p;
        private List<Person> getPerson2() {
            List<Person> p = new ArrayList<>();
            Person p1 = new Person();
            p1.setId(1l);
            p1.setName("updated name1");
            Person p2 = new Person();
            p2.setId(2l);
            p2.setName("updated name2");
            p.add(p1);
            p.add(p2);
            return p;
    public class Person {
            private Long id;
            private String name;
            public Long getId() {
                return id;
            public void setId(Long id) {
                this.id = id;
            public String getName() {
                return name;
            public void setName(String name) {
                this.name = name;
            @Override
            public boolean equals(Object obj) {
                if (obj == null) {
                    return false;
                if (getClass() != obj.getClass()) {
                    return false;
                final Person other = (Person) obj;
                if (this.id != other.id) {
                    return false;
                return true;
            @Override
            public int hashCode() {
                int hash = 7;
                hash = 89 * hash + (int) (this.id ^ (this.id >>> 32));
                return hash;
    }What is the way to create new Jira issue? Could you help me?

  • HTMLB: tableview filter problems

    Hi,
    We developed a BSP application in CRM Web_IC. Whenever user goes to this screen, it retrieves the results from SAP CRM table and lists the entries. We used htmlb:tableview with filter attribute set to 'SERVER'. The first row of the entry is used to filter the entries displayed based on wildcard search and redisplay the same.
    We noticed that all this handled by client side eventing (Java Script) and it works okay in our development and testing environment.
    But we got wierd results when it went for user testing. On some of the machines, the page looks refreshed but the list display does not change based on the search. We thought it might be caching problem so we tried with different IE settings, it looks okay for some time on one of the machines but the problem gets repeated after wards. The situation is we cannot afford intermittent problems.
    OS are win'2000 and XP and browser is IE 6 with sp1 and sp2. The problem is not consistent so none of the combinations actually suggested if the problem is related to one area.
    Has anyone experienced similar to above. Any ideas are welcome.
    Message was edited by: Raju Datla

    Thanks Rainer,
    Without making any changes, today majority of the users are did not encounter the problem. I could not check the browser server cache settings as the BSP is using MVC and these fields are missing.
    Thanks and Regards,
    Raju
    I lost how to add points. I remember there was a document on how to add points, which I could not get by search. Could you help me how I can award points to you.
    Sorry for that and Thanks
    Message was edited by: Raju Datla

  • ICWC htmlb:tableview filter problems

    Hi,
    We developed a BSP application in CRM Web_IC. Whenever user goes to this screen, it retrieves the results from SAP CRM table and lists the entries. We used htmlb:tableview with filter attribute set to 'SERVER'. The first row of the entry is used to filter the entries displayed based on wildcard search and redisplay the same.
    We noticed that all this handled by client side eventing (Java Script) and it works okay in our development and testing environment.
    But we got wierd results when it went for user testing. On some of the machines, the page looks refreshed but the list display does not change based on the search. We thought it might be caching problem so we tried with different IE settings, it looks okay for some time on one of the machines but the problem gets repeated after wards. The situation is we cannot afford intermittent problems.
    OS are win'2000 and XP and browser is IE 6 with sp1 and sp2. The problem is not consistent so none of the combinations actually suggested if the problem is related to one area.
    Has anyone experienced similar to above. Any ideas are welcome.

    Hi Sasi,
    Unfortunately I could not get any direct solution to the problem. I chased SAP OSS and SAP direct consultant who was working with us with no solution. Last time, I heard it was sent to htmlb team at SAP. I stopped chasing after that as project gone live and I fixed the problem by putting a search area and button using client side eventing. 
    If you read the source code once the page is displayed, you can see that SAP writes Javascript to handle the search. I copied the code as Javascript function and placed a button to fire this function which handles the filter as normally SAP does.
    Regards,
    Raju

  • TableView Customizing Problems

    Hi all,
    i`m trying to display a Table with a some columns and a selektor (radio button).
    I have different tables with this setup, but i can`t set the width of the differnt cells. I tried via TableView getColumn("xx" and setWidth("100 px") or setWidth("50 %"); but without success.
    Then i implemented an own CellRenderer. And it renders my cells, but i cannot influence the width of the TextView. (I have set the width AND set the wrapping attribute to true, to get the width repsected)
    Ok, now i`m a little clueless.
    How can i set the width of the different cells ?
    In my simplest table i want to have a table with the radio button and one cell that spans the remaining row size.
    Maybe someone can point me in the right directions or supply me some sample code.
    Best Regards
    Odo

    Hi,
    here is the code that i use to setup the tableView:
    <hbj:tableView
         id="tagTableView"
         design="ALTERNATING"
         headerVisible="true"
         footerVisible="true"
         fillUpEmptyRows="true"
         navigationMode="BYPAGE"
         selectionMode="SINGLESELECT"
         visibleFirstRow="1"
         visibleRowCount="5"
         width="100 %" >
         <%      
    tagTableView.setModel(tagTableBean.getTagTable().getModel());
    tagTableView.useRowSelection(tagTableBean.getTagTable().getTableView());
    tagTableView.setHeaderText("Defined Tags");
    tagTableView.setOnNavigate("onTagNavigate");
    tagTableView.setOnRowSelection("onTagRowSelection");
    %>
    I have tried to set the width of the column in the scriptlet but with no success.
    com.sapportals.htmlb.table.TableView tv = (com.sapportals.htmlb.table.TableView)pageContext.findAttribute("tagTableView");
    tv.getColumn(1).setWidth("100 %");
    Hi,
    the problem is solved. When a table has only two columns (one select box / radio button and one content column) the  
    img that is placed in the radio button column needs to have the size set (1x1). If not, the IE6 stretches this column and it looks ugly.
    A workaround for this is to add an empty column and set the width of the middle column to max. Works and do not look that ugly.
    Better solutions are welcome.
    Best Regards,
    Odo
    Message was edited by: Oliver Dohmen

  • Dynamic Table in Tableview Download Problem

    Hello,
    I've got a Problem with a dynamic displayed table in a field-symbol. Table is displayed and all that works fine, but when I try download this table into Excel (via Button), the field symbol in the Processing event is initial and data reference is also initial, so there is nothing to dereference. The field symbol is filled in OnInitialization Event and ref to data element is set. Can anyone help please?
    Greetings
    Joerg

    Hi Joerg,
    is yor BSP statefull or not ?
    Regards,
    Fabri

  • TableView: ITERATOR in MVC

    Using the MVC design pattern, ITERATOR methods (e.g. IF_HTMLB_TABLEVIEW_ITERATOR~RENDER_CELL_START) can be implemented in the Controller, in the Model or in a seprated class.
    I give my vote to the CONTROLLER...
    And you, which is the best place where to implement it?
    Sergio

    Hi Sergio,
    it depends on what exactly you want to do in your methods.
    For pure tableview rendering problems I would recommend leaving it in the iterator.
    I try to keep my application's methods well structured and always in the class they do belong most to - thinking about placing iterator methods somewhere else is something I have not thought of before, and I don't think I will do so anytime ...
    Using the controller as you suggested ... not so appropriate imo, as a controller was introduced to separate display and application code, and the iterator is used to change display/rendering of a tableview.
    Max

  • No DataGrid component?

    I believe JavaFX seriously needs a DataGrid component to render tabular data as a GRID, where data can be paged, sorted, filtered like other data grid solutions (Adobe Flex, jQGrid, DataTables etc).
    This is one of the basic controls, any serious application would definitely need. TableView is the only closest thing I found, but that doesn't fit the bill at all.
    The DataFx project looks promising, but is very primitive.
    I hope Oracle will come up with a pretty GRID control soon, to beat the competition. We were planning to go with JavaFX and the only thing that is stopping us is the lack of a GRID component, we have to look for other web-based alternatives now.

    I think there's more to the TableView API than you're seeing, as it's supported by the JavaFX Properties and Collections APIs. The columns are exposed as a mutable, observable List, as is the data. So the columns are dynamic and can be readily changed as necessary, the table will update automatically.
    I used you example as a way to test this out; I've made no effort whatsoever to make this look good, the css is relatively straightforward. Also, I have no knowledge whatsoever of your business domain, so this will likely look somewhat naive. I think the code structure might be helpful though. There are some things I wish were a bit different but I'll come to that after the code.
    I'm going to assume you have some kind of data model and some way of knowing when the data's changed. I've mocked this up with a DataModel class with listener notification, but there are other ways this could happen (could be an EJB, for example). I've made this completely agnostic with respect to JavaFX.
    DataModel.java (a mockup of something I assume you already have existing):
    import java.util.ArrayList;
    import java.util.List;
    public class DataModel {
         private double minDeviation ;
         private double maxDeviation ;
         private int numDeviationCategories ;
         private int numRows ;
         private List<DataListener> listeners ;
         public DataModel(double minDeviation, double maxDeviation,
                   int numDeviationCategories, int numRows) {
              this.minDeviation = minDeviation;
              this.maxDeviation = maxDeviation;
              this.numDeviationCategories = numDeviationCategories;
              this.numRows = numRows;
              this.listeners = new ArrayList<DataListener>();
         public String getValue(int row, double deviation) {
              int category = (int) ((numDeviationCategories - 1)*(deviation - minDeviation) / (maxDeviation - minDeviation)) ;
              return String.format("f(%d, %d)", category+1, row+1);
         public double getMinDeviation() {
              return minDeviation;
         public void setMinDeviation(double minDeviation) {
              if (minDeviation != this.minDeviation) {
                   this.minDeviation = minDeviation;
                   fireDeviationRangeChanged();
         public double getMaxDeviation() {
              return maxDeviation;
         public void setMaxDeviation(double maxDeviation) {
              if (maxDeviation != this.maxDeviation) {
                   this.maxDeviation = maxDeviation;
                   fireDeviationRangeChanged();
         public int getNumDeviationCategories() {
              return numDeviationCategories;
         public void setNumDeviationCategories(int numDeviationCategories) {
              if (numDeviationCategories != this.numDeviationCategories) {
                   this.numDeviationCategories = numDeviationCategories;
                   fireNumDeviationCategoriesChanged();
         public int getNumRows() {
              return numRows;
         public void setNumRows(int numRows) {
              if (this.numRows != numRows) {
                   this.numRows = numRows;
                   fireNumRowsChanged();
         public void addDataListener(DataListener l) {
              listeners.add(l);
         public void removeDataListener(DataListener l) {
              listeners.remove(l);
         private void fireDeviationRangeChanged() {
              DataEvent event = new DataEvent(this);
              for (DataListener l : listeners) {
                   l.deviationRangeChanged(event);
         private void fireNumDeviationCategoriesChanged() {
              DataEvent event = new DataEvent(this);
              for (DataListener l : listeners) {
                   l.numDeviationCategoriesChanged(event);
         private void fireNumRowsChanged() {
              DataEvent event = new DataEvent(this);
              for (DataListener l : listeners) {
                   l.numRowsChanged(event);
    }And there are two almost trivial supporting classes to support the listener notification:
    public interface DataListener {
         public void deviationRangeChanged(DataEvent event);
         public void numDeviationCategoriesChanged(DataEvent event);
         public void numRowsChanged(DataEvent event);
    public class DataEvent {
         private final DataModel source ;
         public DataEvent(DataModel source) {
              this.source = source;
         public DataModel getSource() {
              return source;
    }The TableView exposes ObservableLists for the columns and the data. We need to update those lists when the data or column structure changes. So we need an adapter to sit in front of our generic DataModel and manipulate those lists when the data changes. This class will take a reference to a DataModel in addition to references to the column list and data list; it will listen for notifications from the DataModel and update the lists as necessary. (I'm implementing each row in the table simply as a List<String>, and we retrieve each element from the row using a custom CellValueFactory.)
    TableDataModel.java:
    public class TableDataModel {
         private DataModel model ;
         private final ObservableList<TableColumn<List<String>, ?>> columns ;
         private final ObservableList<List<String>> items ;
         public TableDataModel(DataModel model, ObservableList<TableColumn<List<String>, ?>> columns, ObservableList<List<String>> items) {
              this.model = model ;
              this.columns = columns;
              this.items = items ;
              buildColumns();
              buildItems();
              model.addDataListener(new ModelListener());
         private void buildColumns() {
              int numCols = model.getNumDeviationCategories();
              List<TableColumn<List<String>, String>> colList = new ArrayList<TableColumn<List<String>, String>>();
              double minDeviation = model.getMinDeviation() ;
              double maxDeviation = model.getMaxDeviation() ;
              double colDeviationIncrement = (maxDeviation - minDeviation) / (numCols-1) ;
              Format percentFormat = DecimalFormat.getPercentInstance();
              for (int col=0; col<numCols; col++) {
                   String colTitle = percentFormat.format(minDeviation + col*colDeviationIncrement);
                   TableColumn<List<String>, String> column = new TableColumn<List<String>, String>(colTitle);
                   final int colIndex = col ;
                   column.setCellValueFactory(new Callback<TableColumn.CellDataFeatures<List<String>,String>,ObservableValue<String>>() {
                        @Override
                        public ObservableValue<String> call(
                                  CellDataFeatures<List<String>, String> cellDataFeatures) {
                             List<String> data = cellDataFeatures.getValue();
                             return new SimpleStringProperty(data.get(colIndex));
                   colList.add(column);
              columns.clear();
              columns.addAll(colList);
         private void buildItems() {
              List<List<String>> itemList = new ArrayList<List<String>>();
              int numCols = model.getNumDeviationCategories() ;
              for (int row = 0; row<model.getNumRows(); row++) {
                   List<String> data = new ArrayList<String>();
                   double minDeviation = model.getMinDeviation() ;
                   double colDeviationIncrement = (model.getMaxDeviation() - minDeviation) / (numCols-1) ;
                   for (int col = 0 ; col < numCols; col++) {
                        double deviation = minDeviation + col * colDeviationIncrement ;
                        data.add(model.getValue(row, deviation));
                   itemList.add(data);
              items.clear();
              items.addAll(itemList);
         private class ModelListener implements DataListener {
              @Override
              public void deviationRangeChanged(DataEvent event) {
                   double minDeviation = model.getMinDeviation();
                   double maxDeviation = model.getMaxDeviation();
                   int numCols = model.getNumDeviationCategories();
                   double colDeviationIncrement = (maxDeviation - minDeviation) / (numCols-1);
                   Format percentFormat = DecimalFormat.getPercentInstance();
                   for (int col=0; col<numCols; col++) {
                        String colTitle = percentFormat.format(minDeviation + col*colDeviationIncrement);
                        columns.get(col).setText(colTitle);
              @Override
              public void numDeviationCategoriesChanged(DataEvent event) {
                   buildItems();
                   buildColumns();
              @Override
              public void numRowsChanged(DataEvent event) {
                   buildItems();
    }To test this out, I have a simple UI for changing the range of "deviations" displayed, the number of columns, and the number of rows. The controller for the UI simply instantiates a DataModel and passes calls to it when the user changes these values. In real life, of course, the changes to the data model could come from anywhere - likely from polling a server or server push. The UI also contains the TableView, retrieves the columns and items from it, and passes those, along with the data model to a TableDataModel which ties it all together. This isn't really part of the infrastructure, but for completeness here's the controller:
    Controller.java
    public class Controller {
         @FXML private TableView<List<String>> tableView ;
         @FXML private TextField minDevTF ;
         @FXML private TextField maxDevTF ;
         @FXML private TextField numColsTF ;
         @FXML private TextField numRowsTF ;
         @FXML private Button minDevIncButton ;
         @FXML private Button minDevDecButton ;
         @FXML private Button maxDevIncButton ;
         @FXML private Button maxDevDecButton ;
         @FXML private Button numColsIncButton ;
         @FXML private Button numColsDecButton ;
         @FXML private Button numRowsIncButton ;
         @FXML private Button numRowsDecButton ;
         private DataModel model ;
         public void initialize() {
              model = new DataModel(0.8, 1.2, 5, 6);
              final TableDataModel tableModel = new TableDataModel(model, tableView.getColumns(), tableView.getItems());
              model.addDataListener(new DataListener() {
                   @Override
                   public void deviationRangeChanged(DataEvent event) {
                        if (model.getMaxDeviation() - model.getMinDeviation() <= 0.01) {
                             minDevIncButton.setDisable(true);
                             maxDevDecButton.setDisable(true);
                        } else {
                             minDevIncButton.setDisable(false);
                             maxDevDecButton.setDisable(false);
                        Format percentFormat = DecimalFormat.getPercentInstance();
                        minDevTF.setText(percentFormat.format(model.getMinDeviation()));
                        maxDevTF.setText(percentFormat.format(model.getMaxDeviation()));
                   @Override
                   public void numDeviationCategoriesChanged(DataEvent event) {
                        numColsDecButton.setDisable(model.getNumDeviationCategories() <= 2);
                        numColsTF.setText(Integer.toString(model.getNumDeviationCategories()));
                   @Override
                   public void numRowsChanged(DataEvent event) {
                        numRowsDecButton.setDisable(model.getNumRows() <= 2);
                        numRowsTF.setText(Integer.toString(model.getNumRows()));
              Format percentFormat = DecimalFormat.getPercentInstance();
              minDevTF.setText(percentFormat.format(model.getMinDeviation()));
              maxDevTF.setText(percentFormat.format(model.getMaxDeviation()));
              numColsTF.setText(Integer.toString(model.getNumDeviationCategories()));
              numRowsTF.setText(Integer.toString(model.getNumRows()));
         public void decrementMinDeviation() {
              model.setMinDeviation(model.getMinDeviation() - 0.01);
         public void incrementMinDeviation() {
              model.setMinDeviation(model.getMinDeviation() + 0.01);
         public void decrementMaxDeviation() {
              model.setMaxDeviation(model.getMaxDeviation() - 0.01);
         public void incrementMaxDeviation() {
              model.setMaxDeviation(model.getMaxDeviation() + 0.01);
         public void decrementNumColumns() {
              model.setNumDeviationCategories(model.getNumDeviationCategories() - 1);
         public void incrementNumColumns() {
              model.setNumDeviationCategories(model.getNumDeviationCategories() + 1);
         public void decrementNumRows() {
              model.setNumRows(model.getNumRows() - 1);
         public void incrementNumRows() {
              model.setNumRows(model.getNumRows() + 1);
    }Here's the FXML for the UI:
    root.fxml:
    <?xml version="1.0" encoding="UTF-8"?>
    <?import javafx.scene.layout.BorderPane?>
    <?import javafx.scene.control.ScrollPane?>
    <?import javafx.scene.layout.HBox?>
    <?import javafx.scene.layout.VBox?>
    <?import javafx.scene.layout.FlowPane?>
    <?import javafx.scene.control.TextField?>
    <?import javafx.scene.control.Button?>
    <?import javafx.scene.control.Label?>
    <?import javafx.scene.control.TableView?>
    <?import javafx.scene.shape.Path?>
    <?import javafx.scene.shape.MoveTo?>
    <?import javafx.scene.shape.LineTo?>
    <?import javafx.scene.shape.ClosePath?>
    <?import javafx.scene.paint.Color?>
    <?import javafx.scene.control.ProgressIndicator?>
    <BorderPane xmlns:fx="http://javafx.com/fxml"
         fx:controller="edu.marshall.denvir.tests.gridlike.Controller">
         <top>
              <FlowPane>
                   <HBox>
                        <Label text="Min Deviation:"/>
                        <TextField fx:id="minDevTF" editable="false" />
                        <VBox>
                             <Button fx:id="minDevIncButton" prefWidth="20" prefHeight="10" minWidth="20" minHeight="10" onAction="#incrementMinDeviation">
                                  <graphic>
                                  <Path fill="BLACK">
                                       <elements>
                                            <MoveTo x="0" y="4"/>
                                            <LineTo x="2" y="0"/>
                                            <LineTo x="4" y="4"/>
                                            <ClosePath/>
                                       </elements>
                                  </Path>
                                  </graphic>                              
                             </Button>
                             <Button fx:id="minDevDecButton" prefWidth="20" prefHeight="10" minWidth="20" minHeight="10" onAction="#decrementMinDeviation">
                                  <graphic>
                                  <Path fill="BLACK">
                                       <elements>
                                            <MoveTo x="0" y="4"/>
                                            <LineTo x="2" y="0"/>
                                            <LineTo x="4" y="4"/>
                                            <ClosePath/>
                                       </elements>
                                  </Path>
                                  </graphic>                              
                             </Button>
                        </VBox>
                   </HBox>
                   <HBox>
                        <Label text="Max Deviation:" />
                        <TextField fx:id="maxDevTF" editable="false" />
                        <VBox>
                             <Button fx:id="maxDevIncButton" prefWidth="20" prefHeight="10" minWidth="20" minHeight="10"  onAction="#incrementMaxDeviation" styleClass="increment-button">
                                  <graphic>
                                  <Path fill="BLACK">
                                       <elements>
                                            <MoveTo x="0" y="4"/>
                                            <LineTo x="2" y="0"/>
                                            <LineTo x="4" y="4"/>
                                            <ClosePath/>
                                       </elements>
                                  </Path>
                                  </graphic>
                             </Button>
                             <Button fx:id="maxDevDecButton" prefWidth="20" prefHeight="10" minWidth="20" minHeight="10"  onAction="#decrementMaxDeviation">
                                  <graphic>
                                  <Path fill="BLACK">
                                       <elements>
                                            <MoveTo x="0" y="4"/>
                                            <LineTo x="2" y="0"/>
                                            <LineTo x="4" y="4"/>
                                            <ClosePath/>
                                       </elements>
                                  </Path>
                                  </graphic>
                             </Button>
                        </VBox>
                   </HBox>
                   <HBox>
                        <Label text="Number of columns:" />
                        <TextField fx:id="numColsTF" editable="false" />
                        <VBox>
                             <Button fx:id="numColsIncButton" prefWidth="20" prefHeight="10" minWidth="20" minHeight="10" onAction="#incrementNumColumns">
                                  <graphic>
                                  <Path fill="BLACK">
                                       <elements>
                                            <MoveTo x="0" y="4"/>
                                            <LineTo x="2" y="0"/>
                                            <LineTo x="4" y="4"/>
                                            <ClosePath/>
                                       </elements>
                                  </Path>
                                  </graphic>
                             </Button>
                             <Button fx:id="numColsDecButton" prefWidth="20" prefHeight="10" minWidth="20" minHeight="10" onAction="#decrementNumColumns">
                                  <graphic>
                                  <Path fill="BLACK">
                                       <elements>
                                            <MoveTo x="0" y="4"/>
                                            <LineTo x="2" y="0"/>
                                            <LineTo x="4" y="4"/>
                                            <ClosePath/>
                                       </elements>
                                  </Path>
                                  </graphic>
                             </Button>
                        </VBox>
                   </HBox>
                   <HBox>
                        <Label text="Number of Rows:" />
                        <TextField fx:id="numRowsTF" editable="false" />
                        <VBox>
                             <Button fx:id="numRowsIncButton" prefWidth="20" prefHeight="10" minWidth="20" minHeight="10"  onAction="#incrementNumRows">
                                  <graphic>
                                  <Path fill="BLACK">
                                       <elements>
                                            <MoveTo x="0" y="4"/>
                                            <LineTo x="2" y="0"/>
                                            <LineTo x="4" y="4"/>
                                            <ClosePath/>
                                       </elements>
                                  </Path>
                                  </graphic>
                             </Button>
                             <Button fx:id="numRowsDecButton" prefWidth="20" prefHeight="10" minWidth="20" minHeight="10" onAction="#decrementNumRows">
                                  <graphic>
                                  <Path fill="BLACK">
                                       <elements>
                                            <MoveTo x="0" y="4"/>
                                            <LineTo x="2" y="0"/>
                                            <LineTo x="4" y="4"/>
                                            <ClosePath/>
                                       </elements>
                                  </Path>
                                  </graphic>
                             </Button>
                        </VBox>
                   </HBox>
              </FlowPane>
         </top>
         <center>
                   <TableView fx:id="tableView"/>
         </center>
    </BorderPane>and finally the test driver:
    Gridlike.java:
    public class Gridlike extends Application {
         @Override
         public void start(Stage primaryStage) throws Exception {
              Parent root = FXMLLoader.load(getClass().getResource("root.fxml"));
              Scene scene = new Scene(root, 600, 400);
              primaryStage.setScene(scene);
              primaryStage.sizeToScene();
              primaryStage.show();
         public static void main(String[] args) {
              launch(args);
    }So that seems to me not to be too bad. Obviously in the real world there's likely to be way more functionality in the data model and table data model implementations, but the structure is pretty clean and it should integrate pretty nicely with existing structures without much effort.
    One thing I don't like is having to pass the ObservableLists to the TableDataModel. I'd prefer the TableDataModel simply to instantiate it's own lists and expose them, the way it is seems like too much strong couple from the model to the view. The problem is that the TableView only exposes ObservableLists. If it exposed ListPropertys, then those properties could just be bound to arbitrary list properties (or observable lists) exposed by a TableDataModel, which I think would be a bit cleaner.
    In terms of having APIs for binding directly from TableViews to JDBC code, or similar, I think that would be nice but is probably a bit unrealistic at this stage. What happened in the web app world was that this kind of functionality was implemented by third party frameworks, and only after the use cases had really settled down did Sun/Oracle provide standard implementations (JPA and JSF, depending on what you're looking for). I don't think we'll have to wait as long as we waited for those, but I'd guess it will be a while.
    The row headers, however, would be pretty nice, and it seems those could be fairly easily added to the TableView API. It shouldn't be too hard to create a column for them and style it so it looks different, but it would mess with the cleanliness of the data model.
    Just my $0.02 worth...

  • Problem with iterator in tableview

    Hi, Im having a problem with an iterator in a tableview. Sometime ago I use an iterator in a BSP with flow logic, I created the class fill the methods GET_COLUMN_DEFINITIONS and RENDER_CELL_START. And worked fine.
    Now, Im working in another BSP and this time I wanted to use MVC, so I have been reading but cant figure it out what Im missing out.
    In the controller of my page I add the Interface IF_HTMLB_TABLEVIEW_ITERATOR
    I ridefine the methods GET_COLUMN_DEFINITIONS and RENDER_CELL_START (I think that you dont have to redifine GET_COLUMN_DEFINITIONS but did it anyway just in case).
    This is my RENDER_CELL_START
      IF NOT ( p_column_key = 'ICON' ).
        RETURN.
      ENDIF.
      FIELD-SYMBOLS: <row> TYPE ANY, <col> TYPE ANY.
      DATA: ti_results TYPE ZBSPREP_VEND_T,
                 wa_results TYPE ZBSPREP_VEND.
      ASSIGN p_row_data_ref->* TO <row>.
      ASSIGN COMPONENT p_column_key OF STRUCTURE <row> TO <col>.
      wa_results = <col>.
      DATA: html_bee TYPE REF TO CL_BSP_BEE_HTML.
      CREATE OBJECT html_bee.
      LOOP AT it_results INTO wa_results.
        icon = CL_BSP_MIMES=>SAP_ICON( id = 'ICON_GREEN_LIGHT' ).
      ENDLOOP.
      p_replacement_bee = CL_HTMLB_IMAGE=>FACTORY( id = p_cell_id src = icon ).
    In my table view the column ICON doesnt show anything and the rare part is if I put breakpoint in the method and execute the page doesnt stop.
    So I dont know if Im missing something.
    My tableview layout is this:
    <htmlb:tableView id             = "Monitor"
                                     selectionMode  = "SINGLESELECT"
                                     onRowSelection = "rowSelection"
                                     table          = "<%= it_results %>"
                                     iterator        = "<%= iterator  %>"
                                     design         = "ALTERNATING"
                                     filter         = "SERVER"
                                     sort           = "SERVER"
                                     headerVisible  = "FALSE"
                                     footerVisible  = "FALSE">
    I declare a attribute iterator TYPE IF_HTMLB_TABLEVIEW_ITERATOR.
    Someone could give a hand ?

    Solved, I forget to set the attribute of the view in the REQUEST Method.
    result_view->set_attribute( name = 'iterator' value = me ).

  • Problems loading text to xib using plist in tableview's selected cell

    I am developing an app that starts with a grouped tableview cell.  Each cell has an image, text, and description from a plist.  When a cell is chosen a xib is loaded by a view controller in the plist.  I want to load into the xib some text, an image, and a sound file that is in the plist (dict for that cell).  This way I don't have to have lots of view controllers and xibs.  I have been able to load the xib using this method but I can't get the images and text to load.  I have been able to do it when I don't have a grouped table view but when I add the grouping in the plist the connection is lost.  below is my code.  Could someone look at it and tell me where I've gone wrong, how to correct it, or another way to do what I want to do?
    I know I am not calling the right array and then dictionary but I don't know how to correct this.  Help please.
    //  RootViewController.h
    //  TableViewPush
    #import <UIKit/UIKit.h>
    @interface RootViewController :  UITableViewController <UITableViewDelegate, UITableViewDataSource>  {
    NSArray *tableDataSm;
    @property (nonatomic, retain) NSArray *tableDataSm;
    @end
    //  RootViewController.m
    //  TableViewPush
    #import "RootViewController.h"
    #import "Location One.h"
    #import "HowToUseViewController.h"
    #import "TableViewPushAppDelegate.h"
    @implementation RootViewController
    @synthesize tableDataSm;
    - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
        const NSDictionary *const row = [self rowForIndexPath:indexPath];
        NSString *wantedClassName = [row objectForKey:@"controller"];
        UIViewController *const vc = [[NSClassFromString (wantedClassName) alloc] init];
        NSLog(@"controller is -%@-", wantedClassName);
        [self.navigationController pushViewController:vc animated:YES];
        TableViewPushAppDelegate *appDelegate = ( TableViewPushAppDelegate *)[[UIApplication sharedApplication]delegate];
        appDelegate.myImage = [[NSString alloc]initWithFormat:@"%@",[[tableDataSm objectAtIndex:indexPath.row]objectForKey:@"picture"]];
    NSLog(@"%@", appDelegate.myImage);
    appDelegate.textView = [[NSString alloc]initWithFormat:@"%@",[[tableDataSm objectAtIndex:indexPath.row]objectForKey:@"description"]];
        [vc release];
    //  TableViewPushAppDelegate.h
    //  TableViewPush
    #import <UIKit/UIKit.h>
    @class RootViewController, HowToUseViewController;
    @interface TableViewPushAppDelegate : UIViewController <UIApplicationDelegate>  {
        NSString *myImage;
        NSString *textView;
        UIWindow *window;
        UINavigationController *navigationController;
        HowToUseViewController *howToUseViewController;
    @property (nonatomic, retain) IBOutlet UIWindow *window;
    @property (nonatomic, retain) IBOutlet RootViewController *viewController;
    @property (nonatomic, retain) IBOutlet UINavigationController *navigationController;
    @property(retain,nonatomic)NSString *myImage;
    @property(retain,nonatomic)NSString *textView;
    @end
    //  TableViewPushAppDelegate.m
    //  TableViewPush
    #import "TableViewPushAppDelegate.h"
    #import "RootViewController.h"
    @implementation TableViewPushAppDelegate
    @synthesize window;
    @synthesize navigationController;
    @synthesize viewController;
    @synthesize myImage;
    @synthesize textView;
    //  Location One.h
    //  TableViewPush
    #import <UIKit/UIKit.h>
    #import "RootViewController.h"
    @interface   Location_One: UIViewController  {
        IBOutlet UIImageView *imageOne;
    IBOutlet UITextView  *textViewTwo;
    @property (nonatomic, retain) UITextView *textViewTwo;
    @property (nonatomic, retain) UIImageView *imageOne;
    @end
    //  Location One.m
    //  TableViewPush
    #import "Location One.h"
    #import "TableViewPushAppDelegate.h"
    @implementation Location_One
    @synthesize textViewTwo;
    @synthesize imageOne;
    -(id) init{
        if((self = [super initWithNibName:@"Location One" bundle:nil])){
        return self;
    - (void)viewDidLoad {
           NSLog(@"InView did load");
    [super viewDidLoad];
        TableViewPushAppDelegate *appDelegate = (TableViewPushAppDelegate *)[[UIApplication sharedApplication]delegate];
    textViewTwo.text = [[NSString alloc] initWithFormat:@"%@", appDelegate.textView];
    NSString *path = [[NSString alloc]initWithFormat:@"%@",appDelegate.myImage];
    UIImage *img = [UIImage imageNamed:path];
        [imageOne setImage:img];
    plist 
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <array>
         <dict>
              <key>header</key>
              <string>85710</string>
              <key>rows</key>
              <array>
                   <dict>
                        <key>text</key>
                        <string>52 Glass Illusions Studio</string>
                        <key>detailText</key>
                        <string>150 S Camino Seco, #119</string>
                        <key>image</key>
                        <string>VisualFEight.png</string>
                        <key>controller</key>
                        <string>Location_One</string>
                        <key>picture</key>
                        <string>VisualOne.png</string>
                        <key>audio</key>
                        <string>AudioOne.mp3</string>
                        <key>description</key>
                        <string>TextOne</string>
                   </dict>

    I think you problem lies in this part.
    - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath*)indexPath {
        const NSDictionary *const row = [self rowForIndexPath:indexPath];
        NSString *wantedClassName = [row objectForKey:@"controller"];
        UIViewController *const vc = [[NSClassFromString (wantedClassName) alloc] init];
        NSLog(@"controller is -%@-", wantedClassName);
        [self.navigationController pushViewController:vc animated:YES];
        TableViewPushAppDelegate *appDelegate = ( TableViewPushAppDelegate *)[[UIApplication sharedApplication]delegate];
        appDelegate.myImage = [[NSString alloc]initWithFormat:@"%@",[[tableDataSmobjectAtIndex:indexPath.row]objectForKey:@"picture"]];
    NSLog(@"%@", appDelegate.myImage);
    appDelegate.textView = [[NSString alloc]initWithFormat:@"%@",[[tableDataSm objectAtIndex:indexPath.row]objectForKey:@"description"]];
        [vc release];
    specifically the underlined part.  does this need modifying or completely rewritten.

  • Problem with checkbox selection in Tableview

    Hi All
    I am using table view with 8 columns - in the last 4 columns i have checkboxes for user input - i have a strange problem - when the table has multiple entries - for the last column i can only select the checkbox on line 1 - and i cannot select the checkbox on the remaining entries below - but for the other colums with checkboxes this is not the case
    The selection mode for the table is no line selection - since the table is already displayed with input enabled fields - this is to reduce the no of clicks for user
    Can anyone point out what is going wrong - how can i fix this - what i am doing wrong ?
    Thanks
    Sen

    Hi
    When i click on the checkbox for the 2nd or 3rd rows of the last column - nothing happens - the checkox is still active but nothing happens -
    this is the tableview code
    <htmlb:tableView id              = "Detail"
                     design          = "ALTERNATING"
                     headerText      = "Header Text"
                     onNavigate      = "onMyNavigate"
                     emptyTableText  = "test"
                     onRowSelection  = "onMyRowSelection"
                     fillUpEmptyRows = "false"
                     footerVisible   = "true"
                     visibleRowCount = "5"
                     table           = "<%= DETAILTAB %>"
                     iterator        = "<%= iterator %>" >
    and this is the code for the last column
    <htmlb:tableViewColumn columnName         = "OBSOFLGICON"
                               width               = "3"
                               type                = "user"
                               horizontalAlignment = "CENTER"
                               title               = "Obs" >
          <htmlb:checkbox />
        </htmlb:tableViewColumn>
    Thanks
    Sen

  • Problem with tableview iterator

    Dear friends.
    I try to adopt tableview iterator in my customer's BSP pages. So, I programmed test page.
    METHOD if_htmlb_tableview_iterator~render_row_start .
      m_row_ref ?= p_row_data_ref.
    ENDMETHOD.
    M_ROW_REF is "Static Attribute" and "Public" and "Type Ref To Z3TYDISP"
    z3tydisp has structure as below
    REQNO          NUMC     12
    VGUBUN          CHAR     1
    DSCOFVGUBUN     STRING     0
    REQDT          DATS     8
    RNAME          CHAR     10
    VCOMP          CHAR     30
    VNAME          CHAR     10
    VPLACE          CHAR     5
    VPLACEDSC     CHAR     20
    APPROVAL     CHAR     1
    DSCOFAPPROVAL     STRING     0
    AND... p_row_data_ref has structure below
    REQNO     N     12
    VGUBUN     C     1
    DSCOFVGUBUN     g     0
    REQDT     D     8
    RNAME     C     10
    VCOMP     C     30
    VNAME     C     10
    VPLACE     C     5
    VPLACEDSC     C     20
    APPROVAL     C     1
    DSCOFAPPROVAL     g     0
    In my option, p_row_data_ref has same structure compared with z3tydisp. But there is "CX_SY_MOVE_CAST_ERROR". How I have to define "z3tydisp"????

    >><b>M_ROW_REF is "Static Attribute" and "Public" and "Type Ref To Z3TYDISP"</b>
    instead of this make your M_ROW_REF a instantaneous attribute. since static attribute are intantiated only once when object created and are shared by all other intances. m_row_ref contains data about the table you are going to render using tableview. so it should be public, so that get different data for different iterator objects.
    your p_row_data_ref must be of type ref to data which is superior class of data types.
    and if you have defined iterator "IF_HTMLB_TABLEVIEW_ITERATOR" in your interfaces. then you need not to define structure for p_row_data_ref, its already there in interface.
    hope this will solve your problem,
    regards,
    hemendra

  • Having problem with two Tableview controls.

    Hi all,
    I have two tableview controls in my page. TV1 has list of employees. TV2 is populated with details based on the employee selected in TV1.
    The actual problem is, in TV1 when i goto next page using navigator and select an employee in 15th row, and select a detail row from TV2, TV1 gets refreshed and goes back to row 1.
    How can i avoid this?
    Thanks & Regards,
    Lalith

    Hi,
    you can bind the attribute of the tableView selectedRow = "//model/selected_row"
    to an attribute in your model class
    that way you can always find your selection if working stateful
    grtz
    Koen

Maybe you are looking for

  • To pass the value to final internal table

    hi all, in the report i have a select query has below SELECT SINGLE belnr           INTO (l_belnr)           FROM bkpf           WHERE bukrs = ls_bseg-bukrs            AND gjahr = ls_bseg-gjahr. i have an internal table gt_values , in this almost i h

  • HDMI - DVI - Composite (Will This Work)?

    I have an older big screen TV which does not have HDMI nor component video connections. Since AppleTV has HDMI and HDMI/DVI cables are available, is it possible to connect a DVI/Composite cable to the HDMI/DVI cable in order to output the video to th

  • Oracle distrebuted document capture commit problem

    hi,i am working with ODDC v10.1.3.5 using (UCM 11g commit driver) and every thing is going well except one problem that is when i commit to ucm there is a field called(subject) is not commited to UCM even it is maped through the commit driver . at th

  • How do you stop AddThis mouse over drop down menu or block AddThis?

    Apparently, someone has created a thing called AddThis that can be put into any webpage design. Supposedly, it is to help the reader share the great webpage they've found (or something??). Really, it seems to just be a way for a web designer to attra

  • AUTO CREATE Function in OM responsibility

    Hi, I did add "auto create" function to OM custom responsibility, i can open the form and query the requisitions but when i tried to create give me error message Function Not available in this responsibility. Change responsibilities or contact system