you probably don’t want a ‘Command Button’ control unless you are intending to invoke some other action at the same time you are opening the popup window. I’d recommend an ‘Output > Button’ control instead since it has no other side effects.
You probably want context = ‘form’ for the Portlet URL Script.
Make sure you have an ‘Extended Portlet URL’ control in the ‘Portlet URL’ facet of the ‘Portlet URL Script’ control to specify the target view and parameters.
I’m attaching a simple exported CAF project that you could import into your Designer to see a working example. testapp.zip (14.2 KB)
I followed your sample, and i was able to get the popup with a command button without any issues. But it seems it does not work with a command Link.
My requirement is, i have the custom inbox. When the user clicks the Task id (a command link ) it should open a new window as pop up and display the task details.
I tried to get the pop up from Command Link. I have done the same configurations as i did for the Command Button. However, on clicking the command link, it is not loading the target view , instead it is loading the same window (parent) again as a pop up. I am attaching my CAF project here for your reference
So i am wondering whether or not command link supports popup.
Could you or anyone please weigh in the options here for me please?
I agree that there does seem to be some bug there that is causing the popup window to load the wrong target view. I will file a new bug report to get it investigated further.
You probably don’t want to use a ‘Command Link’ control anyway unless you are intending to invoke some other action at the same time you are opening the popup window. I’d recommend an ‘Portlet > Portlet Simple Link’ control instead since it has no other side effects.
For example, you could paste something like this into your view:
I tried with Portlet Simple Link, It does NOT work as Pop up, it works as a navigation link.
Actually, i could not use your updated_pop-upDemo because it has some differnt runtime look ups so there are some compilation error occurs.
So created a new portlet application and tried there with simple link and done configuration as you suggested. However, it works as a navigation link …not a pop up.
You are pretty close. It looks to me like you are just missing the ‘target’ property on the ‘Portlet Simple Link’ control to specify the name of the window where the link should be opened.
It works, Thanks, but my requirement has not met yet. The Pop up window and the parent (that is the opener of the popup) work as expected when they are invoked with default URL as follows.
When i use this URL, i can open the Popup and when i refresh (by clicking the Browser’s refresh) the parent page(the opener) the parent page refreshes and renders the contents of parent(opener) page without any issues.
But, the situation and output is different when i work with an Alias name for the parent (the opener) page.
I have created an alias for the parent page as follows…
Here the “popup” is the alias name for the parent page.
When i use this URL, i can open the Popup without any issues. However, After opening the popup window, when i refresh (by clicking the browser’s refresh buton) the parent page, the parent page refreshes and renders the contents of Popup window, which is wiered/strange.
I think, i have explained this case clearly. I must to use an alias for the parent window for my requirement.
Is it a bug with Popup stuff or Alias creation?
I am attaching my sample CAF here, Just create a portlet page and alias for it. Open the Parent with alias name, Click the link to open the Popup and then try to refresh the main/parent page, you will get the contents of popup window on the main page.
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:
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.
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).