Topic: specifying form variable
Karamasoft Support Forums

Page 1 of 1 (8 items)

Posted by twknox on 04-01-2009 12:28 PM
We are attempting to use the UltimateTabStrip control from inside of a portal.  This portal will append a value to the current form name when rendered to allow for multiple portlets on a page.  For example if we specify <form id="form1"... it becomes changed to <form id="form1_123"...

The tabstrip control is trying to use "document.form1..." to access the form.  There are a few javascript variables rendered by the portal.  These are:
   theForm = document.form1_123; 
   portletForm = document.forms['form1_123];  

Is there a way to change UltimateTabStrip to use these instead?

Thanks in advance!

Posted by Karamasoft on 04-01-2009 2:03 PM

UltimateTabstrip does not hard-code document.Form1 dynamically determines the client-side ID of the form containing the UltimateTabstrip control renders it as a parameter to the InitiateUltimateTabstrip method on the client-side. It sounds like your portal might be changing the ID of your form, after the UltimateTabstrip control is initialized on the server-side. When exactly and how does your form change the id from form1 to form1_123?

Posted by twknox on 04-02-2009 3:58 AM

The value is changed as the form is rendered.  It is probably done by this module, which is required to run inside the portal:

   <!-- AquaLogic .NET Web Controls Support -->
   <add type="Com.Plumtree.Remote.Loader.TransformerProxy, AquaLogic.WCLoader, Version=, Culture=neutral, PublicKeyToken=d0e882dd51ca12c5" name="PTWCFilterHttpModule"/>

Posted by twknox on 04-02-2009 12:39 PM
Any ideas?  Thanks.

Posted by Karamasoft on 04-02-2009 1:11 PM
If this HttpHandler is part of a third-party tool, you may want to contact them to see how they render the form id different than the ClientID of the form of your page. Otherwise, you can try debugging your app to see why the ClientID property of your form returns form1 instead of form_123. UltimateTabstrip depends on the client-side id of your form element to keep the state of the tabstrip after the page postbacks.

Posted by jthompson on 04-03-2009 7:17 AM
I am working on this with Tom.  Specifically what the Aqualogic portal does is rewrites the html as it processes it to avoid any conflicts of having multiple portlets on the same page with the same form id.  So, at run time, the form id is form1.  It is then renamed to form1_123 as it is  processed by the portal.  We do know at run time what it will be renamed to.  Is there any way to tell the control what form name to use? 

If not, can we write some javascript at the bottom of the page to tell the control the correct form id?


Posted by Karamasoft on 04-03-2009 11:34 AM
1. Add OnClientTabstripLoad to your UltimateTabstrip control as follows:

<kswc:ultimatetabstrip id="UltimateTabstrip1" runat="server" Scheme="MSDN" ActiveTabIndex="4" OnClientTabstripLoad="TabstripLoad">

2. Add the following client-side script block to the HEAD section of your page:

<script type="text/javascript">
function TabstripLoad(sender) {
var tabstripObj = sender;
tabstripObj.utsg9 = tabstripObj.utsg9.replace('Form1', 'Form1_123');

3. Note that the replace method in JavaScript is case sensitive. Make sure that you set 'Form1' and 'Form1_123' to the exact form IDs in your page. We added two alert statements for you to check their before/after values.

Posted by twknox on 04-03-2009 11:47 AM
Thanks, this solution works.  Your help is greatly appreciated.