1. I downloaded the ALI .NET Web Control Consumer and installed the files, but I don't see any new controls in VS.NET. Where are they?
The ALI .NET Web Control Consumer package does not provide any additional ASP.NET controls; it offers support for the existing ASP.NET controls available with VS.NET to operate as a portlet within a portal enviroment.
2. Which dlls do I need to add as references to my project in Visual Studio?
None. All the assembly loading is handled automatically when the HttpModule line is included in your web.config file, as described in the Installation Guide.
3. Do I need to use the 'ReturnToPortal' call to go back to the portal page?
Usually, no. If your portlet performs all its logic on the main portal page, then you will never have to leave the page, so you don't need to return to it. The exception is if you use gatewayed or hosted mode, in which case you can use this call to return to the aggregated page.
4. When do I need to include the 'GetPostBackEventReference(this)' call?
In version 2.2 of the ALI .NET Web Control Consumer, this
call is no longer required. In version 2.1, you only need to include this
call if none of the controls on the page generate an automatic postback.
Controls that generate an automatic postback include any control with
an 'AutoPostBack' property set to true, any LinkButton, or any control
that requires postbacks from links, such as the Calendar. If you are only
using controls that post back like a form and do not use the posting-back
framework (i.e., Button and ImageButton), you must include the GetPostBackEventReference(this)
call. If you are unsure, open your form in a browser and view the HTML
source. If it does not contain a _doPostBack
JavaScript function, you must include the GetPostBackEventReference(this)
call. (Including this call if you do not need it will not cause an error.)
5. Why does my LinkButton work but my Button does not? (v2.1 only)
In version 2.1 of the ALI .NET Web Control Consumer, you
must include the ptrender="true"
attribute in the Button control.
6. What's going on with my stylesheet link; it's been replaced with some JavaScript? (Version 2.1: Why do I lose my custom style sheet when the portlet posts back?)
The stylesheet must be appended to the main
HTML DOM programmatically, otherwise it will be unloaded upon postback
and omitted upon refresh. Instead of including your stylesheets in the
standard way (<link
type="text/css" rel="stylesheet" href="http://portal-img.plumtree.com/ptimages/plumtree/common/public/css/mainstyle-en.css"/>
), the filter rewrites the link and appends
it to the page using JavaScript, as shown below. (In version 2.1, you
must use JavaScript to reference the stylesheet, as shown below.)
<script
type="text/javascript">
var stylesheetLink = document.createElement('link');
stylesheetLink.type = 'text/css';
stylesheetLink.href = 'http://portal-img.plumtree.com/ptimages/plumtree/common/public/css/mainstyle-en.css';
stylesheetLink.rel = 'stylesheet';
document.getElementsByTagName('head')[0].appendChild(stylesheetLink);
</script>
7. I want to run a custom JavaScript function as soon as my portlet refreshes itself. How do I call my function when this happens?
In version 2.2 of the ALI .NET Web Control Consumer, simply call your function from an inline piece of script as shown below.
<script language="javascript">myFunction();<script>
In version 2.1, you must register your function for the portlet's rerender event as described below (question 8).
8. I want to run a custom JavaScript function as soon as another portlet refreshes itself. How do I call my function when this happens?
Register your function for the portlet's rerender event. This can be done with the following JavaScript call, where $$PORTLET_ID$$ is the ID for the portlet for which to listen:
document.PCC.RegisterForEvent(document.PCC.WindowEventURN, "rerender.$$PORTLET_ID$$", myCustomFunction);
9. I have a user control (ascx) that breaks the Web Control Consumer when I place it on a page. What's going on?
The ASP.NET Framework v1.1.4322.573 has a bug that drops the ALI .NET Web Control Consumer in certain scenarios. Upgrade to v1.1.4322.929, addressed in Microsoft KB Article 824692: http://support.microsoft.com/default.aspx?scid=kb;en-us;824629.
10. I would like my portlet to refresh periodically to keep its data up to date. How do I do this?
In version 2.2 of the ALI .NET Web Control Consumer, simply call the postback function from a timeout (the code below specifies a 10msec timeout):
<script language="javascript">setTimeout(10, "__doPostBack('','')");<script>
In version 2.1, you must create a few simple functions: one to postback, one to wait and then call the posting back function. Register the second function for the portlet's rerender event and then call it directly to set it going, as shown in the code sample below, where $$PORTLET_ID$$ is the ID for the portlet for which to listen
function postMe_$$PORTLET_ID$$, () { __doPostBack('','');}
function waitThenPostMe_$$PORTLET_ID$$, () {setTimeout(postMe_$$PORTLET_ID$$, 10);}
document.PCC.RegisterForEvent(document.PCC.WindowEventURN, "rerender.$$PORTLET_ID$$", waitThenPostMe_$$PORTLET_ID$$);
waitThenPostMe_$$PORTLET_ID$$;
11. Looking at the HTML source, there is no __doPostBack function. Where did it go? (v2.2)
In version 2.2 of the ALI .NET Web Control Consumer, this function is now completely stripped out. Instead, there is a corresponding function in the included JavaScript file that allows buttons to post back even though they do not create the function itself.
12. My page that uploads files is not working - it always jumps out the portal. How can I upload files? (v2.2)
File upload cannot be done within the page, so in-page refresh is disabled for any multi-part forms. For these forms, you must redirect back to the aggregated page manually or perform the upload in a popup window.
12. I do not want the filter to operate on page X. Is it possible to disable it for this page? (v2.2)
Add the following call to your code to disable the filter for the current request:
Context.Items["PTWC:EnableFilter"] = false;