h:dataTable with component binding not rendering

Hello,
I am developing an application with several ad-hoc queries that need to be displayed in data table elements. The number and label values of the columns are not known until runtime. I am attempting to use a component binding mechanism to intercept the UIData and add columns to it at runtime, depending on the data currently held in a backing bean instance (such as an ad-hoc query result).
I'm not sure where I can actually intercept the table and add the columns. I've got the following code example to compile and run without error, but nothing gets rendered properly - I get an opening <table> tag in the HTML source and nothing else follows.
I have compared the structure of the table created with the following binding method to a table created with simple <h:dataTable> tags, and I see only one difference. The datatable created with tags has a single attribute in its attribute map called "javax.faces.webapp.COMPONENT_IDS" that maps to an ArrayList of the component IDs of the h:column elements I specify on the JSF page. The datatable I attempt to create in the binding method does not have this attribute in its map, and I can't seem to manually add it in without creating further havoc. (the child count, types of children, etc all seem to be equivalent).
From the JSF perspective this is how I've defined the h:dataTable tag instance...
<h:dataTable id="categoryTable" rendered="true"
        binding="#{backingBeanInstance.table}"
            value="#{backingBeanInstance.rows}"
                var="row"  border="2" />This is basically the code in the backingBeanInstance....
    private UIData table;
    public void setTable(UIData table){
        this.table = table;
       //initTable();   //tried this but seems not to work either?
    public UIData getTable(){
        if(table!=null){
            initTable(); //build the columns and add to the table
        return table
    private void initTable(int categoryIndex){
            //This block is just a way to calculate the number of columns
            int colCount = <depends on data held in bean>
            //Resolve the var string for the data table
            String item = table.getVar();
            System.out.println("item: " + item);  //this is always null the 1st time through?? why?
            UIColumn col;
            UIOutput out;
            FacesContext context = FacesContext.getCurrentInstance();
            Application app = context.getApplication();
            //For each column in the data, create a UIColumn as child of the
            //data table.  Create a UIOutput as child of the UIColumn and bind
            //the value of the UIOutput to the data with an EL expression
            for (int j = 0; j < colCount; j++) {
                //create an instance of UIOutput to display the value for this cell
                out = new UIOutput();
                out.setRendererType("Text");
                //create an instance of UIColumn
                col = new UIColumn();
                //construct the value binding string as an EL expression
                String valueBindingString = "#{" + item + "[" + j + "]}";
                //create the value binding
                ValueBinding vb = app.createValueBinding(valueBindingString);
                //set the value binding on the UIOutput object
                out.setValueBinding("value", vb);
                //add the UIOutput component to the UIColumn as a child
                col.getChildren().add(out);
                //add the UIColumn to the data table as a child
                table.getChildren().add(col);
    }

<bump>

Similar Messages

  • MyFaces schedule component is not rendering properly.

    Hello everybody.
    I am trying to use the Tomahawk schedule component with Jdeveloper 10.1.3.2. It is not rendering properly.
    The schedule entries and the header line are mising for weeks.
    I removed the default-render-kit-id element from the faces-config.xml. Nothing changed.
    Used versions:
    - Jdeveloper 10.1.3.2
    - myFaces 1.5.1
    - tomahawk 1.5.1
    Any suggestions?
    Thanks.

    Hi,
    did you post this question on the MyFaces open source list?
    Frank

  • Component labels not rendering correctly after applying fusion skin

    Hi
    I have been using ADF 11g with blaf-plus-rich skin. Recently I upgraded to 11g R1 Patch Set 1 . I applied the new fusion skin and after that labels on the components are not appearing in the right color. They are appearing in white color as the back ground color of panel box in which they are in.
    Any help is greatly appreciated
    Thanks
    AC

    Hi Frank,
    Please see the code below :
    1. Code snippet from page template used by our app :
    <f:facet name="second">
    <af:panelStretchLayout id="pt_psl1">
    <f:facet name="center">
    <af:decorativeBox id="contentBody" theme="contentBody">
    <f:facet name="center">
    <af:facetRef facetName="content"/>
    </f:facet>
    </af:decorativeBox>
    </f:facet>
    <f:facet name="bottom">
    <af:facetRef facetName="contentBottom"/>
    </f:facet>
    </af:panelStretchLayout>
    </f:facet>
    2. Code snippet from trinidad-config.xml
    <?xml version="1.0" encoding="windows-1252"?>
    <trinidad-config xmlns="http://myfaces.apache.org/trinidad/config">
    <skin-family>mystyle</skin-family>
    </trinidad-config>
    3. Code Snippet from trinidad-skins
    <?xml version="1.0" encoding="windows-1252" ?>
    <skins xmlns="http://myfaces.apache.org/trinidad/skin">
    <skin>
    <id>mystyle.desktop</id>
    <family>mystyle</family>
    <extends>fusion.desktop</extends>
    <render-kit-id>org.apache.myfaces.trinidad.desktop</render-kit-id>
    <style-sheet-name>common/css/mystyle</style-sheet-name>
    <bundle-name>myBundle</bundle-name>
    </skin>
    </skins>
    4.Code snippet from a jspx page
    <af:panelGroupLayout layout="scroll" id="pgl1">
    <af:panelHeader text="test"
    inlineStyle="padding:2px;" id="ph1"/>
    <af:panelBox text="search"
    id="id" inlineStyle="padding:2px;"
    styleClass="AFStretchWidth">
    <af:panelGroupLayout layout="vertical" id="pgl6" valign="top">
    <af:panelGroupLayout layout="horizontal" id="pgl2" valign="top">
    <af:panelFormLayout id="pfl1" labelWidth="75"
    inlineStyle="margin-right:30px;">
    <af:group id="grp1">
    <af:panelLabelAndMessage label="Test Label"
    id="plam1" for="supplierId">
    <af:inputListOfValues popupTitle="Lov Title"
    simple="true" id="supplierId"
    model=""
    value=""
    autoSubmit="true"
    valueChangeListener=""
    columns=""
    converter="javax.faces.Long"
    maximumLength="10"
    searchDesc=""
    binding=""
    disabled="">
    <f:validator binding=""/>
    </af:inputListOfValues>
    </af:panelLabelAndMessage>
    </af:panelFormLayout>
    </af:panelGroupLayout>
    </af:panelGroupLayout>
    </af:panelBox>
    </af:panelHeader>
    </<af:panelGroupLayout>
    The label for the LOV is rendering in white color. If I change my template theme to "medium" or "light", the labels
    are rendred correctly , but text values in disabled input text appear as white.

  • Cell with boolean value not rendering properly in Swing (custom renderer)

    Hello All,
    I have a problem rendenring boolean values when using a custom cell renderer inside a JTable; I managed to reproduce the issue with a dummy application. The application code follows:
    import java.awt.BorderLayout;
    import java.awt.Dimension;
    import java.lang.reflect.InvocationTargetException;
    import java.util.ArrayList;
    import java.util.Date;
    import java.util.List;
    import java.util.logging.Logger;
    import javax.swing.JFrame;
    import javax.swing.JScrollPane;
    import javax.swing.JTable;
    import javax.swing.SwingUtilities;
    * Simple GUI that uses custom cell rendering
    * @author josevnz
    public final class SimpleGui extends JFrame {
         private static final long serialVersionUID = 1L;
         private Logger log = Logger.getLogger(SimpleGui.class.getName());
         private JTable simpleTable;
         public SimpleGui() {
              super("Simple GUI");
              setPreferredSize(new Dimension(500, 500));
              setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              setLayout(new BorderLayout());
         public void constructGui() {
              simpleTable = new JTable(new SimpleTableModel());
              simpleTable.getColumnModel().getColumn(2).setCellRenderer(new HasItCellRenderer());
              SpecialCellRenderer specRen = new SpecialCellRenderer(log);
              simpleTable.setDefaultRenderer(Double.class, specRen);
              simpleTable.setDefaultRenderer(String.class, specRen);
              simpleTable.setDefaultRenderer(Date.class, specRen);
              //simpleTable.setDefaultRenderer(Boolean.class, specRen);
              add(new JScrollPane(simpleTable), BorderLayout.CENTER);          
              pack();
              setVisible(true);
         private void populate() {
              List <List<Object>>people = new ArrayList<List<Object>>();
              List <Object>people1 = new ArrayList<Object>();
              people1.add(0, "Jose");
              people1.add(1, 500.333333567);
              people1.add(2, Boolean.TRUE);
              people1.add(3, new Date());
              people.add(people1);
              List <Object>people2 = new ArrayList<Object>();
              people2.add(0, "Yes, you!");
              people2.add(1, 100.522222);
              people2.add(2, Boolean.FALSE);
              people2.add(3, new Date());
              people.add(people2);
              List <Object>people3 = new ArrayList<Object>();
              people3.add(0, "Who, me?");
              people3.add(1, 0.00001);
              people3.add(2, Boolean.TRUE);
              people3.add(3, new Date());
              people.add(people3);
              List <Object>people4 = new ArrayList<Object>();
              people4.add(0, "Peter Parker");
              people4.add(1, 11.567444444);
              people4.add(2, Boolean.FALSE);
              people4.add(3, new Date());
              people.add(people4);
              ((SimpleTableModel) simpleTable.getModel()).addAll(people);
          * @param args
          * @throws InvocationTargetException
          * @throws InterruptedException
         public static void main(String[] args) throws InterruptedException, InvocationTargetException {
              final SimpleGui instance = new SimpleGui();
              SwingUtilities.invokeAndWait(new Runnable() {
                   @Override
                   public void run() {
                        instance.constructGui();
              instance.populate();
    }I decided to write a more specific renderer just for that column:
    import java.awt.Color;
    import java.awt.Component;
    import javax.swing.JTable;
    import javax.swing.UIManager;
    import javax.swing.table.DefaultTableCellRenderer;
    * Cell renderer used only by the DividendElement table
    * @author josevnz
    final class HasItCellRenderer extends DefaultTableCellRenderer {
         protected static final long serialVersionUID = 2596173912618784286L;
         private Color hasIt = new Color(255, 225, 0);
         public HasItCellRenderer() {
              super();
              setOpaque(true);
         @Override
         public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
              Component comp = super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
              int desCol = table.convertColumnIndexToView(1);
              if (! isSelected && value instanceof Boolean && column == desCol) {
                   if (((Boolean) value).booleanValue()) {
                        comp.setForeground(hasIt);     
                   } else {
                        comp.setForeground(UIManager.getColor("table.foreground"));
              return comp;
          * Override for performance reasons
         @Override
         public void firePropertyChange(String propertyName, boolean oldValue, boolean newValue) {
              // EMPTY
         @Override
         protected void firePropertyChange(String propertyName, Object oldValue, Object newValue) {
              // EMPTY
         @Override
         public void revalidate() {
              // EMPTY
         @Override
         public void validate() {
              // EMPTY
    } // end classBut the rendering comes all wrong (a String saying true or false, not the expected checkbox from the default renderer) and also there is a weird flickring effect as this particular boolean column is editable (per table model, not show here)...
    I can post the table model and the other renderer if needed (didn't want to put too much code on the question, at least initiallty).
    Should I render a checkbox myself for this cell in the custom renderer? I'm puzzled as I expected the default renderer part of the code to do this for me instead.
    Thanks!
    Edited by: josevnz on Apr 14, 2009 12:35 PM
    Edited by: josevnz on Apr 14, 2009 12:37 PM

    camickr
    Thats because the default render is a JLabel and it just displays the text from the toString() method of the Object in the table model.What I meant to say is that I expected the JCheckbox not a String representation of the boolean value.
    Thats because a different renderer is used depending on the Class of data in the column. Look at the source code for the JTable class to see what the "default >renderer for the Boolean class" is. Then you can extend that or if its a private class then you will need to copy all the code and customize it.At the end I looked at the code and replicated the functionality I needed. I thought than maybe there was a way to avoid replicating the same logic all over again in order to implement this functionality. Good advice, though.
    see you learned nothing from your last posting. This is NOT a SSCCE. 90% of the code you posted is completely irrelevant for the described problem. There is abosutelly no need to post the custom TableModel, because there is no need to use a custom TableModel for this problem. The TableModel has nothing to do with how a column is rendererd.The custom table model returns the type of the column (giving a hint to the renderer on what to expect, right?) and for the one that had a problem it says than the class is Boolean. That's why I mentioned it:
    public Class getColumnClass(int columnIndex) {
        // Code omited....
    You also posted data for 4 columns worth of data. Again, irrelevant. Your question is about a single column containing Boolean data, so forget about the other columns.
    When creating a SSCCE you don't start with your existing code and "remove" code. You start with a brand new class and only add in what is important. That way hopefully if you made a mistake the first time you don't repeat it the second time.That's what I did, is not the real application. I copy & pasted code in a haste from this dummy program on this forum, not the best approach as it gave the wrong impression.
    Learn how to write a proper SSCCE if you want help in the future. Point taken, but there is NO need for you to be rude. Your help is appreciated.
    Regards,
    Jose.

  • Issue with Component Binding

    Hi,
    I'm using JDeveloper version - 11.1.1.6
    I have following usecase in my product:
    1. In summary page, I have table to display list of Activities.
    2. When user Clicks an Activity, display the Activity summary (Region) below the table. The Activity summary page has Panel Tabbed component with 2 ShowDetailItem components.
    I defined a binding in pageFlowScope for PanelTabbed component in the Managed Bean.
    When I select the first activity, In the Activity summary bean, the task-flow initializer method executes first and PanelTabbed component setter method gets executed later.
    But when I select any other activity the execution is in reverse order - The setter method of PanelTabbed component executes first and task-flow initializer method executes later.
    Is this expected behavior? How can I ensure that task-flow initializer method executes first every time before executing the component bindings setter method?
    Any inputs would be helpful.
    Thanks
    Ravi

    Hi,
    component bindings must be in request scope not pageFlowScope. Please use backingBeanScope in your case
    Frank

  • Using XML with special characters - not rendering

    Hello,
    I am using xml to populate the content of a Flash file, but
    we have localized content for different global regions. So, when
    the content contains special characters like "é" they do not
    show up at all in the flash. I tried using &eacute; but that
    just renders the actual code...
    Is there a workaround for this?
    Thanks

    Hi Rothrock, thanks for your reply...
    Flash Version: 8, but the swf was published to be 7+
    compatible.
    The font is Meta Normal, it is embedded, and it does include
    the character.
    I am retrieving the xml by using this script in the html
    page:
    <script type="text/javascript">
    // <![CDATA[
    var fo = new FlashObject("/templates/flash/index.swf" +
    cKiller, "ad-flash", "710", "351", "7", "#FFFFFF");
    fo.addVariable("xmlURL", "/flash_content/products.xml");
    fo.write("ad");
    // ]]>
    </script>
    I am creating the XML using Macromedia Homesite, with the
    encoding declaration <?xml version="1.0" encoding="UTF-8" ?>
    The XML is being read fine, only the special characters don't
    show up... so it will cut off the word, or just have an empty space
    where the character should be.
    I am not sure how to specifiy Extended Latin charset in the
    document... could you tell me how to do that?
    Thanks

  • Blank h:dataTable with Warning: Could not load ViewHandler

    Hi guys,
    I am getting following warning on my TomCat (5.5.17) screen
    WARNING: Could not load ViewHandler com.sun.facelets.FaceletViewHandler
    java.lang.ClassNotFoundException: com.sun.facelets.FaceletViewHandler
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1352)
    when I try to execute my EmpList.jsp with following code
    <f:view>
    <h:form>
    <h:dataTable
    value="#{EmpBean.myDataList}"
    var="myDataItem"
    >
    <h:column>
    <f:facet name="header">
    <h:outputText value="ID" />
    </f:facet>
    <h:outputText value="#{myDataList.dept_code}" />
    </h:column>
    <h:column>
    <f:facet name="header">
    <h:outputText value="Name" />
    </f:facet>
    <h:outputText value="#{myDataList.dept_name}" />
    </h:column>
    </h:dataTable>
    </h:form>
    </f:view>
    and there is no data on the list. what else to do?
    Thnx

    This warning can be fixed by adding jsf-facelets.jar to the application.

  • Png with transparent background not rendering on the mac

    I created a png with a transparent background for a header.  It renders fine on the ipad and iphone but not on the mac.  Is there a reason why? The header is on http://surfingthebluemarble.com/news.html
    Thanks in advance for your help!
    Regards,
    umbre gachoong

    If the header in question is the News on the Blue Marble header it seems to be rendering fine on the page and fine if I download the image to my system.
    The background is transparent.

  • Please help me, component binding not work

    Hi
    I have a HtmlSelectManyPicklist in backend and I want to bind it in my xhtml.
    when I set value from server at first time, it works fine but when I click on button to submit the form an exception is thrown with following message:
    exception when I press submit button:
    ERROR Servlet.service() for servlet Faces Servlet threw exception
    javax.faces.el.PropertyNotFoundException: /pages/main/selectColumn.xhtml @26,18 binding="#{userSetting.picklist}": Target Unreachable, identifier 'userSetting' resolved to null
            at com.sun.facelets.el.LegacyValueBinding.isReadOnly(LegacyValueBinding.java:84)
            at org.apache.myfaces.shared_impl.util.RestoreStateUtils.recursivelyHandleComponentReferencesAndSetValid(RestoreStateUtils.java:68)
            at org.apache.myfaces.shared_impl.util.RestoreStateUtils.recursivelyHandleComponentReferencesAndSetValid(RestoreStateUtils.java:41)
            at org.apache.myfaces.shared_impl.util.RestoreStateUtils.recursivelyHandleComponentReferencesAndSetValid(RestoreStateUtils.java:78)
            at org.apache.myfaces.shared_impl.util.RestoreStateUtils.recursivelyHandleComponentReferencesAndSetValid(RestoreStateUtils.java:41)
            at org.apache.myfaces.lifecycle.LifecycleImpl.restoreView(LifecycleImpl.java:179)
            at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:66)
            at javax.faces.webapp.FacesServlet.service(FacesServlet.java:137)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
            at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:100)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
            at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:147)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
            at org.jboss.seam.servlet.SeamRedirectFilter.doFilter(SeamRedirectFilter.java:29)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
            at org.jboss.seam.servlet.SeamCharacterEncodingFilter.doFilter(SeamCharacterEncodingFilter.java:41)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
            at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
            at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
            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:856)
            at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
            at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
            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)the code in server side to create a new instance of component is:
              Application app = FacesContext.getCurrentInstance().getApplication();
              picklist = (HtmlSelectManyPicklist)  app.createComponent(HtmlSelectManyPicklist.COMPONENT_TYPE);
              picklist.setValueBinding("picklist", app.createValueBinding("#{userSetting}"));the code in my xhtml file :
            <s:selectManyPicklist size="5" binding="#{userSetting.picklist}"
                                        >
                 <s:selectItems value="#{userSetting.columnHeaders}" var="column"
                                       itemValue="#{column.name}" itemLabel="#{column.label}" />
            </s:selectManyPicklist>
            <h:commandButton value="Submit" class="button" action="#{userSetting.display}"/>lots of thanks

    the code in server side to create a new instance of
    component is:
    Application app =
    =
    FacesContext.getCurrentInstance().getApplication();
    picklist = (HtmlSelectManyPicklist)
    t)
      app.createComponent(HtmlSelectManyPicklist.COMPONENT_
    YPE);
    picklist.setValueBinding("picklist",
    ", app.createValueBinding("#{userSetting}"));
    the code in my xhtml file :
    <s:selectManyPicklist size="5"
      binding="#{userSetting.picklist}"
    :selectItems value="#{userSetting.columnHeaders}"
    var="column"
    itemValue="#{column.name}"
    lumn.name}" itemLabel="#{column.label}" />
             </s:selectManyPicklist>
    <h:commandButton value="Submit"
      class="button" action="#{userSetting.display}"/>
    I haven't used selectManyPicklist . But , are you sure you want to bind it to the Component ? Can't you just bind the value attribute to some Backing Bean data type something like a String array?
    1)
    You can try the server side code that you have put in the BackingBean's constructor. or
    2) Have a instance variable of type HtmlSelectManyPicklist with getter and setter in your Backing Bean and bind it as follows.
    HtmlSelectManyPicklist  picklist;
    public getPicklist  (){
    return picklist;
    <s:selectManyPicklist size="5"
      binding="#{BackingBean.picklist}"Hope this solves your problem.
    Karthik

  • 3D effect with color burn not rendering out.Please help.

    Hello,
    I am rendering out a 3D effect using an adjustment layer with stroked lines. I have the transfer mode on these lines set to "classic color burn" because it's the look that I want. However when I render the effect out, the lines are almost invisible in the final render. I also have some lights in the scene and am using 3D element with a 3D object. Could the lights be causing a problem? I will attach a photo of the scene before and after render. Thanks in advance for any help!
    John Grosjean
    Here are the pics. In the second set the rings almost disappear completely.

    We can't know. We don't know the exact settings you used in the timeline nor any other details like what version of AE, what system and so on, since you haven't bothered to provide them. From your shapes not being properly pre-composed to issues with 3D render order and collapsed transformations there could be anything going on. We simply don't know based on your insufficient info.
    Mylenium

  • Font used in masked component is not rendered

    Hi,
    I developed a formular using components (Button and List),
    that formular is masked and all the fonts used used by my
    components are not displayed.
    When removing the mask, the component's titles are
    displayiing properly.
    How can I render the font of my components when masked?
    Is there a trick?
    Thanks

    I found the solution :
    the form is contained in a clip called "clip", I merely had
    to set the cacheAsBitmap value to true :
    clip.cacheAsBitmap=true;

  • t:tree component is not rendering tree structure for my page

    Dear dudes,
    I want to create a simple tree structure in my jsf page backed by a backing bean.
    But my jsf page is getting executed but my tree is not getting displayed.
    my jsf page:<ui:composition xmlns="http://www.w3.org/1999/xhtml"
         xmlns:ui="http://java.sun.com/jsf/facelets"
         xmlns:h="http://java.sun.com/jsf/html"
         xmlns:f="http://java.sun.com/jsf/core"
         xmlns:s="http://jboss.com/products/seam/taglib"
         xmlns:rich="http://richfaces.ajax4jsf.org/rich"
         xmlns:t="http://myfaces.apache.org/tomahawk"
         xmlns:a4j="https://ajax4jsf.dev.java.net/ajax">
    <f:view>
         <html>
              <body>
                   <h:form>
                        <t:tree id="tree" value="#{mytreeBean.myTree}" styleClass="tree"
                             nodeClass="treenode" selectedNodeClass="treenodeSelected"
                             >
                        </t:tree>
                   </h:form>
              </body>
         </html>
    </f:view>
    </ui:composition>Mybacking bean:
    package org.test.tree;
    import java.util.Iterator;
    import java.util.List;
    import org.apache.myfaces.custom.tree.DefaultMutableTreeNode;
    import org.apache.myfaces.custom.tree.model.DefaultTreeModel;
    import com.srit.framework.web.BasePage;
    import com.srit.healthcare.common.lookupentity.repository.ILookupRepository;
    import com.srit.healthcare.common.tree.domain.RcareTree;
    public class MyTreebean {
         private DefaultTreeModel myTree;
         public DefaultTreeModel getMyTree() {
              return myTree=getTreeModel();
         public void setMyTree(DefaultTreeModel myTree) {
              this.myTree = myTree;
         /*public MyTreebean() {
              DefaultMutableTreeNode root = new DefaultMutableTreeNode("XY");
              DefaultMutableTreeNode a = new DefaultMutableTreeNode("A");
              root.insert(a);
              DefaultMutableTreeNode b = new DefaultMutableTreeNode("B");
              root.insert(b);
              DefaultMutableTreeNode c = new DefaultMutableTreeNode("C");
              root.insert(c);
              DefaultMutableTreeNode node = new DefaultMutableTreeNode("a1");
              a.insert(node);
              node = new DefaultMutableTreeNode("a2 ");
              a.insert(node);
              node = new DefaultMutableTreeNode("b ");
              b.insert(node);
              a = node;
              node = new DefaultMutableTreeNode("x1");
              a.insert(node);
              node = new DefaultMutableTreeNode("x2");
              a.insert(node);
              myTree = new DefaultTreeModel(root);
         public DefaultTreeModel getTreeModel() {
              DefaultMutableTreeNode root = new DefaultMutableTreeNode("XY");
              DefaultMutableTreeNode a = new DefaultMutableTreeNode("A");
              root.insert(a);
              DefaultMutableTreeNode b = new DefaultMutableTreeNode("B");
              root.insert(b);
              DefaultMutableTreeNode c = new DefaultMutableTreeNode("C");
              root.insert(c);
              DefaultMutableTreeNode node = new DefaultMutableTreeNode("a1");
              a.insert(node);
              node = new DefaultMutableTreeNode("a2 ");
              a.insert(node);
              node = new DefaultMutableTreeNode("b ");
              b.insert(node);
              a = node;
              node = new DefaultMutableTreeNode("x1");
              a.insert(node);
              node = new DefaultMutableTreeNode("x2");
              a.insert(node);
              return myTree = new DefaultTreeModel(root);
    }Also i've configured my tomahawk-taglib file in my web.xml .
    My backing bean is configured in my faces-config.xml
    But i'm not able to get my tree structure in my page .
    Any help would be appreciated.
    Regards

    Dear akash,
    yes i'm seeing the jsf tags <t:tree>
    But when i modify my jsf page , in my configuration files i'm getting the following errors:
    In web.xml
    <web-app xmlns="http://java.sun.com/xml/ns/j2ee"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
         version="2.4">
    </web-app>
    error message:  cannot find the declaration of element web-apps
    error message: failed to read schema document http://java.sun.com/xml/ns/j2ee             http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd  because 1) couldnot find the document 2) the document could not be read 3) the root element of the document is not <xsd:schema>In another configuration file:
    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xmlns:aop="http://www.springframework.org/schema/aop"
         xmlns:tx="http://www.springframework.org/schema/tx"
         xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
                http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd
                http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.0.xsd">
    Error: cannot find the declaration of element 'beans'I'm a novice to JSF technology and plz guide me properly.

  • Doubt about Component binding....

    I have a doubt about component binding because I am also using component binding in my application, in my application each page has more than 20 components and each page is session scope, at one point I am getting message like perm space(this is because of lack of memory, actually I have 4gb ram). So my is
    "does the jsf creates new object for every reload, because of that my jvm filling with all the objects?".
    Another question is "what is the difference between value binding and component bindings?, and drawbacks of each other" please tell me the differences between them up to the very low level(up to memory usage for each approach).
    Please clarify this doubt...........

    JNaveen wrote:
    I have a doubt about component binding because I am also using component binding in my application, in my application each page has more than 20 components and each page is session scope, at one point I am getting message like perm space(this is because of lack of memory, actually I have 4gb ram). So my is
    "does the jsf creates new object for every reload, because of that my jvm filling with all the objects?".This is regardless of the component binding. JSF creates a component tree and stores it in the session. With component binding you can link between the backing bean and the component without the need for UIViewRoot#findComponent().
    Think your problem lies somewhere else. Use a profiler.
    Another question is "what is the difference between value binding and component bindings?, and drawbacks of each other" please tell me the differences between them up to the very low level(up to memory usage for each approach).With the component binding you can get hold of the whole component from the tree in the backing bean. Useful if you want to do a bit more than only holding the component's value, with which you usually do with the value binding.

  • Crystal report not rendering properly on Mozilla ?

    Hi,
    We are using VS2008,CR2008 on server 2012. In Chrome & IE CR working properly.
    But when I am using Mozilla with updated version not rendering properly.

    This is an old version of this issue that might give some insight:
    *[http://stackoverflow.com/questions/19768144/crystal-report-v10-5-toolbar-not-visible-on-firefox-but-visible-on-ie-and-chrome]
    also (but I am not sure what version you are using): " CR 10.5 is one of the versions that was not updated to support IIS7." from [http://www.experts-exchange.com/Database/Reporting/Crystal_Reports/Q_28350929.html]
    It might be ideal to ask a developer in stackoverflow.com or file a bug with webcompat.com for expert investigation for crystal reports. I am sorry I could not be more helpful.

  • 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

Maybe you are looking for

  • AS2 adapter-- Module tab configuration to call seeburger std mappings..!

    Hi Experts, Seeburger has been installed and i want to use AS2 adapter to make use the seeburger standard mappings. When i opened the module tab, its been found that for Sender AS2 adapter: Module Name                                     Module Key l

  • How can I get my dropdown menus to work on Safari?

    I am in a real bind here. The blog I use for my class I teach has dropdown menus, but these don't seem to work in Safari on iPad. They work just fine in Chrome, but our lovely school blocks the Chrome browser...Don't even get me started. Is there som

  • Using OSB 11g with OEPE

    Hi, I have downloaded oepe-galileo-all-in-one-11.1.1.5.0.201003170852-win32 stand-alone from http://www.oracle.com/technology/software/products/oepe/oepe_11115.html?rssid=rss_otn_soft. I am planning to install Oracle Service Bus 11.1.1.3.0 on a remot

  • Import renaming default preference -- does it exist?

    I think the title says it all: auto renaming has now gotten me into trouble a few times.  I would rather forget to rename and have to do so later, rather than forget I did rename, which is when the dupe names start to pile up.  But I don't see a choi

  • Split View navigation

    Hi all, I'm new to flex builder but experienced in flash mobile development using CS5.5. I'm testing flash builder as a platform for building tablet apps and failing so far! There are very few tutorials dedicated to tablet development. ok, to my ques