Booleans not rendering as JCheckBoxes in JTable

I've read several posts on trying to get JCheckBoxes to render in a JTable, and I've looked at the Tables tutorial, but I still can't figure out why my JTable isn't rendering Booleans as check-boxes. :-(
I thought rendering check-boxes was the the default behavior for cells with Boolean values. This doesn't seem to be the case. I can add a cell editor of type JCheckBox by simply instantiating a new DefaultCellEditor, but adding a cell renderer doesn't look so easy (I believe I have to create my own implementation class). I was trying to avoid that, because a) I'm working in Servoy (which means I'm working in a Rhino editor and need to access my own custom classes as plugins or beans), and b) my Java skills are weak.
So can anybody see anything about my code that is obviously wrong? Or do I have to roll up my sleeves and write my own DefaultTableCellRenderer bean/plugin?
Here's my code (remember - it's javascript instances of java objects). (Note: I'm not sure exactly what kinds of objects JSDataSet.getAsTableModel() returns to the JTable model, but creating my own JTable with a vector of vectors of Boolean objects, or setting a Boolean in the cell after the fact doesn't work either.)
Any tips would be greatly appreciated.
// convert dataset into JTable
var table = elements.monitoring;
table.model = treatments.getAsTableModel();
// modify column headers
var columns = table.columnModel;
columns.getColumn(0).setHeaderValue('Quantity');
columns.getColumn(0).setPreferredWidth(60);
columns.getColumn(1).setHeaderValue('Repeats/hr.');
columns.getColumn(1).setPreferredWidth(75);
columns.getColumn(2).setHeaderValue('TREATMENT');
columns.getColumn(2).setPreferredWidth(225);
// start treatment times at 8am
var j=8;
for (i=3;i<44;++i) {
     var j_int = Packages.java.lang.Integer(j);
     columns.getColumn(i).setHeaderValue(j_int);
     columns.getColumn(i).setPreferredWidth(10);
     if (j == 12) {
          j=0;
     ++j;
// center cell data
var cell_class = Packages.java.lang.String;
var table_renderer = table.getDefaultRenderer(cell_class);
table_renderer.setHorizontalAlignment(0);
// add JTable to JScrollPane viewport (necessary to display headers)
var viewport = elements.monitoring_pane.viewport;
viewport.add(table);

Ok, another problem -
I wound up throwing out the Rhino constructor method and implementing my own JTable class and importing it into the Rhino scope. I had to do that because I needed columns to render different types of objects - basically, the table cells should appear blank until they are selected and data is added to them, at which point they should be Boolean and render check-boxes - I got that to work by overriding the getCellRenderer method.
The problem is, I need to add some logic to the 'onClick' event for the table cell, so that I can add a blank check box, add a checked check box, or remove a check box. I looked at the Table tutorial and tried to do it by implementing the TableModelListener interface on my JTable and defining the tableChanged method. However, when I add the tableChanged method to my class, I get an ArrayIndexOutOfBoundsException.
Any tips would be greatly appreciated.
I instantiate the class in Rhino and add the TableModelListener like so:
var table = new Packages.my_classes.MyJTable();
table.model = model; // a working model defined elsewhere
table.getModel().addTableModelListener(table);Here's my class:
package my_classes;
import javax.swing.*;
import javax.swing.table.*;
import javax.swing.event.*;
public class MyJTable extends JTable implements TableModelListener {
     public TableCellRenderer getCellRenderer(int row, int column) {
          Object value = getValueAt(row,column);
            if (value == null) {
                 return getDefaultRenderer(JCheckBox.class);
            return super.getCellRenderer(row,column);
     public Class getColumnClass(int column) {
          if (column > 2) {
               return Boolean.class;
          } else {
               return Object.class;
     public void tableChanged(TableModelEvent e) {
          int row = e.getFirstRow();
          int column = e.getColumn();
          TableModel model = (TableModel) e.getSource();
          String columnName = model.getColumnName(column);
          Object data = model.getValueAt(row, column);
}

Similar Messages

  • Can not show the JCheckBox in JTable cell

    I want to place a JCheckBox in one JTable cell, i do as below:
    i want the column "d" be a check box which indicates "true" or "false".
    String[] columnNames = {"a","b","c","d"};
    Object[][] rowData = {{"", "", "", Boolean.FALSE}};
    tableModel = new DefaultTableModel(rowData, columnNames);
    dataTable = new JTable(tableModel);
    dataTable.getColumnModel().getColumn(3).setCellEditor(new DefaultCellEditor(new JCheckBox()));
    But when i run it, the "d" column show the string "false" or "true", not the check box i wanted.
    I do not understand it, can you help me?
    Thank you very much!
    coral9527

    Do not use DefaultTableModel, create your own table model and you should implement the method
    getColumnClass to display the boolean as checkbox ...
    I hope the following colde snippet helps you :
    class MyModel extends AbstractTableModel {
              private String[] columnNames = {"c1",
    "c2"};
    public Object[][] data ={{Boolean.valueOf(true),"c1d1"}};
         public int getColumnCount() {
         //System.out.println("Calling getColumnCount");
         return columnNames.length;
    public int getRowCount() {
    //System.out.println("Calling row count");
    return data.length;
    public String getColumnName(int col) {
    return columnNames[col];
    public Object getValueAt(int row, int col) {
    return data[row][col];
    * JTable uses this method to determine the default renderer/
    * editor for each cell. If we didn't implement this method,
    * then the last column would contain text ("true"/"false"),
    * rather than a check box.
    public Class getColumnClass(int c) {
    return getValueAt(0, c).getClass();
    * Don't need to implement this method unless your table's
    * editable.
    public boolean isCellEditable(int row, int col) {
    //Note that the data/cell address is constant,
    //no matter where the cell appears onscreen.
    return true;
    * Don't need to implement this method unless your table's
    * data can change.
    public void setValueAt(Object value, int row, int col) {
    data[row][col] = value;
    fireTableCellUpdated(row, col);

  • RichTree is not rendered properly when created in Managed Bean

    HI,
    I am trying to create af:tree in managed bean using RichTree. It is not rendering the tree nodes properly. It is only showing the nodes, node text is missing. I am using EL expression to show the value in node element. But when I am creating the af:tree in jspx page, it is working properly.
    Following is the code,
    JSPX Page ------------------------------------------------------------>
    <?xml version='1.0' encoding='windows-1252'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
    <jsp:directive.page contentType="text/html;charset=windows-1252"/>
    <f:view>
    <af:document id="document1" title="Tree Test">
    <af:form id="form1">
    <af:panelGroupLayout layout="horizontal">
    <af:spacer width="50" height="50"/>
    <af:panelGroupLayout layout="vertical">
    <h1>RCF Tree Component Test</h1>
    <af:spacer height="10" width="10"/>
    <h3>ADF Tree in JSPX</h3>
    <af:spacer height="5" width="10"/>
    <af:tree binding="#{treeTest.tree}" var="node" value="#{treeTest.treeModel}" rowSelection="multiple" rowDisclosureListener="#{treeTest.toggle}" selectionListener="#{treeTest.TableSelect}" inlineStyle="border:1px solid black;">
    <f:facet name="nodeStamp">
    <af:panelGroupLayout>
    <af:image source="#{node.icon}" inlineStyle="margin-right:3px; vertical-align:middle; height:14px; width:16px;"/>
    <af:outputText value="#{node.description}"/>
    </af:panelGroupLayout>
    </f:facet>
    </af:tree>
    </af:panelGroupLayout>
    <af:panelGroupLayout layout="vertical">
    <af:spacer height="65" width="10"/>
    <h3>ADF Tree in UI Bean</h3>
    <af:spacer height="5" width="10"/>
    <af:tree binding="#{treeTest.treeInBean}" inlineStyle="border:1px solid black;"/>
    </af:panelGroupLayout>
    </af:panelGroupLayout>
    </af:form>
    </af:document>
    </f:view>
    <!--oracle-jdev-comment:auto-binding-backing-bean-name:treeTest-->
    </jsp:root>
    Managed Bean ------------------------------------------------------------>
    import java.io.File;
    import java.util.ArrayList;
    import java.util.List;
    import javax.el.ExpressionFactory;
    import javax.el.ValueExpression;
    import javax.faces.context.FacesContext;
    import oracle.adf.view.rich.component.rich.data.RichTree;
    import oracle.adf.view.rich.component.rich.layout.RichPanelGroupLayout;
    import oracle.adf.view.rich.component.rich.output.RichImage;
    import oracle.adf.view.rich.component.rich.output.RichOutputText;
    import org.apache.myfaces.trinidad.event.RowDisclosureEvent;
    import org.apache.myfaces.trinidad.event.SelectionEvent;
    import org.apache.myfaces.trinidad.model.ChildPropertyTreeModel;
    import org.apache.myfaces.trinidad.model.TreeModel;
    public class TreeTest {
    private RichTree tree = new RichTree();
    private TreeModel treeModel;
    final public static String ROOT_DIR = ".";
    private RichTree treeInBean = new RichTree();
    public TreeTest() {
    List nodes = new ArrayList();
    FileNode rootNode = buildFileTree(ROOT_DIR);
    nodes.add(rootNode);
    treeModel = new ChildPropertyTreeModel(nodes, "children") ;
    private void createTreeInBean(List rootNode){
    ChildPropertyTreeModel l_model = new ChildPropertyTreeModel();
    l_model.setChildProperty("children");
    l_model.setWrappedData(rootNode );
    treeInBean.setValue( l_model);
    treeInBean.setRowSelection("multiple");
    treeInBean.setVar( "node" );
    RichOutputText comp = new RichOutputText();
    FacesContext l_context = FacesContext.getCurrentInstance();
    ExpressionFactory l_factory = l_context.getApplication().getExpressionFactory();
    ValueExpression l_expression = l_factory.createValueExpression( FacesContext.getCurrentInstance().getELContext(),
    "#{node.description}", String.class );
    comp.setValueExpression( "value", l_expression );
    RichImage img = new RichImage();
    img.setInlineStyle("margin-right:3px; vertical-align:middle; height:14px; width:16px;");
    ValueExpression l_expressionImg = l_factory.createValueExpression( FacesContext.getCurrentInstance().getELContext(),
    "#{node.icon}", String.class );
    //img.setValueExpression( "source", l_expressionImg );
    img.setSource("images/img1.png");
    RichPanelGroupLayout layout = new RichPanelGroupLayout();
    //layout.getChildren().add( img);
    //layout.getChildren().add( comp);
    //treeInBean.getChildren().add( layout);
    treeInBean.setNodeStamp( layout);
    treeInBean.getNodeStamp().getChildren().add( img );
    treeInBean.getNodeStamp().getChildren().add( comp );
    private static FileNode buildFileTree(String dirpath) {
    File root = new File(dirpath);
    return visitAllDirsAndFiles(root);
    private static FileNode visitAllDirsAndFiles(File dir) {
    FileNode parentNode = process(dir);
    if (dir.isDirectory()) {
    String[] children = dir.list();
    for (int i = 0; i < children.length; i++) {
    FileNode childNode = visitAllDirsAndFiles(new File(dir, children));
    parentNode.getChildren().add(childNode);
    return parentNode;
    public static FileNode process(File dir) {
    FileNode node = new FileNode(dir);
    return node;
    public void TableSelect(SelectionEvent p_event) {
    System.out.println(" Selection Event = " + p_event);
    RichTree l_tree = (RichTree)p_event.getSource();
    System.out.println("Display Row = " + l_tree.getSelectedRowKeys());
    TreeModel model = ((ChildPropertyTreeModel)l_tree.getValue());
    for (Object key : l_tree.getSelectedRowKeys()) {
    model.setRowKey(key);
    System.out.println("Model Data = " + ((FileNode)model.getRowData()));
    public void toggle(RowDisclosureEvent p_rowDisclosureEvent) {
    System.out.println(" Dislosure Event = " + p_rowDisclosureEvent);
    public void setTree(RichTree tree) {
              this.tree = tree;
    public RichTree getTree() {
    return tree;
    public void setTreeModel(TreeModel treeModel) {
    this.treeModel = treeModel;
    public TreeModel getTreeModel() {
    return treeModel;
    public void setTreeInBean(RichTree treeInBean) {
    this.treeInBean = treeInBean;
    public RichTree getTreeInBean() {
    List nodes = new ArrayList();
    FileNode rootNode = buildFileTree(ROOT_DIR);
    nodes.add(rootNode);
    createTreeInBean(nodes);
    return treeInBean;
    File Node Class-------------------------------------------------------------
    import java.io.File;
    import java.util.ArrayList;
    import java.util.Collection;
    public class FileNode {
    private Collection children;
    private boolean nodeSelected;
    private File file;
    public FileNode(File file) {
    this.file = file;
    children = new ArrayList();
    public boolean isDir() {
    return file.isDirectory();
    public boolean isFile() {
    return file.isFile();
    public String getDescription() {
    return file.getName();
    public Collection getChildren() {
    return children;
    public String getIcon(){
    if(children.size() == 0){
    return "images/img1.png";
    } else {
    return "images/img3.png";
    public int getChildCount() {
    if (children == null)
    return 0;
    else
              return children.size();
    public void setNodeSelected(boolean nodeSelected) {
    this.nodeSelected = nodeSelected;
    public boolean isNodeSelected() {
    return nodeSelected;
    public void setFile(File file) {
    this.file = file;
    public File getFile() {
    return file;
    @Override
    public String toString() {
    return getDescription();
    With Regards,
    Sujay

    HI,
    When you see the output of the code, you will find 2 different trees one with proper label and another with out labels. This tree is showing the folder structor. When i am creating the tree in managed bean, the EL expression of the component added in nodeStamp is not getting evaluated. To make sure that same component is stamped as nodeStamp, i tried by setting default value in that component, and it is showing the same hard coded value.
    But the same EL expression is getting evaluated for the tree in JSPX page.
    Sujay

  • Graphics plain 2D objects are not rendered while an action occurred!!!

    Hi, I am designing a game in Swing. Currently I am designing the maze for this game. The maze is generated by using Depth First Search algorithm. In my main JFrame, I have some JPanel. One JPanel, named mazePanel contains the maze. There are some other JPanel also, which contains the JButton for controlling. Following is the mazePanel code.
    import java.awt.Graphics;
    import javax.swing.BorderFactory;
    import javax.swing.JPanel;
    public class MazePanel extends JPanel {
        private MazeGenerator mazeGenerator;
        private boolean startNewMaze = false;
        public MazePanel() {
            setBorder(BorderFactory.createTitledBorder("Maze"));
            setToolTipText("This is the maze");
        public void addNewMaze() {
            startNewMaze = true;
            mazeGenerator = new MazeGenerator();
        @Override
        public void paintComponent(Graphics g) {
            super.paintComponent(g);
            if (startNewMaze) {
                mazeGenerator.generate(g);
                startNewMaze = false;
    } There is one JButton, which calls the method mazePanel.addNewMaze() and set the Boolean startNewMaze to true. After setting the startNewMaze, maze should be generated. i.e. mazeGenerator.generate(g) is inside if() condition. Method mazeGenerator.generate(g) recursively draw the random maze. That is why I don’t want to run this method not more than once.
    Up to this everything is looking fine. But while I am running the main JFrame and clicks on the JButton, maze is not rendered in the mazePanel. Sometimes when I minimize and maximize the JFrame, maze rendered (might be because of repaint() occur). Even if I comment mazeGenerator.generate(g) inside if() condition and put some g.drawString(). The string is not rendered while action performed (i.e.Pressing JButton).
    Where is the problem? Please help.
    Thank you.
    Edited by: 889823 on Jan 28, 2012 3:28 PM (Code was not formatted correctly. I forgot to make use of tag)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    This kind of thing sounds simple but in reality is fairly tricky. I dealt with these kinds of situations for years while learning java, and still sometimes do.
    You only posted a snippet of your code, from which we can't go through and debug what your problem is, but I would just say that this is the general pattern
    1. Receive the event to create a new board. This can in reality be any event that will cause your UI to change
    2. Do whatever processing you need to do to get your Component ready to be painted again. You can do short jobs on the UI thread. For longer jobs, look at the SwingWorker class
    3. When you are done processing and ready to redisplay, call repaint() on your Component. Make sure after you call repaint() that any work being done on the UIThread finishes, so that this thread can then handle the repaint request
    Edited by: tjacobs01 on Jan 28, 2012 1:37 PM

  • Report which contain subreports is not rendered first time is processed.

    when I try to render report contains subreports from first time is not rendered but when i select regresh button the input screen is promb again and then i fill all input again and submit, as a result the report was rendered.
    why this happen? is this a know issue?

    after more testing that issue i discovered that when i try to render report of type "Table" then the report is rendered fom rthe first time i pass/set the input values of the report, but when i use reports of type "chart" the report is not rendered from first time and it need a refresh and then manually entering the values for the input.
    i am using the folloing version of JRC:
    com.businessobjects.sdks_.jrc_.11.8.0_11.8.5.v1197
    my code is a s follow:
    =========================
    <%@ page contentType="text/html; charset=utf-8" %><%@ page import="com.crystaldecisions.reports.sdk.ReportClientDocument"%>
    <%@ page import="com.crystaldecisions.report.web.viewer.*" %>
    <%@ page import="com.crystaldecisions.reports.sdk.DatabaseController" %>
    <%@ page import="com.crystaldecisions.sdk.occa.report.lib.ReportSDKException" %>
    <%@ page import="com.crystaldecisions.sdk.occa.report.lib.PropertyBag" %>
    <%@ page import="com.crystaldecisions.sdk.occa.report.data.*" %>
    <%@ page import="com.crystaldecisions.sdk.occa.report.lib.IStrings" %>
    <%@ page import="com.crystaldecisions.reports.sdk.ParameterFieldController" %>
    <%@ page import="com.crystaldecisions.reports.exportinterface.ExportFormatType" %>
    <%@ page import="com.crystaldecisions.sdk.occa.report.reportsource.IReportSource" %>
    <%@ page import="java.io.ByteArrayInputStream" %>
    <%@ page import="java.io.FileOutputStream" %>
    <%@ page import="com.crystaldecisions.sdk.occa.report.document.PrinterDuplex" %>
    <%@ page import="com.crystaldecisions.sdk.occa.report.document.PrintReportOptions" %>
    <%@ page import="com.crystaldecisions.sdk.occa.report.document.PaperSource" %>
    <%@ page import="com.crystaldecisions.sdk.occa.report.document.PaperSize" %>
    <%@ page import="com.crystaldecisions.sdk.occa.report.lib.ReportSDKExceptionBase" %>
    <%@ page import="com.crystaldecisions.sdk.occa.report.exportoptions.*" %>
    <%@ page import="java.io.OutputStream" %>
    <%@ page import="org.t2k.bl.reports.ReportsViewerManager" %>
    <%@ taglib prefix="lms_reports" tagdir="/WEB-INF/tags/lms/reports" %>
    <%!
    Utility method that demonstrates how to write an input stream to the server's local file system.
        private void writeToBrowser(ByteArrayInputStream byteArrayInputStream, HttpServletResponse response, String mimetype, String exportFile, boolean attachment) throws Exception {
            //Create a byte[] the same size as the exported ByteArrayInputStream.
            byte[] buffer = new byte[byteArrayInputStream.available()];
            int bytesRead = 0;
            //Set response headers to indicate mime type and inline file.
            response.reset();
            if (attachment) {
                response.setHeader("Content-disposition", "attachment;filename=" + exportFile);
            } else {
                response.setHeader("Content-disposition", "inline;filename=" + exportFile);
            System.out.println("aaaaaaaaaaaaaaaaaaaaaaaaaaaa");
            response.setContentType(mimetype);
            System.out.println("aaaaa1111");
            OutputStream outs = response.getOutputStream();
             System.out.println("aaaaa2222");
            //Stream the byte array to the client.
            while ((bytesRead = byteArrayInputStream.read(buffer)) != -1) {
                outs.write(buffer, 0, bytesRead);
            System.out.println("bbbbb");
            //Flush and close the output stream.
            outs.flush();
    //        outs.close();
            System.out.println("ccccc");
        /* Include the file AlwaysRequiredSteps.jsp, which contains the code to:
           - Create an Enterprise SessionMgr object
           - Log on to the CMS
           - Create an IInfoStore object
           - Query for and select a report
           - Create an IReportAppFactory object
           - Use the IReportAppFactory object to create a ReportClientDocument object with the IInfoObject that is retrieved from the query
    Logs on to all existing datasource
    @param clientDoc The reportClientDocument representing the report being used
    @param username    The DB logon user name
    @param password    The DB logon password
    @throws com.crystaldecisions.sdk.occa.report.lib.ReportSDKException
        public static void logonDataSource
                (ReportClientDocument
                        clientDoc,
                 String username, String
                        password
                throws
                ReportSDKException {
            clientDoc.getDatabaseController().logon(username, password);
    Changes the DataSource for each Table
    @param clientDoc The reportClientDocument representing the report being used
    @param username  The DB logon user name
    @param password  The DB logon password
    @param connectionURL  The connection URL
    @param driverName    The driver Name
    @param jndiName        The JNDI name
    @throws ReportSDKException
        public static void changeDataSource
                (ReportClientDocument clientDoc,
                 String username, String password, String connectionURL,
                 String driverName, String jndiName
                throws
                ReportSDKException {
            changeDataSource(clientDoc, null, null, username, password, connectionURL, driverName, jndiName);
    Changes the DataSource for a specific Table
    @param clientDoc The reportClientDocument representing the report being used
    @param reportName    "" for main report, name of subreport for subreport, null for all reports
    @param tableName        name of table to change.  null for all tables.
    @param username  The DB logon user name
    @param password  The DB logon password
    @param connectionURL  The connection URL
    @param driverName    The driver Name
    @param jndiName        The JNDI name
    @throws ReportSDKException
        public static void changeDataSource
                (ReportClientDocument
                        clientDoc,
                 String
                         reportName, String
                        tableName,
                                     String
                                             username, String
                        password, String
                        connectionURL,
                                  String
                                          driverName, String
                        jndiName
                throws
                ReportSDKException {
            PropertyBag propertyBag = null;
            IConnectionInfo connectionInfo = null;
            ITable origTable = null;
            ITable newTable = null;
            // Declare variables to hold ConnectionInfo values.
            // Below is the list of values required to switch to use a JDBC/JNDI
            // connection
            String TRUSTED_CONNECTION = "false";
            String SERVER_TYPE = "JDBC (JNDI)";
            String USE_JDBC = "true";
            String DATABASE_DLL = "crdb_jdbc.dll";
            String JNDI_OPTIONAL_NAME = jndiName;
            String CONNECTION_URL = connectionURL;
            String DATABASE_CLASS_NAME = driverName;
            // The next few parameters are optional parameters which you may want to
            // uncomment
            // You may wish to adjust the arguments of the method to pass these
            // values in if necessary
            // String TABLE_NAME_QUALIFIER = "new_table_name";
            // String SERVER_NAME = "new_server_name";
            // String CONNECTION_STRING = "new_connection_string";
            // String DATABASE_NAME = "new_database_name";
            // String URI = "new_URI";
            // Declare variables to hold database User Name and Password values
            String DB_USER_NAME = username;
            String DB_PASSWORD = password;
            // Obtain collection of tables from this database controller
            if (reportName == null || reportName.equals("")) {
                Tables tables = clientDoc.getDatabaseController().getDatabase().getTables();
                for (int i = 0; i < tables.size(); i++) {
                    origTable = tables.getTable(i);
                    if (tableName == null || origTable.getName().equals(tableName)) {
                        newTable = (ITable) origTable.clone(true);
                        // We set the Fully qualified name to the Table Alias to keep the
                        // method generic
                        // This workflow may not work in all scenarios and should likely be
                        // customized to work
                        // in the developer's specific situation. The end result of this
                        // statement will be to strip
                        // the existing table of it's db specific identifiers. For example
                        // Xtreme.dbo.Customer becomes just Customer
    //                    System.out.println(newTable.getQualifiedName() + "  -  " + origTable.getQualifiedName());
                        newTable.setQualifiedName(origTable.getAlias());
    //                    newTable.setAlias(origTable.getAlias());
                        // Change properties that are different from the original datasource
                        // For example, if the table name has changed you will be required
                        // to change it during this routine
                        // table.setQualifiedName(TABLE_NAME_QUALIFIER);
                        // Change connection information properties
                        connectionInfo = newTable.getConnectionInfo();
                        // Set new table connection property attributes
                        propertyBag = new PropertyBag();
                        // Overwrite any existing properties with updated values
                        propertyBag.put("Trusted_Connection", TRUSTED_CONNECTION);
                        propertyBag.put("Server Type", SERVER_TYPE);
                        propertyBag.put("Use ODBC", USE_JDBC);
                        propertyBag.put("Database DLL", DATABASE_DLL);
                        propertyBag.put("JNDIOptionalName", JNDI_OPTIONAL_NAME);
                        propertyBag.put("Connection URL", CONNECTION_URL);
                        propertyBag.put("Database Class Name", DATABASE_CLASS_NAME);
                        // propertyBag.put("Server Name", SERVER_NAME); //Optional property
                        // propertyBag.put("Connection String", CONNECTION_STRING); //Optional property
                        // propertyBag.put("Database Name", DATABASE_NAME); //Optional property
                        // propertyBag.put("URI", URI); //Optional property
                        connectionInfo.setAttributes(propertyBag);
                        // Set database username and password
                        // NOTE: Even if the username and password properties do not change
                        // when switching databases, the
                        // database password is not saved in the report and must be set at
                        // runtime if the database is secured.
                        connectionInfo.setUserName(DB_USER_NAME);
                        connectionInfo.setPassword(DB_PASSWORD);
                        // Update the table information
                        clientDoc.getDatabaseController().setTableLocation(origTable, newTable);
            // Next loop through all the subreports and pass in the same
            // information. You may consider
            // creating a separate method which accepts
            if (reportName == null || !(reportName.equals(""))) {
                IStrings subNames = clientDoc.getSubreportController().getSubreportNames();
                for (int subNum = 0; subNum < subNames.size(); subNum++) {
                    Tables tables = clientDoc.getSubreportController().getSubreport(subNames.getString(subNum)).getDatabaseController().getDatabase().getTables();
                    for (int i = 0; i < tables.size(); i++) {
                        origTable = tables.getTable(i);
                        if (tableName == null || origTable.getName().equals(tableName)) {
                            newTable = (ITable) origTable.clone(true);
                            // We set the Fully qualified name to the Table Alias to keep
                            // the method generic
                            // This workflow may not work in all scenarios and should likely
                            // be customized to work
                            // in the developer's specific situation. The end result of this
                            // statement will be to strip
                            // the existing table of it's db specific identifiers. For
                            // example Xtreme.dbo.Customer becomes just Customer
    //                        System.out.println(origTable.getQualifiedName());
                            newTable.setQualifiedName(origTable.getQualifiedName());
                            newTable.setAlias(origTable.getAlias());
                            // Change properties that are different from the original
                            // datasource
                            // table.setQualifiedName(TABLE_NAME_QUALIFIER);
                            // Change connection information properties
                            connectionInfo = newTable.getConnectionInfo();
                            // Set new table connection property attributes
                            propertyBag = new PropertyBag();
                            // Overwrite any existing properties with updated values
                            propertyBag.put("Trusted_Connection", TRUSTED_CONNECTION);
                            propertyBag.put("Server Type", SERVER_TYPE);
                            propertyBag.put("Use JDBC", USE_JDBC);
                            propertyBag.put("Database DLL", DATABASE_DLL);
                            propertyBag.put("JNDIOptionalName", JNDI_OPTIONAL_NAME);
                            propertyBag.put("Connection URL", CONNECTION_URL);
                            propertyBag.put("Database Class Name", DATABASE_CLASS_NAME);
                            // propertyBag.put("Server Name", SERVER_NAME); //Optional property
                            // propertyBag.put("Connection String", CONNECTION_STRING); //Optional property
                            // propertyBag.put("Database Name", DATABASE_NAME); //Optional property
                            // propertyBag.put("URI", URI); //Optional property
                            connectionInfo.setAttributes(propertyBag);
                            // Set database username and password
                            // NOTE: Even if the username and password properties do not
                            // change when switching databases, the
                            // database password is not saved in the report and must be
                            // set at runtime if the database is secured.
                            connectionInfo.setUserName(DB_USER_NAME);
                            connectionInfo.setPassword(DB_PASSWORD);
                            // Update the table information
                            clientDoc.getSubreportController().getSubreport(subNames.getString(subNum)).getDatabaseController().setTableLocation(origTable, newTable);
    %>
        try {
            // Create the ReportClientDocument object.
            ReportClientDocument clientDoc = new ReportClientDocument();
            clientDoc.open("Class Progress by AI.rpt", 0);
            //start sheeet code            -  work
            changeDataSource(clientDoc, "root", "eatmyshorts",
                    "jdbc:mysql://localhost:3306/lms",
                    "com.mysql.jdbc.Driver", "LMS_MySQL5.1");
            ParameterFieldController paramController = clientDoc.getDataDefController().getParameterFieldController();
            paramController.setCurrentValue("", "Type", "en_US");
            paramController.setCurrentValue("", "SchoolName", "general");
            paramController.setCurrentValue("", "StudyClassName", "classss");
            paramController.setCurrentValue("", "SegmentId", 6);
            paramController.setCurrentValue("", "LAID", 30);
            paramController.setCurrentValue("", "AIID", 205);
            paramController.setCurrentValue("", "LOID", 1);
            IReportSource reportSource = clientDoc.getReportSource();
            // Create a Viewer object
            CrystalReportViewer viewer = new CrystalReportViewer();
            // Set the report source for the  viewer to the ReportClientDocument's report source
            viewer.setReportSource(reportSource);
            // Set the name for the viewer
            viewer.setName("Crystal_Report_Viewer");
            viewer.setPrintMode(CrPrintMode.PDF);
            viewer.setEnableParameterPrompt(true);
            viewer.setEnableDrillDown(true);
            viewer.setOwnPage(false);
            viewer.setOwnForm(true);
            viewer.setDisplayToolbar(false);
            viewer.setDisplayGroupTree(false);
            viewer.setHasPageBottomToolbar(false);
            // Process the http request to view the report
            viewer.processHttpRequest(request, response, getServletConfig().getServletContext(), out);
            // Dispose of the viewer object
            viewer.dispose();
            // Release the memory used by the report
            clientDoc.close();
        } catch (ReportSDKExceptionBase e) {
            e.printStackTrace();
    %>

  • JSF Pages are not rendering correctly when  loaded using Non JSF actions

    Hi All,
    This problem is irritating me and I am posting the same query for the third time here.
    When I come from non jsf actions such as page submitting using Javascript, clicking anchor link, clicking normal Html submit button and so on my page is not rendering correctlly .
    In other words, My first GET method/Post method works perfectly for the first time when the page is loaded.
    But when we try to access the page for the second time, although logical work is perfect in bean, I am getting same old page.
    How to resolve this issue?
    or
    Is this Bug of Sun's Implementation of JSF Framework.
    Thanks,
    Sudhakar

    Hi Sudhakar,
    There is a discussion about refreshing a page, Take a look at the below thread
    http://swforum.sun.com/jive/thread.jspa?threadID=55660
    Hope this what you are looking for
    MJ

  • Why is my .psd file not rendering correctly in ae

    Some layers of the .psd document are not rendered correctly. However they are imported.
    The strange thing is that when I first move from Photoshop to Illustrator, save it as an .ai file it is rendered properly (in Ae).
    I am kind of clueless as to what is causing this issue.
    Kind regards,
    Jelle

    Okay if more information is needed, i'll provide. However you may disregard my initial comment about illustrator. It flattens the photoshop layers so I do not have any flexibility in After Effects. In other words, my main question remains: why is my psd file not rendering correctly in ae?
    Further details:
    -photoshop cc and after effects cc.
    -macbook pro retina
    If still not clear enough, please tell me what details you are looking for furthermore

  • SSRS report does not rendering properly in sharePoint 2013

    Hi everyone,
    I'm a newbie with the MSBI development tool, I've tried to create a testing SSRS reports and its layout showed correct when preview them in Visual Studio (2010 and 2012). Then I migrated the report in SharePoint 2013, but the layout do not rendering as I
    expected, some data mix-up on the matrix table
    The Ident on detail data (drill down) does not render properly compare the layout in when preview in Chrome or Visual Studio (SSRS)
    The summation on second matrix table went wide on both browsers compare when preview thereport in Visual Studio
    The export PDF (using the "action" button on the report in the browsers) showed the second matrix table is overlaps the first matrix table.
    This report has 3 main queries (2 for the matrix tables and 1 for the chart) on a Dev environment:
    Window server 2008 R2 with service pack 2
    SQL server 2012 enteprise with service pack 2
    SharePoint 2013 (no service pack) with integrated mode on the report service 
    Visual Studio 2010 development tools
    I'm very appreciate for anyone can provide any solution to solve this issue.
    Thank you so much,
    Dac.
    P.S.: I attached the preview of the report in both browsers (IE & Chrome) and its preview in Visual Studio.
    An update: ... due to the setting space on"snap to grid" default to 20 and I've made the 2nd matrix table overlaps the 1st one, therefore the it showed overlaps when export to PDF file ... it's solved.
    But the Indent on IE and summation still persist in both browsers.

    Hi everyone,
    The PDF's export has been solved due to the 2nd matrix table overlaps on the 1st table. 
    Also, I don't know why the summation (aka Row Total) went wide when data represented on the 2nd matrix table (see previous post on the row named as "Premium over 5000$" on both browser. So I've redesigned the 2nd table as normal table instead of
    matrix table ... and the summation showed correct (it's so weird)
    For the "Indent" issue showed in IE on both drill down of the 1st table and 2nd table which cannot be fixed, and the end user used only IE.
    Could someone can enlighten me please?
    Many thanks.

  • LIbrary thumbnails not rendering

    I have dozens and dozens of thumbnails in library grid that do not render.  The boxes show up as empty grey squares with keyword icons among others.  There does not seem to be any pattern or reason that some photos render fine and others do not.  If a photo is taken to develop mode then the thumbnail renders as the photo loads in the main window, otherwise the same photos that are all grey in library view are grey in develop view until the individual photo is loaded.  Closing LR and reopening it seems to cause any photo which was originally not rendered but then forced to render in develop to go back to the unrendered state.
    This is driving me crazy as I cannot count on LR to display the images I have in the catalog.  Syncing a folder which has many of these unrendered previews does not indicate any missing files.
    Help.
    Lightroom 3.2 64 bit
    Windows 7
    Catalog w/ about 18000 images upgraded from LR 2.7

    Check other threads in this forum.  I recall this is usually caused by a bad display colour profile. This is apparently more common with some Windows systems.

  • Inserting new row in Table in 11.1.2 from 11.1.1.3 not rendering table!!!!!

    Hey Guys, my status might say noob but i am well seasoned in ADF. We migrated from 11.1.1.3 to the new JDEV 11.1.2. We are doing a test run before we commit to it.
    I noticed the following:
    We have master detail forms that work flawlessly in 11.1.1.3 when we ran the app under 11.1.2 we noticed that any time you try to add a new row to a table the table does not render. The server logs show the action going through and the count goes up one but the table is not rendered anymore it disappears!!!!!!!!!!!!!!
    Now all of this was imported from the 11.1.1.3. all of our tables that have createInsert actions on them are doing this.
    If i drag the tables again and set them up from scratch it seems to work fine. Our issue is we have a good 300 of these tables in different panels and panel collections. we have to do all of that work all over again.
    No errors show in the log. IS THIS A BUG???????????????
    UPDATE: REFRESHING THE PAGE using the Browser Refresh Button Will show the new ROW....... THIS IS NOT GOOOD!!!
    Edited by: user8333408 on Jul 7, 2011 9:23 AM
    Edited by: user8333408 on Jul 7, 2011 9:24 AM
    Edited by: user8333408 on Jul 7, 2011 10:08 AM

    Thanks for the reply.
    The Project was in version 11.1.3 before I migrated. I had the issue above so I migrated to 11.1.1.4 then to 11.1.1.5 then to the New GREAT 11.1.2 to go by the matrix of support The issue is still there.
    Basic Page layout:
    SEARCH-MASTER-PANELTABBED LAYOUT (Hold all the CHILDREN RECORDS)
    PANEL TAB is made of ; SHOW DETAIL ITEM- PANEL COLLECTION- TABLE.
    the panel collection has a toolbar with 2 buttons in it.
    My issue varies:
    Hit create insert==> record count goes up one but the table does not render (it goes all blank even if records existed in it)
    Hit undo budo ==>table still not rendering. (click next on master record then click previous to come back, the table renders correctly.)
    other tables do the following:
    Hit Create insert == > table shows normally and I can enter new record.
    Hit undo ==> table count goes down but table does not render at all anymore.
    for this issue i noticed if i set cache results to false the table works after hitting undo
    IF I CREATE A NEW SHOW DETAIL ITEM and put exactly what the other tabs have in them and use the same layouts and buttons the new table works great!!!!!!!!!!!!???????????????????? WTF?!?!?!?!
    NO ERROR MESSAGES even at finest level are thrown.
    I HAD NO ISSUES IN THE PREVIOUS VERSIONS OF JDEV IS THIS A JSF 2.0 BUG????
    BY THE WAY JDEV 11.1.2 sometimes CRASHES or Hangs when viewing the Binding of Page when you click on Binding straight from the Design view. I have to open the Binding Page separate to view it. FYI
    Edited by: Nottallah on Jul 11, 2011 9:48 AM
    Edited by: Nottallah on Jul 11, 2011 9:51 AM

  • Safari not rendering a page correctly

    A webpage I created in Dreamweaver uses drop down menus that are supposed to display just to the left of the link they drop from. In all other browsers they work correctly, but since the latest upgrade in Safari to 3.0.4 as a part of OS 10.4.11 on my Macbook, they are not rendering correctly. Instead they are appearing much further to the left where it's difficult to move the cursor to them before they disappear. Until I changed the color of the drop downs they were disappearing into the background. Any ideas why Safari is not rendering them correctly? I'd like to keep Safari as my primary browser, but if it won't render my own page correctly, what other pages might it be messing up? Address of the page is http://www.montgomeryschoolsmd.org/schools/woottonhs/ The drop downs are connected to the central column list that has small arrows beside the words. They will probably work correctly for you, but won't for me in Safari. What can I do to fix it?
    Thanks,
    KWolfrey

    Hi,
    I'm running 10.4.11 with Safari 3.0.4 and as far as I can see the menus seem to work just fine here.
    Do you have a custom stylesheet set in Safaris advanced preferences? (Some Safari enhancer applications set one even if you didn't manually set one so double check to make sure.)
    Also, do you use PithHelmet?
    One quick test you can do to help narrow down things is to try Safari in another user account. This will help us to know whether your problem is local to your account or system wide. If you don't have another account you can use System Preferences -> Accounts -> \[+\] to create a test one (and \[-\] to remove it if needed)
    Lastly, I doubt these [errors|http://validator.w3.org/check?uri=http%3A%2F%2Fwww.montgomeryschoolsmd. org%2Fschools%2Fwoottonhs%2F&charset=%28detect+automatically%29&doctype=Inline&g roup=0] have anything to do with your problem since it seems to work fine for me, but you might want to look into them at some point.

  • h:messages tag not rendering right

    Hi All,
    I have an <h:messages /> tag in my jsf page and it's not rendering correctly.
    This is the tag in my page, verbatim:
    <h:messages />
    And this is the output when validation errors are created:
    Validation Error: "lastName": Value is required.      Validation Error: "firstName": Value is required.
    That's it. No List, no nothing, just space-delimited validation errors!
    When I specifiy layout="table", things are fine, but specifying layout="list" doesn't solve the problem.
    I'm using v1.1 of the jsf implementation.
    What gives?
    Thanks,
    John

    I got the exact same problem.. Is this already logged as a bug in JSF?

  • Page is not rendering as per requirement request

    Hi All,
    Basically Here is the scenario.
    Based on selectoin of particular service item from combo box(dropdown list), We are creating the JSF controls dynamically on new page for further process.
    We are maintaining the controls information in database that need to be created dynamically and rendered for each service.
    And I am able to create the controls dynamically and able to place them on page perfectly.
    Until here everything looks ok for me.
    But main problem I have identified is when I go for new request, I am getting the same old page when I select the other service.
    Initially I though this could be a problem of caching and I have placed meta info in order to expire the page. But that was no use.
    So I logged all the data that is coming from database and logged the information where I have created the controls dynamically..
    What I have identified is I am getting the right data on paricular service selection and even I am able to see that methods execution is correct. I was stunned and not able to understand why the JSF is not able to show the controls.
    So I searched the JavaDoc for solution. I though I could use FacesContext.release() method. But that does not help me. Even I tried to clear the parent objects using gridpanel1.getChildren().clear(). Even that does not supported me :(
    In order to understand my problem, here I am pating the code.
    Please help me why the hell my page is not rendering
    Below is code in constructor
    javax.faces.context.ExternalContext ec = context.getExternalContext();
                javax.servlet.http.HttpServletRequest request=(javax.servlet.http.HttpServletRequest)ec.getRequest();
                String service=request.getParameter("form1:cmbServices");
                int serviceid=-1;
                if(service!=null) {
                    serviceid=Integer.parseInt(service);
                gridPanel1.getChildren().clear();
                controls =getControls(serviceid);
                HtmlControl[] controlArray =controls.getHtmlControls();
                //log(controlArray.length+" Length");
                for (int i =0;i<controlArray.length;i++) {
                    HtmlControl control =controlArray;
    //log(control+" Control");
    //log(controlArray.length+" Length");
    if (control.isRadio()) {
    addRadio(control);
    //log("Entered here in adding radio");
    else if (control.isCheckBox()) {
    addCheckBox(control);
    //log("Entered here in adding checkbox");
    else if (control.isTextBox()) {
    addTextBox(control);
    //log("Entered here in adding textbox");
    here is the code for dynamic creation of controls
    private void addRadio(HtmlControl control) {
            HtmlPanelGrid gridPanel = new HtmlPanelGrid();
            UIComponent parent = gridPanel1;
            HtmlOutputText outputText = new HtmlOutputText();
            outputText.setValue(control.getDescription());
            String desc =control.getDescription();
            desc=desc.replaceAll(" ", "_");
            outputText.setId(desc);
            outputText.setStyleClass("bodyText");
            HtmlSelectOneRadio radio = new HtmlSelectOneRadio();
            radio.setBorder(0);
            radio.setLayout("pageDirection");
            //radio.setId("Radio_"+control.getId());
            radio.setId(control.getName()+"__"+control.getId());
            UISelectItems items = new UISelectItems();
            Radio objRadio =(Radio)control;
            //  vectDefaultSelectItemsArray
            DefaultSelectItemsArray objArray =new DefaultSelectItemsArray();
            vectDefaultSelectItemsArray.add(objArray);
            //log("vectDefaultSelectItemsArray :"+vectDefaultSelectItemsArray.size());
            arrays=(DefaultSelectItemsArray[])vectDefaultSelectItemsArray.toArray(new DefaultSelectItemsArray[vectDefaultSelectItemsArray.size()]);
            int size =arrays.length;
            arrays[size - 1].clear();
            for (int i =0;i<objRadio.getValues().size();i++) {
                arrays[size - 1].add(new SelectItem(objRadio.getValues().get(i)+"",""+objRadio.getTexts().get(i)));
            // array.setItems(new String[] {"Yes","No" });
            items.setValueBinding("value",getValueBinding("#{consumer$jobInfo.arrays["+(size-1)+"]}"));
            radio.setStyleClass("bodyText");
            radio.getChildren().add(items);
            gridPanel.getChildren().add(outputText);
            gridPanel.getChildren().add(radio);
            parent.getChildren().add(gridPanel);
        private void addCheckBox(HtmlControl control) {
            HtmlPanelGrid gridPanel = new HtmlPanelGrid();
            UIComponent parent = gridPanel1;
            HtmlOutputText outputText = new HtmlOutputText();
            outputText.setValue(control.getDescription());
            outputText.setStyleClass("bodyText");
            String desc =control.getDescription();
            desc=desc.replaceAll(" ", "_");
            outputText.setId(desc);
            HtmlSelectManyCheckbox checkBox = new HtmlSelectManyCheckbox();
            checkBox.setBorder(0);
            checkBox.setLayout("pageDirection");
            //checkBox.setId("CheckBox_"+control.getId());
            checkBox.setId(control.getName()+"__"+control.getId());
            UISelectItems items = new UISelectItems();
            CheckBox objcheckBox =(CheckBox)control;
            //  arrays[0]=new DefaultSelectItemsArray();
            //arrays[0].clear();
            DefaultSelectItemsArray objArray =new DefaultSelectItemsArray();
            vectDefaultSelectItemsArray.add(objArray);
            //log("vectDefaultSelectItemsArray :"+vectDefaultSelectItemsArray.size());
            arrays=(DefaultSelectItemsArray[])vectDefaultSelectItemsArray.toArray(new DefaultSelectItemsArray[vectDefaultSelectItemsArray.size()]);
            int size =arrays.length;
            arrays[size - 1].clear();
            //  array.clear();
            for (int i =0;i<objcheckBox.getValues().size();i++) {
                arrays[size - 1].add(new SelectItem(objcheckBox.getValues().get(i)+"",""+objcheckBox.getTexts().get(i)));
                //     array.add(new SelectItem(objcheckBox.getValues().get(i)+"",""+objcheckBox.getTexts().get(i)));
            // array.setItems(new String[] {"Yes","No" });
            items.setValueBinding("value",getValueBinding("#{consumer$jobInfo.arrays["+(size-1)+"]}"));
            checkBox.setStyleClass("bodyText");
            checkBox.getChildren().add(items);
            gridPanel.getChildren().add(outputText);
            gridPanel.getChildren().add(checkBox);
            parent.getChildren().add(gridPanel);
        private void addTextBox(HtmlControl control) {
            HtmlPanelGrid gridPanel = new HtmlPanelGrid();
            UIComponent parent = gridPanel1;
            HtmlOutputText outputText = new HtmlOutputText();
            outputText.setValue(control.getDescription());
            String desc =control.getDescription();
            desc=desc.replaceAll(" ", "_");
            outputText.setId(desc);
            outputText.setStyleClass("bodyText");
            HtmlInputText textField = new HtmlInputText();
            //  textField.setId("textField_"+control.getId());
            textField.setId(control.getName()+"__"+control.getId());
            HtmlOutputText outputText1 = new HtmlOutputText();
            outputText1.setValue(" ");
            outputText1.setStyleClass("bodyText");
            textField.setStyleClass("frmObjects");
            gridPanel.setColumns(3);
            gridPanel.getChildren().add(outputText);
            gridPanel.getChildren().add(outputText1);
            gridPanel.getChildren().add(textField);
            parent.getChildren().add(gridPanel);
    here is my after render response method
    protected void afterRenderResponse() {
            //job_selection_templateRowSet.close();
            jiya_html_controlRowSet.close();
            FacesContext.getCurrentInstance().release();
    here is my getValueBinding method
    private ValueBinding getValueBinding(String expression) {
            return     FacesContext.getCurrentInstance().getApplication().createValueBinding(expression);
        }Thanks
    Sudhakar.

    Hi,
    You can try the following to debug and provide us more details.
    1. I am assuming you are trying to navigate by using a commandLink/Command Button ? If so, is the action handler for the command getting called ?
    2. Do you have input components in the page with Validators/converters attached to them ? If so, you may not watch for validation/conversion errors. If there are errors, the same page will be redisplayed. In that case you would need to associate message component to get more details on what went wrong.
    3. Have you set up the necessary navigation rules to navigate to the right page ?
    4. When you are adding components programatically, its better to assign explicit id's to your components, to avoid any unexpected behavior.
    Hope this helps.
    Regards
    -Jayashri

  • PanelGrid with binding attribute not rendering when event on page fires

    I am having a similar issue with my components not being rendered from a dynamic binding attribute as described by this post:http://forum.java.sun.com/thread.jspa?threadID=671672 but for different reason. I have combed the forum and other sources for a week now, tried numerous variations of this based on suggestions I've read for rendering dynamic components and am unable to find the problem. I would appreciate guidance as I don't know what else to do and I imagine there is something basic about the JSF flow layout or component classes I am not doing correctly.
    From a high level, I have a page with two panel groups. The first contains a list of command links (like a menu) that have an actionlistener that populates a list of QueryVariable objects called filterCriteria in the backing bean based on the selection made and then calls a function to update components in the second panel. The second panelGroup contains a panelGrid with a binding attribute that constructs a dynamic set of input fields based on the content of the filterCriteria list. When I first naviagate to this page from another page, the fields are rendered properly. However, if I then select a commandLink from the menu, the panelGrid disappears and is not rendered.
    I've stepped through the code in a debugger and my actionlistener is called when I select a command link. However, the binding attribute method is not called at this time, so I added a direct call to it from the action listener. I know the actionlistener is working because I've verified it in the debugger and if I navigate away and come back to the page, then the binding method is called and the new selection is reflected in a rendered panelGrid. Why is it not rendering though when I first select the commandLink and the page is updated. Also, fyi, there is an action method for the commandlinks but it returns null;
    FWIW, I'm using MyFaces and Facelets in my application.
    Below is my code. This is inside a managed session bean:
    JSF Snippet:
    <h:panelGrid id="inputVarsTable" columns="3" binding="#{query.table}"/>
         public HtmlPanelGrid getTable() {
              if(table == null)
                   table = new HtmlPanelGrid();
              return constructSearchInputTable();               
         public void setTable(HtmlPanelGrid table) {
              this.table = table;
      // Updates table component to reflect filterCriteria
         public HtmlPanelGrid constructSearchInputTable()
              HtmlOutputLabel outLabel;
              HtmlOutputText outText;
              HtmlInputText  inText;
              HtmlMessage message;
              List<UIComponent> children;
              ValueBinding vb;
              FacesContext facesContext = FacesContext.getCurrentInstance();
              UIViewRoot uIViewRoot = facesContext.getViewRoot();
            Application application = facesContext.getApplication();
              children = table.getChildren();
        children.clear();
              try {
                   for (int i = 0; i < getFilterCriteria().size(); i++) {
                        QueryVariable var = getFilterCriteria().get(i);
                        String id = "var" + i;
                        //<h:outputLabel for="#{var.name}" styleClass="label">
                        outLabel = new HtmlOutputLabel();               
                        outLabel.setFor(id);
                        outLabel.setStyleClass("label");
                        //  <h:outputText value="#{var.name}" />
                        outText = new HtmlOutputText();
                        outText.setValue(var.getName());
                        outText.setParent(outLabel);
                        outLabel.getChildren().add(outText);
                        outLabel.setParent(table);
                        children.add(outLabel);
                        //<h:inputText id="#{var.name}" value="#{var.value}" required="true" />
                        inText = new HtmlInputText();
                        inText.setId(id);
                        String bind = "#{query.filterValues['" + var.getName() + "']}";
                        inText.setValueBinding("value", application.createValueBinding(bind));
                        if(var.getDefaultValue() == null)
                             inText.setRequired(true);
                        inText.setParent(table);
                        children.add(inText);
                        //<h:message for="#{var.name}" styleClass="errorText"/>
                        message = new HtmlMessage();
                        message.setFor(id);
                        message.setStyleClass("errorText");
                        message.setParent(table);
                        children.add(message);     
              } catch (Exception e) {
                   log.error(e);
              return table;
      // Command Link Menu ActionListener
         public void structuredQuerySelection(ActionEvent e) {
              queryType = QueryType.StructuredQuery;
              UICommand cmd = (UICommand) e.getSource();
              filterSelection = (String) cmd.getValue();
              Map<String, SearchRequestCtx> queries = pdp.getGenericMetadata().savedQueries;
              SearchRequestCtx ctx = queries.get(filterSelection);
              filterCriteria = new ArrayList<QueryVariable>();
              filterCriteria.addAll(ctx.getVariables());
              constructSearchInputTable();
         // Command Link Menu Action
         public String selectStructuredQuery()
              return null;
         }BTW, this is my first post and I don't really know how that Duke Dollar thing works but I'm happy to offer some to anyone that can solve this issue for me.
    Thanks,
    Ken

    Glad to hear I am not the only one struggling with this type of issue.
    I tried your suggestion but it caused a NoSuchElementException when the page tried to render. Stepping through the code, the init function is always called after my panelGrid is constructed. I even commented out the logic to clear the children and confirmed that in the constructed page, the outputText component that binds to init is the first element on the page - right after the opening body tag. Maybe, JSF doesn't necessarily construct the page in top to bottom order? Also, the exception makes me think that this gets called too late in the lifecycle to work. Were you able to get this to work?
    java.util.NoSuchElementException
         at java.util.AbstractList$Itr.next(AbstractList.java:427)
         at com.sun.facelets.FaceletViewHandler.encodeRecursive(FaceletViewHandler.java:515)
         at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:445)
         at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:300)
         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:110)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
         at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:482)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:825)
         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:738)
         at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:526)
         at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
         at java.lang.Thread.run(Thread.java:595)Ken

  • JSF page not rendered in Design View (JDev 11.1.2.1.0)

    Hi!
    Recently strange behavior in JDeveloper 11.1.2.1.0) begins: JSF pages in some projects are not rendered anymore. We enabled "Show Design time Messages in log" in JDev Tools/Preferences/JSP and HTML Visual editor and message
    WARNING: A problem was encountered executing the page.  Using fallback rendering is shown in log. This is visible on this snapshot:
    [http://dl.dropbox.com/u/14304804/design_view_problem.jpg|http://dl.dropbox.com/u/14304804/design_view_problem.jpg]
    What is common to all of the projects with this issue is that we run "Remove ADF Security Configuration" which was enabled before and we implemented our custom security using phase-listener.
    Any idea what is wrong here?
    Regards,
    Sašo
    Edited by: Sašo C. on May 21, 2012 2:24 PM

    It's a limitation, if you will, of the way JDeveloper works. It essentially runs your JSF page in order to get the rendering. At design time, the phase listener is obviously messing things up since you're not in a proper secured environment - hence the workaround to bypass your phase listener at design time.

Maybe you are looking for