Uploaded image for project: 'Wicket'
  1. Wicket
  2. WICKET-5690

Hiding AjaxLink by other's component visibility in enclosure causes JS error

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Duplicate
    • Affects Version/s: 6.16.0
    • Fix Version/s: None
    • Component/s: wicket
    • Environment:
      Windows 8.1 64-bit
      JDK 1.6.0_45
      Jetty / WebSphere 8

      Description

      I have an enclosure with AjaxLink and Label. I control the visibility of the enclosure by visibility of the Label.

      		<wicket:enclosure child="myRewardSum">
      			<p class="row">
      				<a wicket:id="rewardsLink" href="#">
      					<strong><wicket:message key="myRewards">[Rewards link text]</wicket:message></strong>
      				</a>
      				<span class="value">
      					<span wicket:id="myRewardSum">[50 CZK]</span>
      				</span>
      			</p>
      		</wicket:enclosure>
      

      When the visibility is resolved as false, I get following error. Changing the control-child to link itself solves the problém so I think that the condition when to bind the listener dosen't count with enclosures.

      Wicket.Ajax: Cannot bind a listener for event "click" on element "rewardsLink1059" because the element is not in the DOM
      Wicket.Ajax.DebugWindow.logError(msg="Cannot bind a listener f...ement is not in the DOM")wicket-...udr6oyc (řádek 130)
      Wicket.Log.error(msg="Cannot bind a listener f...ement is not in the DOM")wicket-...udr6oyc (řádek 232)
      .Event.add/<()wicket-...udr6oyc (řádek 180)
      jQuery.Callbacks/fire(data=[Document /Application/, [function(selector, context)]])jquery-1.11.0.js (řádek 3099)
      jQuery.Callbacks/self.add()jquery-1.11.0.js (řádek 3145)
      jQuery.fn.ready(fn=function())jquery-1.11.0.js (řádek 3379)
      jQuery.fn.init(selector=function(), context=undefined)jquery-1.11.0.js (řádek 2819)
      jQuery(selector=function(), context=undefined)jquery-1.11.0.js (řádek 75)
      .Event.add(element="rewardsLink1059", type="click", fn=function(jqEvent, data), data=null, selector=undefined)wicket-...udr6oyc (řádek 171)
      .Ajax.ajax/<(idx=0, evt="click")wicket-...udr6oyc (řádek 1930)
      .each(obj=["click"], callback=function(idx, evt), args=undefined)jquery-1.11.0.js (řádek 384)
      .Ajax.ajax(attrs=Object { u="./XXrdIQsCca2JfmhojuMQK_...S35cURU7YDKFfEVOnxyQRNg", e=[1], c="rewardsLink1059"})wicket-...udr6oyc (řádek 1908)
      wicket-ajax-jquery-ver-1404896837995.js;jsessionid=1pluxkdxzzgehct98udr6oyc()wicket-...val (2) (řádek 1)
      wicket-ajax-jquery-ver-1404896837995.js;jsessionid=1pluxkdxzzgehct98udr6oyc()wicket-...val (2) (řádek 1)
      Wicket.Ajax.Call.prototype.processEvaluation/evaluate/<(notify=function())wicket-...udr6oyc (řádek 1162)
      FunctionsExecuter/this.processNext/run()wicket-...udr6oyc (řádek 139)
      .proxy/proxy()jquery-1.11.0.js (řádek 556)
      FunctionsExecuter/this.processNext()wicket-...udr6oyc (řádek 154)
      FunctionsExecuter/this.start()wicket-...udr6oyc (řádek 166)
      Wicket.Ajax.Call.prototype.doAjax/jqXHR<.complete(jqXHR=Object { readyState=4, responseText="<?xml version="1.0" enco...aluate></ajax-response>", responseXML=document, více...}, textStatus="success")wicket-...udr6oyc (řádek 699)
      jQuery.Callbacks/fire(data=[Object { channel="0|s", initialize=function(), _initializeDefaults=function(), více...}, [Object { readyState=4, responseText="<?xml version="1.0" enco...aluate></ajax-response>", responseXML=document, více...}, "success"]])jquery-1.11.0.js (řádek 3099)
      jQuery.Callbacks/self.fireWith(context=Object { channel="0|s", initialize=function(), _initializeDefaults=function(), více...}, args=[Object { channel="0|s", initialize=function(), _initializeDefaults=function(), více...}, [Object { readyState=4, responseText="<?xml version="1.0" enco...aluate></ajax-response>", responseXML=document, více...}, "success"]])jquery-1.11.0.js (řádek 3211)
      done(status=200, nativeStatusText="OK", responses=Object { text="<?xml version="1.0" enco...aluate></ajax-response>"}, headers="Content-Type: text/xml;c...tty(8.1.14.v20131031)\r\n")jquery-1.11.0.js (řádek 9325)
      .send/callback(_=readystatechange , isAbort=undefined)

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                bitstorm Andrea Del Bene
                Reporter:
                davesman David Rain
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: