I have a dialogue with a commandButton, and this is what I'm trying to do:
- Do some Java work
- Update a Primefaces tab
- Make my dialogue box disappear
- Go to that certain tab.
This is the code I'm using:
<p:commandButton value="Submit"
action="<some java work>"
oncomplete="dialogue.hide(); sideTabs.select(1)"
update="<update side tab">
</p:commandButton>
The problem is, this only works once between refreshes. What I mean is, I click the button, and everything works fine-the tab changes to the requested tab, the tab is updated, and the dialogue disappears. But when I click the button again, the requested tab is indeed selected, but isn't properly refreshed until I hit f5. Once I do that, I can click the dialogue button again and the tab will properly refresh again, but once again, only once - until I hit f5 again. So, something like this:
- Click the button -> see 1 item in the tab
- Click the button again -> still see only 1 item in the tab
- Hit f5 -> see 2 items in the tab
- Click the button -> see 3 items in the tab
- Click the button again -> still see 3 items in the tab
- Hit f5 -> see 4 items in the tab etc...
Does anyone have an idea why this is happening? Do I need to add some page refresh mechanism to my commandButton? If so, how is this done? Thanks!!!