-
15. Re: a4j:commandButton, actionListener, event.data always false
arnieaustin Feb 15, 2016 5:00 PM (in response to michpetrov)Turns out it IS causing the issue! So in this markup:
<a4j:commandButton id="cmdSaveModalCommentEdit"
value="#{messages.getString('application.lbl.cmdSave')}"
actionListener="#{infoPersonCommentEdit.saveListener}"
render="panelModalInfoPersonCommentEdit" execute="@form"
data="#{infoPersonCommentEdit.okToClose}"
oncomplete="if (event.data === true) { #{rich:component('modalInfoPersonCommentEdit')}.hide(); } else { return false; }"
rendered="#{empty infoPersonCommentDTOCDI.id}" >
<f:param name="cid" value="#{javax.enterprise.context.conversation.id}"/>
</a4j:commandButton>
if I remove the rendered part, the dialog closes like it should. Though for the life of me, I have no idea why.
So, what does one do? I only want the save button to appear if the entity is new (as indicated).
-
16. Re: a4j:commandButton, actionListener, event.data always false
liuliu Feb 16, 2016 6:27 AM (in response to arnieaustin)the value on rendered attribute should not be changed on one request. I think the infoPersonCommentDTOCDI.id get a value after the phase application in your case.
to make life easy, you can create something like renderSaveButton, you initiate the renderSaveButton= infoPersonCommentDTOCDI.id==null when you enter the bean.
-
17. Re: a4j:commandButton, actionListener, event.data always false
michpetrov Feb 16, 2016 7:11 AM (in response to arnieaustin)Well for one the popupPanel containing the button is going to be hidden, so the button doesn't need to be unrendered right away. You can also just disable the button (and hide it with CSS if you really have to). I don't know what the buttons do but I'd expect that "save" and "update" are similar operation, do you need two buttons for that?
-
18. Re: a4j:commandButton, actionListener, event.data always false
arnieaustin Feb 16, 2016 7:07 PM (in response to arnieaustin)Yes, the design pattern we follow has a button for an action (save, update, delete, reset, clear, cancel).
This pattern was working FINE with RF 3.x - why is it suddenly BROKEN with 4.x?
This seems like a serious bug to me. After the save listener finishes, the data should be true so the modal closes. Yes, technically, if the panel was to be rendered again that command button wouldn't be rendered afterwards, but it shouldn't matter as it is about to be closed.
Is there no work around for this?
-
19. Re: a4j:commandButton, actionListener, event.data always false
arnieaustin Feb 16, 2016 7:25 PM (in response to arnieaustin)I'm using 4.5.12 right now. I don't recall on which version the project was on prior, but this WAS working.
I noticed that 4.5.13 is out there, but none of the documents tell me what has been fixed/changed.
And the Revision History is woefully incomplete - it ends at 4.2.0?!
-
20. Re: a4j:commandButton, actionListener, event.data always false
michpetrov Feb 17, 2016 4:52 AM (in response to arnieaustin)What revision history? We include release notes with every release, and they can be found on JIRA, GitHub or my release announcements.
The behavior was changed in 4.5, due to reported issues with not skipping unrendered components (https://issues.jboss.org/browse/RF-12654, https://issues.jboss.org/browse/RF-13963).