1 Reply Latest reply on Feb 11, 2009 4:17 AM by Hugo Wurzelbutz

    Rerender components based on calendar event

    Hugo Wurzelbutz Newbie

      Hi

      i wrote this code:

      <h:form id="zeiten">
      <a4j:outputPanel id="calendar" layout="block">
       <rich:calendar id="enddatum" value="#{test.date}" popup="true" locale="de/DE" datePattern="dd.MM.yyyy"
       showApplyButton="false" cellWidth="24px" cellHeight="22px" style="width:200px" required="false">
       <a4j:support event="onchanged" reRender="inputstart,inputEnde,testdate" action="#{taskAction.setDate('date')}" ajaxSingle="false"/>
       </rich:calendar>
      </a4j:outputPanel>
      </h:panelGrid>
      <h:outputText value="#{test.date}" id="testdate"/>
      <h:inputText value="#{test.start}" rendered="#{!empty test.date}" id="inputstart">
       <a4j:support event="onkeyup" reRender="dauer" action="#{taskAction.duration}"/>
      </h:inputText>
      <h:message for="enddatum" styleClass="cntError" id="endDatumError"/>
      </h:form>


      after selecting a date the outputText with ID "testdate" is rerendered and displayed correctly but the inputText with ID "inputstart" is not displayed (although test.date can't be null at this time).

      i added a a4j_log to my page, it produces this ouput:
      debug[9:07:16,218]: Have Event [object Object] with properties: target: [object HTMLTableCellElement], srcElement: [object HTMLTableCellElement], type: click
      debug[9:07:16,218]: Query preparation for form 'zeiten' requested
      debug[9:07:16,218]: Append hidden control zeiten with value [zeiten] and value attribute [zeiten]
      debug[9:07:16,218]: Append text control zeiten:enddatumInputDate with value [12.02.2009] and value attribute [null]
      debug[9:07:16,218]: Append hidden control zeiten:enddatumInputCurrentDate with value [02/2009] and value attribute [02/2009]
      debug[9:07:16,218]: Append text control zeiten:j_id28 with value [] and value attribute []
      debug[9:07:16,218]: Append text control zeiten:kontaktID with value [] and value attribute [null]
      debug[9:07:16,218]: Append hidden control javax.faces.ViewState with value [j_id14] and value attribute [j_id14]
      debug[9:07:16,218]: parameter zeiten:j_id14 with value zeiten:j_id14
      debug[9:07:16,218]: Look up queue with default name
      debug[9:07:16,218]: NEW AJAX REQUEST !!! with form: zeiten
      debug[9:07:16,218]: Start XmlHttpRequest
      debug[9:07:16,218]: Reqest state : 1
      debug[9:07:16,218]: QueryString: AJAXREQUEST=_viewRoot&zeiten=zeiten&zeiten%3AenddatumInputDate=12.02.2009&zeiten%3AenddatumInputCurrentDate=02%2F2009&zeiten%3Aj_id28=&zeiten%3AkontaktID=&javax.faces.ViewState=j_id14&zeiten%3Aj_id14=zeiten%3Aj_id14&
      debug[9:07:16,218]: Reqest state : 2
      debug[9:07:16,343]: Reqest state : 3
      debug[9:07:16,343]: Reqest state : 4
      debug[9:07:16,343]: Reqest end with state 4
      debug[9:07:16,343]: Response with content-type: text/xml;charset=UTF-8
      debug[9:07:16,343]: Full response content: <?xml version="1.0"?> <html xmlns="http://www.w3.org/1999/xhtml"><head><title></title><link class="component" href="/ProjectTicket/a4j/s/3_3_0.GAorg/richfaces/renderkit/html/css/basic_classes.xcss/DATB/eAF7sqpgb-jyGdIAFrMEaw__" rel="stylesheet" type="text/css" /><link class="component" href="/ProjectTicket/a4j/s/3_3_0.GAorg/richfaces/renderkit/html/css/extended_classes.xcss/DATB/eAF7sqpgb-jyGdIAFrMEaw__" media="rich-extended-skinning" rel="stylesheet" type="text/css" /><script src="/ProjectTicket/a4j/g/3_3_0.GAorg.ajax4jsf.javascript.PrototypeScript" type="text/javascript"> </script><script src="/ProjectTicket/a4j/g/3_3_0.GAorg.ajax4jsf.javascript.AjaxScript" type="text/javascript"> </script><script src="/ProjectTicket/a4j/g/3_3_0.GAorg/richfaces/renderkit/html/scripts/events.js" type="text/javascript"> </script><script src="/ProjectTicket/a4j/g/3_3_0.GAorg/richfaces/renderkit/html/scripts/utils.js" type="text/javascript"> </script><script src="/ProjectTicket/a4j/g/3_3_0.GAorg/richfaces/renderkit/html/scripts/json/json-dom.js" type="text/javascript"> </script><script src="/ProjectTicket/a4j/g/3_3_0.GAorg/richfaces/renderkit/html/scripts/scriptaculous/effects.js" type="text/javascript"> </script><script src="/ProjectTicket/a4j/g/3_3_0.GAorg/richfaces/renderkit/html/scripts/jquery/jquery.js" type="text/javascript"> </script><script src="/ProjectTicket/a4j/g/3_3_0.GAorg/richfaces/renderkit/html/scripts/JQuerySpinBtn.js" type="text/javascript"> </script><script src="/ProjectTicket/a4j/g/3_3_0.GAorg/richfaces/renderkit/html/scripts/calendar.js" type="text/javascript"> </script><link class="component" href="/ProjectTicket/a4j/s/3_3_0.GAorg/richfaces/renderkit/html/css/calendar.xcss/DATB/eAF7sqpgb-jyGdIAFrMEaw__" rel="stylesheet" type="text/css" /><script src="/ProjectTicket/a4j/g/3_3_0.GAorg/richfaces/renderkit/html/scripts/skinning.js" type="text/javascript"> </script></head><body><span id="zeiten:testdate">Wed Feb 11 09:07:16 CET 2009</span><input id="zeiten:inputstart" type="text" name="zeiten:inputstart" onkeyup="A4J.AJAX.Submit('_viewRoot','zeiten',event,{'similarityGroupingId':'zeiten:j_id16','parameters':{'zeiten:j_id16':'zeiten:j_id16'} ,'actionUrl':'/ProjectTicket/task.seam'} )" /><input id="zeiten:inputEnde" type="text" name="zeiten:inputEnde" onkeyup="A4J.AJAX.Submit('_viewRoot','zeiten',event,{'similarityGroupingId':'zeiten:j_id24','parameters':{'zeiten:j_id24':'zeiten:j_id24'} ,'actionUrl':'/ProjectTicket/task.seam'} )" /><meta name="Ajax-Update-Ids" content="zeiten:testdate,zeiten:inputstart,zeiten:inputEnde" /><span id="ajax-view-state"><input type="hidden" name="javax.faces.ViewState" id="javax.faces.ViewState" value="j_id14" /></span><meta id="Ajax-Response" name="Ajax-Response" content="true" /></body></html>
      debug[9:07:16,343]: Header Ajax-Expired not found, search in <meta>
      debug[9:07:16,343]: search for elements by name 'meta' in element #document
      debug[9:07:16,343]: Find <meta name='Ajax-Update-Ids' content='zeiten:testdate,zeiten:inputstart,zeiten:inputEnde'>
      debug[9:07:16,343]: Find <meta name='Ajax-Response' content='true'>
      debug[9:07:16,343]: Header Ajax-Update-Ids not found, search in <meta>
      debug[9:07:16,343]: search for elements by name 'meta' in element #document
      debug[9:07:16,343]: Find <meta name='Ajax-Update-Ids' content='zeiten:testdate,zeiten:inputstart,zeiten:inputEnde'>
      debug[9:07:16,343]: Update page by list of rendered areas from response zeiten:testdate,zeiten:inputstart,zeiten:inputEnde
      debug[9:07:16,343]: search for elements by name 'script' in element #document
      debug[9:07:16,343]: <script> in response with src=/ProjectTicket/a4j/g/3_3_0.GAorg.ajax4jsf.javascript.PrototypeScript
      debug[9:07:16,343]: Such element exist in document
      debug[9:07:16,343]: <script> in response with src=/ProjectTicket/a4j/g/3_3_0.GAorg.ajax4jsf.javascript.AjaxScript
      debug[9:07:16,343]: Such element exist in document
      debug[9:07:16,343]: <script> in response with src=/ProjectTicket/a4j/g/3_3_0.GAorg/richfaces/renderkit/html/scripts/events.js
      debug[9:07:16,343]: Such element exist in document
      debug[9:07:16,343]: <script> in response with src=/ProjectTicket/a4j/g/3_3_0.GAorg/richfaces/renderkit/html/scripts/utils.js
      debug[9:07:16,343]: Such element exist in document
      debug[9:07:16,343]: <script> in response with src=/ProjectTicket/a4j/g/3_3_0.GAorg/richfaces/renderkit/html/scripts/json/json-dom.js
      debug[9:07:16,343]: Such element exist in document
      debug[9:07:16,343]: <script> in response with src=/ProjectTicket/a4j/g/3_3_0.GAorg/richfaces/renderkit/html/scripts/scriptaculous/effects.js
      debug[9:07:16,343]: Such element exist in document
      debug[9:07:16,343]: <script> in response with src=/ProjectTicket/a4j/g/3_3_0.GAorg/richfaces/renderkit/html/scripts/jquery/jquery.js
      debug[9:07:16,343]: Such element exist in document
      debug[9:07:16,343]: <script> in response with src=/ProjectTicket/a4j/g/3_3_0.GAorg/richfaces/renderkit/html/scripts/JQuerySpinBtn.js
      debug[9:07:16,343]: Such element exist in document
      debug[9:07:16,343]: <script> in response with src=/ProjectTicket/a4j/g/3_3_0.GAorg/richfaces/renderkit/html/scripts/calendar.js
      debug[9:07:16,343]: Such element exist in document
      debug[9:07:16,343]: <script> in response with src=/ProjectTicket/a4j/g/3_3_0.GAorg/richfaces/renderkit/html/scripts/skinning.js
      debug[9:07:16,343]: Such element exist in document
      debug[9:07:16,343]: search for elements by name 'link' in element #document
      debug[9:07:16,343]: <link> in response with src=/ProjectTicket/a4j/s/3_3_0.GAorg/richfaces/renderkit/html/css/basic_classes.xcss/DATB/eAF7sqpgb-jyGdIAFrMEaw__
      debug[9:07:16,343]: Such element exist in document
      debug[9:07:16,343]: <link> in response with src=/ProjectTicket/a4j/s/3_3_0.GAorg/richfaces/renderkit/html/css/extended_classes.xcss/DATB/eAF7sqpgb-jyGdIAFrMEaw__
      debug[9:07:16,343]: Such element exist in document
      debug[9:07:16,343]: <link> in response with src=/ProjectTicket/a4j/s/3_3_0.GAorg/richfaces/renderkit/html/css/calendar.xcss/DATB/eAF7sqpgb-jyGdIAFrMEaw__
      debug[9:07:16,343]: Such element exist in document
      debug[9:07:16,343]: call getElementById for id= org.ajax4jsf.queue_script
      debug[9:07:16,343]: Update page part from call parameter for ID zeiten:testdate
      debug[9:07:16,343]: call getElementById for id= zeiten:testdate
      debug[9:07:16,343]: Replace content of node by replaceChild()
      debug[9:07:16,343]: Update part of page for Id: zeiten:testdate successful
      debug[9:07:16,343]: Update page part from call parameter for ID zeiten:inputstart
      debug[9:07:16,343]: call getElementById for id= zeiten:inputstart
      warn[9:07:16,343]: Node for replace by response with id zeiten:inputstart not found in document
      debug[9:07:16,343]: Update page part from call parameter for ID zeiten:inputEnde
      debug[9:07:16,343]: call getElementById for id= zeiten:inputEnde
      warn[9:07:16,343]: Node for replace by response with id zeiten:inputEnde not found in document
      debug[9:07:16,343]: call getElementById for id= org.ajax4jsf.oncomplete
      debug[9:07:16,343]: Processing updates finished, no oncomplete function to call
      debug[9:07:16,343]: call getElementById for id= ajax-view-state
      debug[9:07:16,343]: Hidden JSF state fields: [object HTMLElement]
      debug[9:07:16,343]: Namespace for hidden view-state input fields is undefined
      debug[9:07:16,343]: search for elements by name 'input' in element span
      debug[9:07:16,343]: Replace value for inputs: 19 by new values: 1
      debug[9:07:16,343]: Input in response: javax.faces.ViewState
      debug[9:07:16,343]: Found same input on page with type: hidden
      debug[9:07:16,343]: Found same input on page with type: hidden
      debug[9:07:16,343]: Found same input on page with type: hidden
      debug[9:07:16,343]: Found same input on page with type: hidden
      debug[9:07:16,343]: search for elements by name 'INPUT' in element span
      debug[9:07:16,343]: Replace value for inputs: 19 by new values: 0
      debug[9:07:16,343]: call getElementById for id= _A4J.AJAX.focus
      debug[9:07:16,343]: No focus information in response


      i can see a error message here
      warn[9:07:16,343]: Node for replace by response with id zeiten:inputstart not found in document

      but dont know why it occurs.

      i'm using seam 2.1.1 GA and RichFaces 3.3.0 GA.

      hope you have an idea why this doesn't work.

      br hugo