12 Replies Latest reply on Mar 25, 2011 7:51 AM by deeps83

    Combobox ajax support issue.

    deeps83

      Hi,

       

      I have an extended data table in which one column is combobox which is having an ajax support for event onselect.Problem is the ajax support won't get triggered once the page is loaded first time.But once I refresh the page it will work.What can be the reason?

      The code is given below :

       

      <rich:tab label="QData" id="metTab" rendered="true"

                              name="metTab" limitToList="true">

                              <h:form id="pvForm3">

                                  <a:outputPanel id="pvMetricPanel">

                                      <rich:panel style="padding-top: 10px;" id="pv14">

                                          <rich:extendedDataTable height="167px"

                                              noDataLabel="No quality data available for the node"

                                              value="#{plantview.metricsList}" var="metricvar"

                                              sortMode="single" id="metrictable"

                                              selection="#{plantview.qualityrowselected}"

                                              selectedClass="table-row-selected" headerClass="table-header"

                                              activeClass="table-row-selected" rowClasses="row1, row2"

                                              ajaxKeys="#{plantview.keyToUpdate}">

                                              <rich:column width="200" label="Source Name"

                                                  sortBy="#{metricvar.getSource()}" sortable="true" id="pv15">

                                                  <f:facet name="header">

                                                      <h:outputText styleClass="headerText" value="Source Name"

                                                          id="pv16" />

                                                  </f:facet>

                                                  <s:div styleClass="coltextwrap" id="pv17">

                                                      <h:outputText value="#{metricvar.getSource()}" id="pv18" />

                                                  </s:div>

                                              </rich:column>

       

                                              <rich:column width="200" label="Metrics"

                                                  sortBy="#{metricvar.getMetric()}" sortable="true" id="pv19">

                                                  <f:facet name="header">

                                                      <h:outputText styleClass="headerText" value="Metrics"

                                                          id="pv20" />

                                                  </f:facet>

                                                  <s:div styleClass="coltextwrap" id="pv21">

                                                      <h:outputText value="#{metricvar.getMetric()}" id="pv22" />

                                                  </s:div>

                                              </rich:column>

       

                                              <rich:column width="180" label="Time Period" id="pv23">

                                                  <f:facet name="header">

                                                      <h:outputText styleClass="headerText" value="Time Period"

                                                          id="pv24" />

                                                  </f:facet>

                                                  <rich:comboBox value="#{metricvar.timePeriod}"

                                                      suggestionValues="#{plantview.getMetricsTimePeriodList(metricvar)}"

                                                      defaultLabel="Select Time Period" style="text-align: left;"

                                                      enableManualInput="false" width="150"

                                                      itemClass="stepsgridstyle"

                                                      itemSelectedClass="stepsgridstyle" immediate="true"

                                                      timeout="60000" id="tpCombo">

                                                      <a:support

                                                          action="#{plantview.getReportForMetric(metricvar)}"

                                                          event="onselect"

                                                          reRender="stationgrid,chartgrid,pvMail,pvPrint,defaultstationpanel,tpCombo,pgrowl"

                                                          limitToList="true" id="pv25" rendered="true"/>

                                                  </rich:comboBox>

       

                                              </rich:column>

                                          </rich:extendedDataTable>

                                      </rich:panel>

                                  </a:outputPanel>

       

                              </h:form>

                          </rich:tab>

       

      Thanks in advance,

      Deeps.

        • 1. Combobox ajax support issue.
          deeps83

          Hi,

           

          Are there any issues while using a combobox inside a table?

           

          Deeps.

          • 2. Combobox ajax support issue.
            ilya_shaikovsky

            no should not be any problems. check a4j:log and server messages.

            • 3. Re: Combobox ajax support issue.
              deeps83

              Hi,

              Thanks for the reply.Here is the log I am getting when the combobox is selected.

               

              debug[16:50:51,727]: search for elements by name 'script'  in element span

              debug[16:50:51,728]: Scripts in updated part count : 1

              debug[16:50:51,728]: Update part of page for Id: inclId:j_id508 successful

              debug[16:50:51,728]: call selectSingleNode for id= ajax-view-state

              debug[16:50:51,729]: Hidden JSF state fields:

              debug[16:50:51,729]: Namespace for hidden view-state input fields is undefined

              debug[16:50:51,729]: search for elements by name 'input'  in element span

              debug[16:50:51,730]: Replace value for inputs: 109 by new values: 1

              debug[16:50:51,730]: Input in response: javax.faces.ViewState

              debug[16:50:51,731]: Found same input on page with type: hidden

              debug[16:50:51,731]: Found same input on page with type: hidden

              debug[16:50:51,732]: Found same input on page with type: hidden

              debug[16:50:51,743]: Found same input on page with type: hidden

              debug[16:50:51,744]: Found same input on page with type: hidden

              debug[16:50:51,744]: Found same input on page with type: hidden

              debug[16:50:51,745]: Found same input on page with type: hidden

              debug[16:50:51,747]: Found same input on page with type: hidden

              debug[16:50:51,747]: Found same input on page with type: hidden

              debug[16:50:51,748]: Found same input on page with type: hidden

              debug[16:50:51,749]: Found same input on page with type: hidden

              debug[16:50:51,749]: Found same input on page with type: hidden

              debug[16:50:51,750]: Found same input on page with type: hidden

              debug[16:50:51,750]: Found same input on page with type: hidden

              debug[16:50:51,751]: Found same input on page with type: hidden

              debug[16:50:51,751]: Found same input on page with type: hidden

              debug[16:50:51,752]: Found same input on page with type: hidden

              debug[16:50:51,752]: search for elements by name 'INPUT'  in element span

              debug[16:50:51,753]: Replace value for inputs: 109 by new values: 0

              debug[16:50:51,753]: call selectSingleNode for id= _ajax:data

              debug[16:50:51,754]: call selectSingleNode for id= _ajax:data

              debug[16:50:51,754]: call selectSingleNode for id= _ajax:data

              debug[16:50:51,755]: call selectSingleNode for id= _A4J.AJAX.focus

              debug[16:50:51,755]: No focus information in response

              debug[16:50:51,800]: Evaluate script replaced area in document: //LOG.LEVEL = LOG.ALL;//

              debug[16:50:51,809]: Script evaluation succeeded

              debug[16:50:51,809]: call selectSingleNode for id= org.ajax4jsf.oncomplete

              debug[16:50:51,810]: Processing updates finished, no oncomplete function to call

               

              Hope you will be able to help me with this.

               

              Thanks,

              Deeps.

              • 4. Re: Combobox ajax support issue.
                deeps83

                Hi,

                 

                Can you please give me a reply for this?

                 

                Deeps.

                • 5. Re: Combobox ajax support issue.
                  deeps83

                  Hi Illya,

                   

                  Can you please tell me what I can undertsand form the log?

                   

                  Thanks,

                  Deeps.

                  • 6. Re: Combobox ajax support issue.
                    deeps83

                    Hi,

                    Here is the log I am getting when the combobox is selected.

                     

                    debug[16:50:51,727]: search for elements by name 'script'  in element span

                    debug[16:50:51,728]: Scripts in updated part count : 1

                    debug[16:50:51,728]: Update part of page for Id: inclId:j_id508 successful

                    debug[16:50:51,728]: call selectSingleNode for id= ajax-view-state

                    debug[16:50:51,729]: Hidden JSF state fields:

                    debug[16:50:51,729]: Namespace for hidden view-state input fields is undefined

                    debug[16:50:51,729]: search for elements by name 'input'  in element span

                    debug[16:50:51,730]: Replace value for inputs: 109 by new values: 1

                    debug[16:50:51,730]: Input in response: javax.faces.ViewState

                    debug[16:50:51,731]: Found same input on page with type: hidden

                    debug[16:50:51,731]: Found same input on page with type: hidden

                    debug[16:50:51,732]: Found same input on page with type: hidden

                    debug[16:50:51,743]: Found same input on page with type: hidden

                    debug[16:50:51,744]: Found same input on page with type: hidden

                    debug[16:50:51,744]: Found same input on page with type: hidden

                    debug[16:50:51,745]: Found same input on page with type: hidden

                    debug[16:50:51,747]: Found same input on page with type: hidden

                    debug[16:50:51,747]: Found same input on page with type: hidden

                    debug[16:50:51,748]: Found same input on page with type: hidden

                    debug[16:50:51,749]: Found same input on page with type: hidden

                    debug[16:50:51,749]: Found same input on page with type: hidden

                    debug[16:50:51,750]: Found same input on page with type: hidden

                    debug[16:50:51,750]: Found same input on page with type: hidden

                    debug[16:50:51,751]: Found same input on page with type: hidden

                    debug[16:50:51,751]: Found same input on page with type: hidden

                    debug[16:50:51,752]: Found same input on page with type: hidden

                    debug[16:50:51,752]: search for elements by name 'INPUT'  in element span

                    debug[16:50:51,753]: Replace value for inputs: 109 by new values: 0

                    debug[16:50:51,753]: call selectSingleNode for id= _ajax:data

                    debug[16:50:51,754]: call selectSingleNode for id= _ajax:data

                    debug[16:50:51,754]: call selectSingleNode for id= _ajax:data

                    debug[16:50:51,755]: call selectSingleNode for id= _A4J.AJAX.focus

                    debug[16:50:51,755]: No focus information in response

                    debug[16:50:51,800]: Evaluate script replaced area in document: //LOG.LEVEL = LOG.ALL;//

                    debug[16:50:51,809]: Script evaluation succeeded

                    debug[16:50:51,809]: call selectSingleNode for id= org.ajax4jsf.oncomplete

                    debug[16:50:51,810]: Processing updates finished, no oncomplete function to call

                     

                    and the following is the log I am getting when the action is getting called on combobox selection after the page is refreshed.

                     

                    debug[15:43:42,716]: Have Event [object Object] with properties: target: [object HTMLDivElement], srcElement: [object HTMLDivElement], type: dataavailable

                    debug[15:43:42,717]: Query preparation for form 'inclId:pvForm3' requested

                    debug[15:43:42,718]: Append hidden control inclId:pvForm3 with value [inclId:pvForm3] and value attribute [inclId:pvForm3]

                    debug[15:43:42,719]: Append text control inclId:pvForm3:metrictable:0:tpCombocomboboxField with value [] and value attribute [null]

                    debug[15:43:42,720]: Ignored text no-name control with value [] and value attribute [null]

                    debug[15:43:42,722]: Ignored text no-name control with value [] and value attribute [null]

                    debug[15:43:42,723]: Append hidden control inclId:pvForm3:metrictable:0:tpCombo with value [Bi-Weekly] and value attribute [Bi-Weekly]

                    debug[15:43:42,724]: Append text control inclId:pvForm3:metrictable:1:tpCombocomboboxField with value [Select Time Period] and value attribute [Select Time Period]

                    debug[15:43:42,725]: Ignored text no-name control with value [] and value attribute [null]

                    debug[15:43:42,726]: Ignored text no-name control with value [] and value attribute [null]

                    debug[15:43:42,727]: Append hidden control inclId:pvForm3:metrictable:1:tpCombo with value [] and value attribute [null]

                    debug[15:43:42,728]: Append text control inclId:pvForm3:metrictable:2:tpCombocomboboxField with value [Select Time Period] and value attribute [Select Time Period]

                    debug[15:43:42,729]: Ignored text no-name control with value [] and value attribute [null]

                    debug[15:43:42,730]: Ignored text no-name control with value [] and value attribute [null]

                    debug[15:43:42,731]: Append hidden control inclId:pvForm3:metrictable:2:tpCombo with value [] and value attribute [null]

                    debug[15:43:42,733]: Append text control inclId:pvForm3:metrictable:3:tpCombocomboboxField with value [Select Time Period] and value attribute [Select Time Period]

                    debug[15:43:42,734]: Ignored text no-name control with value [] and value attribute [null]

                    debug[15:43:42,735]: Ignored text no-name control with value [] and value attribute [null]

                    debug[15:43:42,736]: Append hidden control inclId:pvForm3:metrictable:3:tpCombo with value [] and value attribute [null]

                    debug[15:43:42,737]: Append text control inclId:pvForm3:metrictable:4:tpCombocomboboxField with value [Select Time Period] and value attribute [Select Time Period]

                    debug[15:43:42,738]: Ignored text no-name control with value [] and value attribute [null]

                    debug[15:43:42,739]: Ignored text no-name control with value [] and value attribute [null]

                    debug[15:43:42,740]: Append hidden control inclId:pvForm3:metrictable:4:tpCombo with value [] and value attribute [null]

                    debug[15:43:42,741]: Append text control inclId:pvForm3:metrictable:5:tpCombocomboboxField with value [Select Time Period] and value attribute [Select Time Period]

                    debug[15:43:42,742]: Ignored text no-name control with value [] and value attribute [null]

                    debug[15:43:42,744]: Ignored text no-name control with value [] and value attribute [null]

                    debug[15:43:42,745]: Append hidden control inclId:pvForm3:metrictable:5:tpCombo with value [] and value attribute [null]

                    debug[15:43:42,746]: Append text control inclId:pvForm3:metrictable:6:tpCombocomboboxField with value [Select Time Period] and value attribute [Select Time Period]

                    debug[15:43:42,747]: Ignored text no-name control with value [] and value attribute [null]

                    debug[15:43:42,748]: Ignored text no-name control with value [] and value attribute [null]

                    debug[15:43:42,748]: Append hidden control inclId:pvForm3:metrictable:6:tpCombo with value [] and value attribute [null]

                    debug[15:43:42,749]: Append text control inclId:pvForm3:metrictable:7:tpCombocomboboxField with value [Select Time Period] and value attribute [Select Time Period]

                    debug[15:43:42,750]: Ignored text no-name control with value [] and value attribute [null]

                    debug[15:43:42,750]: Ignored text no-name control with value [] and value attribute [null]

                    debug[15:43:42,751]: Append hidden control inclId:pvForm3:metrictable:7:tpCombo with value [] and value attribute [null]

                    debug[15:43:42,752]: Append text control inclId:pvForm3:metrictable:8:tpCombocomboboxField with value [Select Time Period] and value attribute [Select Time Period]

                    debug[15:43:42,752]: Ignored text no-name control with value [] and value attribute [null]

                    debug[15:43:42,753]: Ignored text no-name control with value [] and value attribute [null

                     

                    One more thing I have noticed is as soon as the combobox is selected first I can see the log which looks like the log I am getting when the action is getting called (second log above) whis is suddenly replaced with the first log above.

                     

                    Please give me a reply for this because I tried a lot,and could not find a solution.

                     

                    Thanks,

                    Deeps.

                    • 7. Re: Combobox ajax support issue.
                      ilya_shaikovsky

                      sorry tried again under 3.3.3 last version and

                      with that code

                      <h:form id="form">

                                          <a4j:outputPanel>

                                          <h:panelGrid columns="2" columnClasses="top , top">

                                                    <rich:extendedDataTable rowKeyConverter="#{entityConverter}"

                                                              value="#{capitalsBean.capitals}" var="cap" id="table"

                                                              width="580px" height="400px" enableContextMenu="false"

                                                              sortMode="#{extendedTableBean.sortMode}"

                                                              selectionMode="#{extendedTableBean.selectionMode}"

                                                              tableState="#{extendedTableBean.tableState}"

                                                              selection="#{extendedTableBean.selection}">

                                                              <rich:column sortable="false" label="Flag" id="col_1">

                                                                        <f:facet name="header">

                                                                                  <h:selectBooleanCheckbox value="#{true}" />

                                                                        </f:facet>

                                                                                  <h:selectBooleanCheckbox value="#{true}" />

                                                              </rich:column>

                                                              <rich:column sortable="true" sortBy="#{cap.state}" id="col_2"

                                                                        filterBy="#{cap.state}" filterEvent="onkeyup" width="170px"

                                                                        label="State Name">

                                                                        <f:facet name="header">

                                                                                  <h:outputText value="State Name" id="state_name"/>

                                                                        </f:facet>

                                                                        <rich:comboBox value="#{cap.state}" id="cap_state">

                                                                                            <a4j:support event="onchange" reRender="out"></a4j:support>

                                                                                  </rich:comboBox>

                                                              </rich:column>

                                                              <rich:column label="State Name">

                                                                        <h:outputText value="#{cap.state}" id="out"/>

                                                              </rich:column>

                                                    </rich:extendedDataTable>

                                          </h:panelGrid>

                                          </a4j:outputPanel>

                                </h:form>

                       

                      see the updates fine just after first page render. B.t.w. how do you came to that page? Navigation used? if so - show related code

                      • 8. Re: Combobox ajax support issue.
                        ilya_shaikovsky

                        the same if change to

                        <rich:column sortable="true" sortBy="#{cap.state}" id="col_2"

                                                                          filterBy="#{cap.state}" filterEvent="onkeyup" width="170px"

                                                                          label="State Name">

                                                                          <f:facet name="header">

                                                                                    <h:outputText value="State Name" id="state_name"/>

                                                                          </f:facet>

                                                                          <rich:comboBox value="#{cap.state}" id="cap_state">

                                                                                    <f:selectItem itemLabel="qweqwe" itemValue="qweqwe"/>

                                                                                    <f:selectItem itemLabel="qweqwe" itemValue="qweqwe"/>

                                                                                    <f:selectItem itemLabel="qweqwe" itemValue="qweqwe"/>

                                                                                    <f:selectItem itemLabel="qweqwe" itemValue="qweqwe"/>

                                                                                              <a4j:support event="onselect" reRender="out"></a4j:support>

                                                                                    </rich:comboBox>

                                                                </rich:column>

                        • 9. Re: Combobox ajax support issue.
                          deeps83

                          Thanks for the reply.

                          I have one home page which contains four labels, each for each page, with ajax support.On click of the labels the required html page is included using ajax include and panel is rerendered.Below shown is the code for the same.

                          <h:form id="mainForm">

                                      <a:outputPanel id="MainCmdPanel">

                                          <a:region id="mainregion">

                                              <rich:toolBar styleClass="tab-header" style="width:1051px;height:45px;"

                                                  width="2" itemSeparator="/images/menu_separator.png">

                           

                                                  <c:forEach var="menuitem"

                                                      items="#{applicationbean.listOfPfiApplications}">

                                                      <rich:toolBarGroup

                                                          styleClass="#{applicationbean.appCmdStyle[menuitem.getAppName()]}">

                                                          <h:outputLabel value="#{menuitem.getAppName()}" styleClass="lbl"

                                                              style="padding-left:20px;">

                                                          </h:outputLabel>

                                                          <a:support

                                                              action="#{applicationbean.getPage(menuitem)}"

                                                              reRender="MainPagePanel,MainCmdPanel" event="onitemclick"

                                                              eventsQueue="itmQ" />

                                                      </rich:toolBarGroup>

                                                  </c:forEach>

                                              </rich:toolBar>

                                              <a:status onstart="Richfaces.showModalPanel('astartpanel')"

                                                  onstop="Richfaces.hideModalPanel('astartpanel')" for="mainregion">

                                              </a:status>

                                          </a:region>

                                      </a:outputPanel>

                                  </h:form>

                           

                                  <rich:panel id="MainPagePanel"

                                      style="width:1050px;background-color: transparent;z-index:100;padding-top:5px;">

                                      <a:include viewId="#{applicationbean.selectedPage}" id="inclId"/>

                                  </rich:panel>

                           

                          Thanks,

                          Deeps.

                          • 10. Re: Combobox ajax support issue.
                            deeps83

                            Hi ,

                             

                            Is there any issue in the way in which the page is loaded? Also I didn't get what you meant in the last two mails.Can you please make it more clear?

                             

                            Thanks,

                            Deeps.

                            • 11. Re: Combobox ajax support issue.
                              ilya_shaikovsky

                              in last answers I just shown the code which I'm checking and which works.

                               

                              b.t.w. which scope your applicationbean has?

                               

                              P.S. it seems the easiest way finally investigate differences between our sample - to create small localized sample of the problem. Could you do that?

                              • 12. Re: Combobox ajax support issue.
                                deeps83

                                Ya I will try to do that.My bean in session scope.

                                 

                                Thanks,

                                Deeps.