4 Replies Latest reply on Jan 25, 2010 7:53 AM by Matthias Reusch

    JSF Warning : WARN UIComponentBase:266 - WARNING:

    Matthias Reusch Newbie

      hi out there,

      can somebody tell me how to disable the following Warning in my myfaces web application.

      ...
      16:57:34,984  WARN UIComponentBase:266 - WARNING: Component referListForm:referListForm_tab:j_id1320 just got an automatic id, because there was no id assigned yet. If this component was created dynamically (i.e. not by a JSP tag) you should assign it an explicit static id or assign it the id you get from the createUniqueId from the current UIViewRoot component right after creation! Path to Component: {Component-Path : [Class: org.ajax4jsf.component.AjaxViewRoot,ViewId: /monitor/rich_front.jsp][Class: org.apache.myfaces.custom.document.Document,Id: rich_front_jsp_doc][Class: org.apache.myfaces.custom.document.DocumentBody,Id: rich_front_jsp_docBody][Class: org.ajax4jsf.component.html.HtmlPage,Id: rich_front_a4j_page][Class: org.apache.myfaces.custom.layout.HtmlPanelLayout,Id: page][Class: org.apache.myfaces.component.html.ext.HtmlPanelGrid,Id: treeStatusTest_grid][Class: org.apache.myfaces.component.html.ext.HtmlPanelGroup,Id: rich_front_right][Class: org.apache.myfaces.component.html.ext.HtmlPanelGroup,Id: referListTest_incl][Class: org.apache.myfaces.custom.div.Div,Id: refer_list_outer_box][Class: javax.faces.component.html.HtmlForm,Id: referListForm][Class: org.richfaces.component.html.HtmlSimpleTogglePanel,Id: referListForm_pan][Class: org.richfaces.component.html.HtmlExtendedDataTable,Id: referListForm_tab][Class: org.richfaces.component.html.ContextMenu,Id: referListForm_tab_col6menu] [Class: org.richfaces.component.html.HtmlMenuGroup,Id: j_id1314][Class: org.richfaces.component.html.HtmlMenuItem,Id: j_id1320] }
      ...


      Thanx a lot.

        • 1. Re: JSF Warning : WARN UIComponentBase:266 - WARNING:
          Ilya Shaikovsky Master
          you could set unique Id by using context.getViewRoot().createUniqueId().
          1 of 1 people found this helpful
          • 2. Re: JSF Warning : WARN UIComponentBase:266 - WARNING:
            Matthias Reusch Newbie
            Hi Ilya,


            thanks for your solution.


            I guess in which part of my code i have to insert the createUniqueId function.


            For example:


            my jsp code


                        <rich:extendedDataTable value="#{statusListHandler.processDataModel}"
                            var="stat" reRender="ds" id="statusListForm_tab"
                            rows="#{statusListHandler.statList.numberOfRows}" width="280px"
                            height="#{statusListHandler.statList.tableHeight}"
                            sortMode="#{statusListHandler.statList.sortMode}"
                            selectionMode="#{statusListHandler.statList.selectionMode}"
                            tableState="#{statusListHandler.statList.tableState}"
                            selection="#{statusListHandler.selection}">


                            <rich:column id="statusListForm_tab_col1" sortable="false"
                                label="Flag" width="25px">
                                <f:facet name="header">
                                    <h:outputText id="statusListForm_tab_head1" value="" />
                                </f:facet>
                                <h:graphicImage id="statusListForm_tab_con1" alt="#{stat.icon}"
                                    value="#{stat.icon}" />
                            </rich:column>


                            <rich:column id="statusListForm_tab_col2" sortable="true"
                                sortBy="#{stat.name}" filterBy="#{stat.name}" filterEvent="onkeyup"
                                width="170px" label="Prozess Name">
                                <f:facet name="header">
                                    <h:outputText id="statusListForm_tab_head2" value="Prozess Name" />
                                </f:facet>
                                <h:outputText id="statusListForm_tab_con2" value="#{stat.name}" />
                            </rich:column>


                            <rich:column id="statusListForm_tab_col3" sortable="true"
                                sortBy="#{stat.status}" filterBy="#{stat.status}"
                                filterEvent="onkeyup" width="40px" label="Code">
                                <f:facet name="header">
                                    <h:outputText id="statusListForm_tab_head3" value="Code" />
                                </f:facet>
                                <h:outputText id="statusListForm_tab_con3" value="#{stat.status}" />
                            </rich:column>


                            <rich:column id="statusListForm_tab_col4" sortable="false"
                                label="Count" width="50px">
                                <f:facet name="header">
                                    <h:outputText id="statusListForm_tab_head4" value="Anzahl" />
                                </f:facet>
                                <h:outputText id="statusListForm_tab_con4" value="#{stat.cnt}" />
                            </rich:column>


                            <f:facet name="footer">
                                <rich:datascroller id="ds" renderIfSinglePage="false"></rich:datascroller>
                            </f:facet>


                            <a4j:support id="statusListForm_tab_sel"
                                reRender="statusTreeForm_pan,resultListForm_pan,resultListForm_sel_pan,referListForm_pan"
                                action="#{statusListHandler.takeSelection}"
                                event="onselectionchange" status="ajaxStatusLoader" />


                        </rich:extendedDataTable>


            and here the java code:


                // Handler
               
                public StatusListHandler() {
                    super();
                    this.statList = new StatusList();
                    this.result = this.statList.getResult(FormFilterUtil
                            .findCheckedFilterFromSession());
                }


                public ExtendedTableDataModel<StatusBean> getProcessDataModel() {

                    result = this.statList.getResult(FormFilterUtil
                            .findCheckedFilterFromSession());

                    if (dataModel == null) {
                        dataModel = new ExtendedTableDataModel<StatusBean>(
                                new DataProvider<StatusBean>() {

                                    private static final long serialVersionUID = 5054087821033164847L;

                                    public StatusBean getItemByKey(Object key) {
                                        for (StatusBean c : result) {
                                            if (key.equals(getKey(c))) {
                                                return c;
                                            }
                                        }
                                        return null;
                                    }

                                    public List<StatusBean> getItemsByRange(int firstRow,
                                            int endRow) {

                                        if (result == null)
                                            return new ArrayList<StatusBean>();

                                        return result.subList(firstRow, endRow);
                                    }

                                    public Object getKey(StatusBean item) {
                                        return item.getName();
                                    }

                                    public int getRowCount() {

                                        if (result == null)
                                            return 0;

                                        return result.size();
                                    }

                                });
                    }
                    return dataModel;
                }


                // StatusList Bean
               
                List<FormFilterObject> checkedFilterFromSession) {


                    FilterAddonBean fab = (FilterAddonBean) FacesContext
                            .getCurrentInstance().getExternalContext().getSessionMap().get(
                                    "filterAddonBean");


                    int useUnknown = 0;
                    int showGlobalStatus = 0;
                    int showProcStatus = 0;
                   
                    if(fab != null){
                       
                        useUnknown = fab.getUseUnknown();
                        showGlobalStatus = fab.getShowGlobalStatus();
                        showProcStatus = fab.getShowProcStatus();
                    }


                    if (checkedFilterFromSession == null)
                        return getResult();


                    VprocessTreeStatusEDAO dao = new VprocessTreeStatusEDAO();
                    List<StatusBean> names = dao.findProcessNamesForStatusList(
                            checkedFilterFromSession, useUnknown, showGlobalStatus,
                            showProcStatus);


                    return names;


                }



            thanks in advance.


            Matthias
            • 3. Re: JSF Warning : WARN UIComponentBase:266 - WARNING:
              Matthias Reusch Newbie

              how can i suppress this warning output (may be in web.xml or log4j.property).

              • 4. Re: JSF Warning : WARN UIComponentBase:266 - WARNING:
                Matthias Reusch Newbie

                sorry, the following entry into my log4j.properties helps

                 

                log4j.logger.javax.faces.component.UIComponentBase=ERROR