Welcome to Pintexx Forum Sign in | Join | Faq

pinTab

Started by tiobst at 07-12-2006 3:26 . Topic has 2 replies.

Print Search
Sort Posts:    
   07-12-2006, 3:26
tiobst is not online. Last active: 12.07.2006 11:43:14 tiobst

Top 500 Posts
Joined on 07-12-2006
Posts 2
Call API from server side dropdownlist control
Reply Quote

I need to call a function on a tab item page from a server side asp dropdownlist SelectedIndexChanged event on the main page.  I have used some of the code from the evaluation examples but have not gotten it to work.

On the main page:

There is a call button defined as follows:

function call() { var item = __objPinTab1.getTabItemByIndex(4); item.call("updateplans()"); }

<INPUT id="callbutton" type="button" value="Call" onclick="BLOCKED SCRIPT call()" style="Z-INDEX: 103; LEFT: 33px; POSITION: absolute; TOP: 504px"
   Height="30" Width="102">

The dropdownlist SelectedIndexChanged event has the following to click the call button:

System.Web.HttpContext.Current.Response.Write("<SCRIPT LANGUAGE=""JavaScript""defer>" & vbCrLf)
System.Web.HttpContext.Current.Response.Write("document.getElementById('callbutton').click();" & vbCrLf)
System.Web.HttpContext.Current.Response.Write("window.document.forms(0).submit();" & vbCrLf)
System.Web.HttpContext.Current.Response.Write("</SCRIPT>")

...

When I change the dropdownlist, I get the following error:

__objPineTab1 is null or not an object

I am sure the problem is due to server vs. client side processing, but I need to be able to call a function on the tab item page from a change in the dropdownlist.  The dropdownlist is also performing other functions other than calling the call button.

Thanks for your help.

 

 

 

 

 


   Report 
   07-12-2006, 3:53
tiobst is not online. Last active: 12.07.2006 11:43:14 tiobst

Top 500 Posts
Joined on 07-12-2006
Posts 2
Re: Call API from server side dropdownlist control
Reply Quote

I think I came up with a solution.  In the main page load I added:

ddlGroup.Attributes.Add("OnChange", "call();")

to call the function directly instead of using the call button.


   Report 
   07-13-2006, 9:01
Pintexx Support is not online. Last active: 12.01.2012 07:36:39 Pintexx Support

Top 10 Posts
Joined on 08-30-2005
Posts 1.910
Re: Call API from server side dropdownlist control
Reply Quote

Hi,

your code is
var item = __objPinTab1.getTabItemByIndex..

The error message says:
__objPineTab1 is null or not an object

Is the control name PinTab1 or PineTab1 ?

I don't think that this will work:
System.Web.HttpContext.Current.Response.Write("<SCRIPT LANGUAGE=""JavaScript""defer>" & vbCrLf)
System.Web.HttpContext.Current.Response.Write("document.getElementById('callbutton').click();" & vbCrLf)
System.Web.HttpContext.Current.Response.Write("window.document.forms(0).submit();" & vbCrLf)
System.Web.HttpContext.Current.Response.Write("</SCRIPT>")

It seems that this code is executed after loading the page ?

I would suggest to add a HTML dropdown to the page and use the onchange event to call "call".

Regards,
Hans-Peter


   Report 
Pintexx Forum » Developer Produ... » pinTab » Call API from server side dropdownlist control