Details
Description
The Buttons and Links portlet example in the Component Showcase behaves a bit differently under certain circumstances. Normally in Component Showcase (non-portlet version), you can do the following:
1) Enter a value in the first input text box (e.g. foo)
2) Click one of the submit buttons/links.
3) The resulting update applies the new backing bean value in the bottom area.
4) Click the Reset button to reset the form back to it's default values.
Deployed as a portlet, the example behaves the same way as long as it is the only portlet on the page. If there are other ICEfaces portlets on the page, however, the resulting update from the initial form submission in Step 3 is much bigger than usual (the whole form). This means that the default value of the input text area is no longer "empty" but the first value that was submitted (foo). Clicking the Reset button no longer clears the input text box but resets it back to the new default value of 'foo'.
Subsequent submissions trigger normal-sized updates (ie not the whole form) so the backing bean values are updated but not the form. This means the default value is still 'foo' and the Reset button will reset the input text to 'foo' instead of empty.
1) Enter a value in the first input text box (e.g. foo)
2) Click one of the submit buttons/links.
3) The resulting update applies the new backing bean value in the bottom area.
4) Click the Reset button to reset the form back to it's default values.
Deployed as a portlet, the example behaves the same way as long as it is the only portlet on the page. If there are other ICEfaces portlets on the page, however, the resulting update from the initial form submission in Step 3 is much bigger than usual (the whole form). This means that the default value of the input text area is no longer "empty" but the first value that was submitted (foo). Clicking the Reset button no longer clears the input text box but resets it back to the new default value of 'foo'.
Subsequent submissions trigger normal-sized updates (ie not the whole form) so the backing bean values are updated but not the form. This means the default value is still 'foo' and the Reset button will reset the input text to 'foo' instead of empty.
I tested a sample of the Component Showcase portlets in Liferay 5. The portlets build and deploy and some work but a number of them have the same problem as outlined in the description (ie Buttons and Links in Liferay 6).
The issue is that the first interaction with the portlet leads to a larger than expected DOM update (basically replacing the entire portlet) and this update doesn't reflect the current state on the server. As noted in the subject and description, this only seems to happen if there are 2 or more active portlets on a page. Portlets on a page by themselves appear to work fine.
The result is that the first couple of interactions with the portlet may not work properly. Once the "big" updates are done and the state of the client is back in line with the server, the portlets start to function correctly. Apparently there's something fundamental about the first DOM-diff and update when there are multiple portlets on a page.
The reason that more of the portlets are impacted with Liferay 5, is likely due to the fact that the bridge does not have an API in Liferay 5 for injecting resources into the head so has to use the portlet body.