Interesting. Yes I am able to reproduce that scenario. At this point you should probably open an SR with your findings so the issue can get into the official fix process.
On the other hand, I think I found a way to workaround the issue by using a custom portlet mode. See the attached project. When importing the attached project make sure you are using the ‘Software AG / Existing CAF Project into workspace’ import wizard as that will fix the project to work in your environment. Alternatively, if you have already imported the project you can fix the issues by right-clicking on the project and selecting the ‘CAF Tools > Repair CAF Project’ menu item which should update the project to work in your environment.
These are the steps to use a custom portlet mode:
- Open the portlet.xml editor and switch to the ‘Configuration’ tab.
- Select the ‘Custom Portlet Modes’ node in the config tree.
- Hit the ‘Add…’ button to add a new portlet mode named ‘popup’.
- Select the ‘Portlets / Demo / Supports / text/html’ node in the config tree and make sure the new ‘popup’ portlet mode is checked in the ‘Support Declarations’ section.
- Select the ‘Portlets / Demo / Init Params’ node in the config tree
- Hit the ‘Add…’ button to add a new init param using these settings:
Name=com.webMethods.caf.faces.portlet.INIT_POPUP
Value=/Demo/popup.view
When switching portlet modes, the CAF framework uses the ‘com.webMethods.caf.faces.portlet.INIT_[MODE_NAME]’ init param value to determine which page to render.
If you view the portlet.xml source code, it should now look something like this:
<portlet>
<portlet-name>Demo</portlet-name>
<portlet-class>com.webmethods.caf.faces.portlet.FacesPortlet</portlet-class>
<init-param>
<name>com.webmethods.caf.faces.portlet.INIT_VIEW</name>
<value>/Demo/default.view</value>
</init-param>
<init-param>
<name>com.webmethods.caf.faces.portlet.INIT_POPUP</name>
<value>/Demo/popup.view</value>
</init-param>
<supports>
<mime-type>text/html</mime-type>
<portlet-mode>view</portlet-mode>
<portlet-mode>popup</portlet-mode>
</supports>
...
Now that your portlet supports a custom portlet mode, you can change the link in your UI to use the ‘popup’ portlet mode instead of specifying the ‘Target View’ property. For example, in your ‘Portlet Url’ control, set the ‘Portlet Mode’ property value to ‘popup’ and remove the value of the ‘Target View’ property.
<control component-type='com.webmethods.caf.faces.component.portleturl.PortletUrlLink' renderer-type='javax.faces.Link'>
<property name='id' value='portletUrlLink' />
<property name='onclick' value=' ' />
<property name='target' value='mywindow' />
<facet name='href'>
<control component-type='com.webmethods.caf.faces.component.portleturl.ExtendedPortletUrl' renderer-type=''>
<property name='id' value='extendedPortletUrl' />
<property name='portletMode' value='popup' />
<control component-type='com.webmethods.caf.faces.component.portleturl.ExtendedParameter' renderer-type=''>
<property name='name' value='key' />
<property name='value' value='10' />
</control>
</control>
</facet>
<control component-type='javax.faces.HtmlOutputText' renderer-type='javax.faces.Text'>
<property name='id' value='htmlOutputText' />
<property name='value' value='Click me to Open the Popup ' />
</control>
</control>
If you inspect the link that opens the popup window it should look something like this (notice the wmp_pm=popup param that specifies the portlet mode).
http://localhost:8585/meta/default/popup_onclick_link___demo/0000005373?key=10&wmp_rt=render&wmp_pm=popup&wmp_tc=5373
updated_PopUP_OnClick_Link.zip (15.1 KB)
#webMethods-BPMS#MWS-CAF-Task-Engine#webMethods