Showing posts with label additional. Show all posts
Showing posts with label additional. Show all posts

Wednesday, March 28, 2012

Extend the AutoComplete Class

Is there a way for me to pass an additional parameter to the webservice that returns an array of strings for use in an autocomplete textbox?

Basically, I'd like to add an ID field that queries a database for strings that match the ID and the prefixText.

It should look something like this:

[WebMethod]publicstring[] GetAllNames(string prefixText,int count,int resourceId)

{

ArrayList filteredList =newArrayList();SqlParameter[] p = {newSqlParameter("@dotnet.itags.org.intResourceId", resourceId),newSqlParameter("@dotnet.itags.org.strName", prefixText)

};

SqlDataReader dr =SqlHelper.ExecuteReader(Common.GetDBConnectionString(),

System.Data.

CommandType.StoredProcedure,"prSelectOrganizationPersonnel", p);while (dr.Read())

{

filteredList.Add(dr[1].ToString());

}

return (string[]) filteredList.ToArray(typeof(string));

}

Thanks!

Hi,

sorry, no way to pass additional parameters using the auto-complete stuff at the moment. I can't count the number of times this requirement has been asked, thus I hope the team will provide an improved auto-complete mechanism in the next release.

Monday, March 26, 2012

Expert Advice

After Raymond helped me solve a problem I was having with the TabContainer I
have decided that I would seek some additional guidance from some experts
out there.

I am dynamically creating tabs based on entries in a database. The content
of the tabs will be the same, the data will change based on the tab.
Therefore, I need to create a template that will display my data for each
tab. I have thought of 2 ways to go about this.

1. Use an additional ASPX page and an iframe to display the tab content. I
have not gotten this work successfully quite yet, not sure what I am doing
wrong as I have used iframes successfully in the past.

function clientActiveTabChanged(sender, args)
{
var activeTab = sender.get_activeTab();
var activeTabId = activeTab.get_element().id;

// Get the CabinetID from the HTML Tab ID
var idIndex = activeTabId.lastIndexOf('_tp')
cabinetId = activeTabId.substr(idIndex, activeTabId.length -
idIndex);
cabinetId = cabinetId.replace('_tp', '');

// Update the frame
ifUpdate.src = 'Cabinet.aspx?CabinetID=' + cabinetId;
}

2. Create the content server side in vb code. Of course this is rather
cumbersome for designing the content.

Any advice would be well received!

Seth

Hi Seth,

My understanding of your issue is that you want to Update(or load) when click on the Tabs. So the data will be changed based on the Tabs. If I have misunderstood, please feel free to let me know.

I think the easiest way for your situation is using UpdatePanels. When user click on different tab, the UpdatePanel inside the tab will be automatically refreshed(loading the data that you expected) by send back a asynchronous post back. To do this , you can do __doPostBack('UpdatePanel.ClientID','') or click a hidden Button inside the UpdatePanel. Good luck! Big Smile

I hope this help.

Best regards,

Jonathan

Saturday, March 24, 2012

Exception in WebResource.axd when PostBack occurs in Firefox

I attempted to add an ATLAS UpdatePanel to a page that can cause an additional page to popup for some user input. When the popup is closed the data entered is, via JavaScript, posted into controls within the UpdatePanel in the calling page via "window.opener..." calls and then a postback is performed in the calling page via a "window.opener.__doPostBack()" call. This works fine in IE but, with Firefox 1.5.0.6 it fails with the following appearing in the Firefox JavaScript console:

Error: [Exception... "Component returned failure code: 0x80040111 (NS_ERROR_NOT_AVAILABLE) [nsIXMLHttpRequest.status]" nsresult: "0x80040111 (NS_ERROR_NOT_AVAILABLE)" location: "JS frame :: http://localhost/TaxBrowser/WebResource.axd?d=UtGnGti3th-E3k4H6R_105-ZnoTFL0xfqNYWKYczTD1WL_MlZnWikLeZY4VJgy1PFU2wuwGL8eNKwcH3DdmeLa2lMRfeto2rgkZK9pto_QA1&t=632870129240000000 :: anonymous :: line 4140" data: no]
Source File: http://localhost/TaxBrowser/WebResource.axd?d=UtGnGti3th-E3k4H6R_105-ZnoTFL0xfqNYWKYczTD1WL_MlZnWikLeZY4VJgy1PFU2wuwGL8eNKwcH3DdmeLa2lMRfeto2rgkZK9pto_QA1&t=632870129240000000
Line: 4140Same problem...

I'll cry with you...Crying

Hi,

It's an old post, but I have the same problem.

Did you find an explanation ? What did you do to avoid that error ?

Thank's.

Gilles


It's not so old... The explanation... I send a e-mail to one of the Atlas developers so we could know something... if they know this, if it will be fixed in next release, blablabla... Nobody answered...

To avoid the error... i remove the atlas update panel on that page...
I had a similar problem on a page where I added some updatePanels dynamically. I managed to fix the problem by placing the __doPostBack() call inside of a window.setTimeout, as seenhere

Hi

I get the same error with v1.0. And I tried the setTimeout workaround with no success.


I resolved my problem with the setTimeout solution...

Thx man, my problem lied in that the script script did a window.close() directly after __doPostBack...

function doPostBack(e) { window.opener.__doPostBack(\'" + _owner + "\'); window.close(); }
setTimeout('doPostBack()', 0);

...the solution was...

function doPostBack(e) { window.opener.__doPostBack(\'" + _owner + "\'); setTimeout('window.close()', 500); }
setTimeout('doPostBack()', 0);