Note that there are some explanatory texts on larger screens.

plurals
  1. PO@EventListener & IRequestCycle.getResponseBuilder.updateComponent not updating component
    primarykey
    data
    text
    <p>I am having a problem on my application, what I am trying to do is when ever someone changes the field <code>shopStatus</code> on the form to <code>Pass</code>, i want it to update my field <code>shopApprovalDate</code> to be mandatory. I am using the following event listener for this</p> <pre><code>@EventListener(targets="shopStatus", events="onchange") public void onLicenseStatusChange(IRequestCycle cycle) { cycle.getResponseBuilder().updateComponent("shopStatus"); cycle.getResponseBuilder().updateComponent("shopApprovalDateRequired"); cycle.getResponseBuilder().updateComponent("shopApprovalDate"); } </code></pre> <p>this is the html that I am using for this</p> <pre><code>&lt;td valign="center" align="left" class="rightTD" height="30" &gt; &lt;span jwcid="@If" condition="ognl:company.shopStatus == @valueobject.ShopStatus@Pass" renderTag="literal:false"&gt; &lt;input jwcid="shopApprovalDateRequired@CustomDatePicker" disabled="ognl:disabled || isShopApprovalDateDisabled()" value="ognl:company.shopApprovalDate" displayName="message:company.shopApprovalDate" validators="validators:maxDateToday,required" /&gt; &lt;/span&gt; &lt;span jwcid="@Else" renderTag="literal:false"&gt; &lt;input jwcid="shopApprovalDate@CustomDatePicker" disabled="ognl:disabled || isShopApprovalDateDisabled()" value="ognl:company.shopApprovalDate" displayName="message:company.shopApprovalDate" validators="validators:maxDateToday" /&gt; &lt;/span&gt; &lt;/td&gt; </code></pre> <p>The thing is that, if I change the <code>shopStatus</code> to <code>Pass</code> nothing happens, but if i save the page and reload the page, then the <code>shopApprovalDate</code> is set to mandatory so the html code is working, it is like the <code>@EventListener</code> is not updating <code>shopApprovalDate</code> when <code>shopStatus</code> is changed! I have debugged through the code and it is hitting the listener but nothing is happeneing</p> <p>Does anyone have any ideas on this?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload