Custom faces component not rendering at runtime

I'm new to the JSF Framework. So I thought that starting a custom component/tag library would be a good start to jump in and get familiar with it. My goal is to have a project separate from my web-apps that I could compile into a jar which I could include wherever I needed it. So I started simple with two projects: the first is the custom tags project, the second is a simple webapp using jsf / facelets / seam which I am running in a Tomcat 5.5 container.
I've included the complete projects in a zip file here: http://burtoncarl.com/share/CustomProof.zip
I build the components project with ant and include it in the /WEB-INF/lib folder of the web project. But when I open a browser to the web app it doesn't render my tag at all. It leaves my new tag in the rendered HTML which leads me to believe that the parser isn't matching my taglib or something.
And of course I get no errors in any of the log files.
ANY help would be appreciated...

It sounds like the component library is not registered on the page. Assuming you are using facelets, did you define an xmlns for it? E.g. see the definition for the tomahawk library below within the facelet xhtml file:
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"
      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:t="http://myfaces.apache.org/tomahawk">
    <!-- facelets view code goes here -->
</html>You also need to tell facelets about the library in the web.xml:
    <!-- Additional tag libaries for facelets -->
    <context-param>
        <param-name>facelets.LIBRARIES</param-name>
        <param-value>
            /WEB-INF/tomahawk.taglib.xml
        </param-value>
    </context-param>

Similar Messages

  • JSF - UICommand component not rendering properly

    2:12 PM 7/11/2007
    by Nirav Assar
    Overview
    It was discovered that in certain situations a UICommand component does not bind properly to its associated action method in the managed bean. The symptoms of this situation occur when you have a page with an action, and you click the action and nothing occurs. The page seems like it submits, but no code inside the action method of the managed bean gets executed and no errors are generated in the console!
    Problem
    The problem arises when you have a managed bean in request scope and you have a UICommand, either a commandLink or commandButton, associated to the bean. In addition this UICommand component has a rendered attribute tag (boolean value) that uses a managed bean method to tell it whether is renders or not. Even if the component gets rendered to the screen, the component does not get binded to the action method in the request scoped bean. This is a problem with JSF and may be due to the fact that the component gets rendered, but since the bean is not created until a request is submitted, the component never gets binded to an action. Therefore, nothing in the action method ever gets executed.
    Analysis
    Thus is seems like if you want to dynamically render a submit type component, such as a button or a link, you cannot effectivley do that with a bean in request scope. You'll have to place it session scope, which will work fine. Another option is to render the buttons all the time, but based on some scenario, using the "disabled" attribute to prevent a user from using the action. The "disable" attribute can access a boolean method in the managed bean.
    You could also use Javascript to hide the already rendered button on certain circumstance. However this would require javascript knowing the state of the domain objects/and or managed bean state.
    References:
    http://forum.java.sun.com/thread.jspa?threadID=5127437&messageID=9461810

    RamondDeCampo hit the nail on the head. If the bean used for the rendered attribute is request scope and the value differs between requests, you're going to see this type of behavior.
    Search the forums, there have been many similar reports as well as suggested solutions.

  • Component not rendering in Stand Alone Skin editor

    I downloaded the stand alone skin editor and I wanted to play around with it.
    But I notice that my controls are not rendering.
    Kindly see sample image that I am getting. Image
    Not sure why, but I cant seem to see my changes even If I change it in my property inspector.
    Any hints?

    Hi,
    did you check the CSS source of the file to see if invalid styles are added. The visual editor is broken in the image, so there must be something causing it. Ifthe CSS was empty, would the editor render properly ?
    Frank

  • Child component values submitted when parent component not rendered

    This pertains to the standard JSF components, but may carry over into Sun JSC.
    I have a column in a dataTable that contains a checkbox. The rendered attribute on that column is tied to a backing bean property. The column is/is not displayed as appropriate per the value of that property - great.
    Here's the rub: When that column is not rendered and the form is submitted the values for the checkboxes are still being submitted and my data model is being updated for those non-rendered components. Seems like this shouldn't happen, but the real problem is that the values submitted for those checkboxes are always 'false'. Seems like JSF is out of sync in this case in what it does between when the form is loaded and when it is submitted (perhaps it is not loading the values from the data model yet it is updating them on the submit - with garbage).
    To get this to work as I expected I had to set the rendered attribute on the checkbox components to match the rendered attribute on the column that contains them.
    Is there a bug here?

    This pertains to the standard JSF components, but may carry over into Sun JSC.
    I have a column in a dataTable that contains a checkbox. The rendered attribute on that column is tied to a backing bean property. The column is/is not displayed as appropriate per the value of that property - great.
    Here's the rub: When that column is not rendered and the form is submitted the values for the checkboxes are still being submitted and my data model is being updated for those non-rendered components. Seems like this shouldn't happen, but the real problem is that the values submitted for those checkboxes are always 'false'. Seems like JSF is out of sync in this case in what it does between when the form is loaded and when it is submitted (perhaps it is not loading the values from the data model yet it is updating them on the submit - with garbage).
    To get this to work as I expected I had to set the rendered attribute on the checkbox components to match the rendered attribute on the column that contains them.
    Is there a bug here?

  • Custom taglib: tags not rendered in visual editor

    Hi!
    I have created a custom tag library with jsf tags. I have created one tag that extends the CoreSelectOneChoiceTag. When I drag this tag on a page, at runtime it works completely as desired.
    Only, in the visual editor the tag is invisible. With the tag library properties I have specified that the tags should be executed. In the source and structure windows the tags is visible (of course).
    What influences how a tag is rendered in the visual editor, and what content is rendered?
    Jeroen van Veldhuizen

    I know there's a recent release with a visual editor problem, but I'm not sure which one it is. This thread says you need a fresh install? Can you try that?
    Re: ADF Faces tutorial/code sample for data table?

  • Custom software component not selectable in Landscape Configurator

    Hello all,
    I am trying some tutorial about Java development with a track and the developer studio.
    I have successfully created the software component in my SLD, which is well linked to the NWDI. When creating a track in the Landscape Configurator, however, I cannot find my newly created Software Component when trying to specify the SCs developped in this track. I can see all the standard ones which are defined in my SLD, but not mine.
    I already performed this step for other tracks with other custom-defined SCs without problem, but this time it does not work.
    Does someone have a hint of what could cause this ?
    Thanks,
    Thomas

    In addition to realizing that I had not created this thread in the right forum, I have also find the solution. I just had to go to the Landscape Configurator, in Domain Data, and click the "Update CMS" button.
    Maybe this will help someone sometime.

  • Extenal component not rendering file links properly

    Hi Adobe CQ expert,
    We need to include an external web app (based on asp) into our new CQ website. The asp web app is a search engine which searches another internal document database and returnes a list of files such as powerpoints, pdfs etc. These documents cannot be migrated into our CQ database due to various reasons.
    We are using the default 'external' component to include our web app. All works fine until we realise CQ prefixes it's own url to the file hyperlinks which are returned by as search results.
    For example,
    When the asp app running standalone, a file hyperlink looks like this:
    <a href="http://companywebsite.com/search/display.asp?id=FC/07/000009">meeting document</a>
    And clicking on that link will prompt using to download the file.
    But when it is included in CQ using 'external' component, we got:
    <a href="http://companywebsite.com/content/companywebsite/search-documents.html?CFC__target=http%3A %2F%2F10.xx.xxx.xxx%2Fsearch%2Fnew-intranet-display.asp%3Fid%3DFC%2F07%2F000009>meeting document</a>
    // I hid the actually ip address using 'xx' in this post
    How can we strip the CQ url and also format the rest to make sure it doesn't come with all these %2 etc?
    Thanks!

    You are passing the url in querystring and needs to escaped as per standards[1].  So it is  correct.
    I am not sure Try adding an optionally attribute [2] in the <a> helps & note that attribute makes link checker not even check for validity for link.
    [1]   http://en.wikipedia.org/wiki/Query_string#URL_encoding
    [2]   x-cq-linkchecker="skip"

  • Custom barcode component not working properly

    package jpicedt.graphic.view;
    import jpicedt.graphic.model.*; // all elements + drawing
    import jpicedt.graphic.PECanvas;
    import jpicedt.graphic.PicPoint;
    import jpicedt.graphic.PicVector;
    import jpicedt.graphic.PEToolKit;
    import jpicedt.graphic.event.PEMouseEvent;
    import jpicedt.graphic.event.DrawingEvent;
    import jpicedt.graphic.jbarcodebean.*;
    import java.awt.*;
    import java.awt.font.*;
    import java.awt.image.*;
    import java.awt.geom.*;
    import java.util.*;
    import java.awt.image.BufferedImage;
    public class BarcodeView extends AbstractView {
         private PicPoint ptUL = new PicPoint(); // buffer
         private PicPoint ptLR = new PicPoint(); // buffer
    private Barcode barcode = null;
    protected TextLayout textLayout;
    protected AffineTransform tl2ModelTr=new AffineTransform();
         * construct a new View for the given PicGroup
         public BarcodeView(Element e){
              super(e);
              changedUpdate(null);
         * Give notification from the model that a change occured for an element this view is responsible
         * for rendering. This implementation update the view's bounds from the element's bounding box,
         * delegating highlighter's bounds to the current Highlighter delegate..
         public void changedUpdate(DrawingEvent.EventType eventType){
              Rectangle2D oldClip = bounds;
              // update bounds
              bounds = element.getBoundingBox(null); // => null if branchElement is empty !
              if (highlighter!=null) {
                   double s = 1.0;
                   PECanvas canvas = getContainer();
                   if (canvas != null) s=canvas.getScaleFactor();
                   highlighter.changedUpdate(eventType,s);
                   if (bounds!=null) bounds.add(highlighter.getBounds());
              // if event == ADD/REMOVE/REPLACE child, don't bother, just repaint it all :
              if (eventType==null || eventType != DrawingEvent.EventType.GEOMETRY_CHANGE) repaint(null);
              else {
                   if (oldClip!=null) {
                        if (bounds!=null) oldClip.add(bounds);
                        repaint(oldClip);
                   else {
                        if (bounds!=null) repaint(bounds);
                        // else branchElement was empty, and is still empty : do nothing
         * Render the View for the graphic element to the given graphic context. This called "paint"
         * on each child's view if its bounds rectangle intersects the clip.
         * @param allocation the current graphic clip
         public void paint(Graphics2D g, Rectangle2D a){
              if (!a.intersects(getBounds())) return;
              Element be = (Element)element;
    Barcode bar=(Barcode)be;
    //bar.getBarcode()
    //new JBarcodeBean(bar.getBarcode(), new Code39());
    //System.out.println("in Barcodeview paint bar.getBarcode()=========="+bar.getBarcode());
    System.out.println("in Barcodeview paint Graphics2D=========="+g);
              System.out.println("in Barcodeview paint element=========="+be);
              //for(Iterator it=be.children(); it.hasNext();){
    View v = be.getView();
    System.out.println("in Barcodeview paint view=========="+v);
    //for(Iterator it=be.children(); it.hasNext();){
         //          View v = ((Element)it.next()).getView();
         //          if (v!=null) v.paint(g,a);
              AffineTransform oldAT = g.getTransform();
                   // paint text in black
                   g.setPaint(Color.black);
                   // from now on, we work in Y-direct (<0) coordinates to avoid inextricable problems with font being mirrored...
                   //g.transform(oldAT); // also include rotation
    try{
    barcode=BarcodeFactory.create3of9("123456789012",true) ;
    barcode.setBarHeight(100);
    barcode.setBarWidth(100);
    barcode.draw(g, 600,600);
    }catch(BarcodeException bex){System.out.println("create barcode error:\n"+bex.toString());}
         * @return a HitInfo corresponding to the given click-point in model-coordinate.
         public HitInfo hitTest(PEMouseEvent e){
    System.out.println("at barcodeview hitText");
              PicPoint ptClick = e.getPicPoint();
              // test hit on children, highlighted or not, from top to bottom :
              BranchElement be = (BranchElement)element;
    System.out.println("barcodeview hitText BrancheElement be="+be);
              for(int i = be.getChildCount()-1; i>=0; i--){
                   Element o = be.getChildAt(i);
                   if (o.getView().hitTest(e,false)!=null) return new HitInfo.BarcodeComposite(be, i, e);
              return null;
    } // BarcodeView

    So whats the question??? What is it supposed to do if it works properly
    And by the way please put the code tags around your code (see Formatting help link on the page);

  • Interactive forms not rendering in GP 7.0

    Hello everyone,
    I am trying to use interactive forms in GP 7.0, I have followed the help tutorials but the interactive form is just not rendering at runtime. I am able to use successfully other callable objects but the interactive form object always states " next activity not yet started".
    I have checked on all server side configurations in Visual Admin, have given my j2ee server and mail server hostnames wherever necessary but still no success.
    Moreover I am unable to set "Synchronise System Landscape" parameters in Web Services Client - Visual Admin.
    Please provide me with suggestions on this.
    Thanks,
    Lisha

    Hi Yasar,
    I am able to successfully do the standalone interactive form scenario where a form initiates a GP process, but I am unable to do the GP scenario where form is a part of the process.
    My scenario :
    form 1 is a standalone form that triggers a GP process and sends to it some  parameters. The triggered GP process has 2 actions, first action has a webdynpro callable object that retrieves the data from form 1 and second action has an interactive form callable object that will receive data from the WD callable object and send mail/display form.
    At runtime, the form1 triggers GP process, and i can see data in the WD action, but the next action that has interactive form is not executed, neither the form is displayed, nor is it emailed. Moreover its also giving a message that action 2 has been completed!
    I believe i have done all parameter and role mappings, also have updated caf/eu/gp/model service with correct parameters. Also I have a single user as default user for all the roles, and i have set this user's mail id as well.
    Please help if you can..
    Thanks
    Lisha

  • 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>

  • 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 and renderer can't share the same name in face-config.xml

    Hi All,
    I've noticed that a component and a renderer can't share the same name in <face-config.xml>.
    For instance,
    <component>
    <component-type>tree</component-type>
    <component-class>com.xxx.tree.component.Tree</component-class>
    </component>
    <render-kit>
    <renderer>
    <renderer-type>tree</renderer-type>
    <renderer-class>com.xxx.tree.renderer.Tree</renderer-class>
    </renderer>
    </render-kit>     
    generates a cryptic error message.
    It's not a big deal but would be nice to support it.
    The workaround of course is to use a different name for the component and renderer (tree and treeRenderer for instance)
    Stephane

    i dont know why it doesn't work for you. It works for me alright. Can u elaborate on what error messages you are getting? It maybe some other problem.

  • Customer JSF Component Value Expression not work

    why my customer tag not work,
    in my jsp
    <q:my formatString="yyyy/mm/dd" current="#{LoginBean.date}"></q:my>the isLiteralText() always return true, and I can't get the correct value, #{LoginBean.date} is returned.
    bellow is my tag source.
    can anyone help me.
    package jsf;
    import javax.el.ValueExpression;
    import javax.faces.component.UIComponent;
    import javax.faces.webapp.UIComponentELTag;
    public class MyCustomerTag extends UIComponentELTag {
        private String formatString;
        @Override
        public String getComponentType() {
            return "COMPONENT_TYPE";
        @Override
        public String getRendererType() {
            return "COMPONENT_TYPE";
        @Override
        public void release() {
            super.release();
            setFormatString(null);
        @Override
        protected void setProperties(UIComponent component)  {
            if (!(component instanceof UIDatePicker))
                throw new IllegalArgumentException("Component "+
                    component.getClass().getName() +" is no UIDatePicker");
            component.setValueExpression("current", current);
            System.out.println(current.getExpressionString());
            System.out.println(current.isLiteralText());
            System.out.println((String) component.getAttributes().get("current"));
         * @return the formatString
        public String getFormatString() {
            return formatString;
         * @param formatString the formatString to set
        public void setFormatString(String formatString) {
            this.formatString = formatString;
        private ValueExpression current;
         * @return the value
        public ValueExpression getCurrent() {
            return current;
         * @param value the value to set
        public void setCurrent(ValueExpression current) {
            this.current = current;
    }

    I do not know what your native is, but there's quite a huge difference between "custom" and "customer". Look it up in your dictionary.

  • Contents of HTML title Tag not rendering in my AIR HTML component

    I have an Air Application that uses a HTML Component. The HTML page that the component is rendering includes images with title tags. The tags render fine outside the Air Application, but when run in the AIR application, they do not render. Any help when this issue would be greatly appreciated.

    what html component?

  • Contents of HTML title Tag not rendering in AIR HTML component

    I have an Air Application that uses a HTML Component. The HTML page that the component is rendering includes images with title tags. The tags render fine outside the Air Application, but when run in the AIR application, they do not render. Any help when this issue would be greatly appreciated.

    what html component?

Maybe you are looking for