Saturday, December 15, 2012

Never forget resetActionListener when there is rollbackTransaction action


Whenever you put a button (any action component) to rollbackTransaction make sure you have resetActionListener also.. Usually when you drag and drop rollback operation as action component this is created by default. But in the scenarios where you add action component separately you have to put it manually..

Many times I missed to put resetActionListener inside my button and the application data looks very odd when I click Cancel button... And I spent hours to debug the issue and found that resetActionListener  is missing..

<af:commandToolbarButton text="#{viewcontrollerBundle.DISCARD_CHANGES}" id="ctb2"
                                                   icon="/images/Discard.png" accessKey="Z"
                                                   actionListener="#{ManagedBean.rollbackChanges}" immediate="true">
         <af:resetActionListener/>
</af:commandToolbarButton>

So never forget(saying to myself) resetActionListener and rollbackTransaction!!

1 comment:

  1. I had no idea Oracle had such a wide range of educational products and services. Your blog opened my eyes to the possibilities and benefits of integrating Oracle into educational institutions. Fusion Financial Training In Hyderaba

    ReplyDelete