Umbraco - postbacks caching problemm - umbraco

I'm having a problem with a page I'm developing in umbraco. I'm fairly new to it so would really appreciate some guidance.
the problem seems to be connected to the way umbraco caches pages.
what i have is a stockist locator map (a map of Australia in my case).
from this page, the user can select a region to see stockists within that area.
i have a big fat search button along with some checkboxes for the user to choose what region they want to search in.
when i check say 'Sydney' and hit my search button, all is well. it returns the results i would expect.
but... if i go and click the search button straight away (again) - then the search results disappear.
its almost like umbraco is doing some weird caching thing. I've tried fiddling with the caching settings within the developer area (i.e. 'Cache Period'), but haven't spotted any consistent patterns which shed light on the problem.
oh, another thing - its not executing the page load and pageInit events (when retrieving from the cache).

So when you submit you control without selecting anything, you get empty result. Can this be, that is the logic of a control itself? As I see, it just gives empty result for empty search query.

Can you provide some sample code to demonstrate your implementation?
I've done plenty of Umbraco sites and have rarely found that Umbraco interrupts the normal ASP .Net page lifecycle so I'd be more inclined to guess you have a fault in your code.
Have you tried disabling your custom caching completely to ensure that the issue does not relate to your code?
Does your cache have a param dependency that is being cleared or anything?

Related

Make Jira Issue Collector popup draggable

As the title suggests, I'm looking for a way to make my company's Jira Issue Collector popup draggable. Many users of a particular site we're developing have complained that this feature is overly-cumbersome to use, since one must close the popup to see the underlying page and hence the error that they want to report.
I thought I could simply wrap the generated source in a Kendo UI Window, but alas, there are many supplementary scripts and CSS files that must be loaded for the popup to render correctly. Trying to make the contents of these local to our site has proved to be basically impossible, due to the sheer amount of code they contain, and the fact that the popup is rendered in an iframe.
So how might we be able to go about this? MTIA :-)
Would also like to find an answer to that... I've been trying all the jQuery tricks I could find, to no avail. There are a few feature requests open at Atlassian for similar features, like making the collector window resizable, or making certain fields required. Guess we'll have to wait for a new Jira release ; )

Pagination in html5 javascript SDK

For the pagination I went through the documentation and understood that it is based on a cursor where you have to specify it to navigate back and forth. I have a requirement to navigate to first page and last page. Like you normally see in conventional Jquery or related grids with 4 buttons. Is this achievable? Also I would like to show the current page of the cursor like "Page 2 of 10". Is there anyway I can get this record count in the same response when you query?
Unfortunately, there really isn't a way to get to the last page. What you are describing is generally referred to as "limit,offset paging", which is common in MySQL or Postgres.
Usergrid currently only supports cursors. Due to the nature of the way cursors work, you have to navigate through the results in a linear fashion, starting at the beginning.

Displaying Google results in a frame

Some time in the last year, a tool that I use no longer displays Google search results in one of its frames. I suspect that Google started using JavaScript code to hide itself, if it is being displayed in a frame, which is understandable for most uses.
However, this is a tool that only I use, so I'm not misrepresenting to anyone. I use this tool to research data. One frame has a form where I enter data that I find online. The other frame has the Google results and the pages they link to. I can see both the data form that I'm working on and the changing search/results side-by-side in one window.
I tried going to an older browser version, but I think they are using JavaScript.
Now I have to right-mouse click "open in a new tab" and then click to the new tab, and then close it, a lot of extra overhead when I'm trying to process this repetitive research over and over.
Any ideas? Confirmations as to what has changed? I suppose I could retrieve the page in PHP, strip out the part that hides the page and then put the page source in the other frame. A bit of a challenge for me.

How do Google opening links in a new window without target attribute?

i wonder how google manages to open external links in a new window/tab without defining target="_blank".
For example in google plus, all external links open in a new window.
I think its some Javascript voodoo but the .js code is obfuscated so i cant really look into.
edit: oh and followup question: why?
Using a framework makes this easy. Just have JavaScript look for links marked rel="external", or another identifier that shows them to be an external link, and dynamically add target="blank". Here's an example using Prototype:
$$('a[rel="external"]').each(function(a) {
a.setAttribute('target', '_blank');
};
It's not beyond reasoning for them to add the target attribute by javascript before allowing the anchor link event to return true.
It's Javascript. You can say:
window.open('http://example.org', '_blank').focus();
But please, don't. Opening links in new windows is almost always the wrong thing to do. Seriously, good uses of this are vanishingly few. If users want a link opened in a new window, they are quite capable of doing that themselves.
Jakob Nielsen was telling people this twelve years ago. Others have taken up the cudgels. The W3C removed the target attribute from HTML 4 because it was such a bad idea. I honestly don't understand how this usage persists. Don't you find it incredibly annoying when a website does this to you? Why would you want to write a website which does this to someone else?
Which brings me to your followup question. Why did Google decide to do this? I have no answer to that, and i am completely and utterly baffled how one of the very biggest, brightest, web companies could make such an elementary mistake. But then, a lot of the Google Plus interface has very poor usability (as in, mostly worse than Facebook poor); i suspect there is an interesting story behind it. Was the project under-resourced, and thus built cheaply on top of a rapid development framework such as GWT? Was it built as a spare time project by a lone wolf with a blind spot for web architecture? Was it driven by strategy wonks who didn't care about getting the technology right? Mystery.

MVC jqgrid Page Navigation When Data is Sorted

I am running a code with ASP .NET MVC jqgrid that populates the grid with data from the database.
The code is taken from :
http://jetmathew.wordpress.com/2011/03/02/asp-net-mvc-2-with-entity-framework-json-jquery-and-jqgrid/
The problem is that when I go to second page and sort the data with any column. It sorts the whole data but takes me to 1st page.
I want to remain on second page with whole sorted data. Is this a bug? And is there anyway around to get things go my way?
The sane thing is happening on all examples on this link as well.
http://www.trirand.com/blog/jqgrid/jqgrid.html
It's not a bug. Think about it, what meaning does the pagenumber have when the sortcolumn changes? IMHO none since you are looking at a different dataset...
What are you trying to achieve here?
edit
Craig Stuntz added Jquery BBQ integration to Jqgrid. This enables url history to jqgrid.
Using this you can take the current page from the querystring.
http://craigstuntz.github.com/jqGrid/
I still stand by my original answer though :)
/Daddy

Resources