Sunday, 27 March 2011

Workaround for a broken 'Home' button on iPhone

My iPhone has been subject to some rather hefty treatment over the past 2 years and today I went about giving it a bit of a face-lift.  This included purchasing a new LCD display, back cover and volume switch from ebay for a total of around £25.  Not bad!

However, for the last 6 months (after dropping the phone in the sea) the 'Home' button has completely stopped working.  This has meant that each time I want to switch application I need to reboot the entire phone.  Nightmare!  If your phone is jail broken, have a search for mQuickDo in Cydia which will allow you to swipe across the favourite buttons to mimic the home button functionality.  This didn't work for me, my Cydia is broken.

So.. Here is the workaround which I am happy with.  Not ideal but MUCH better than a full reboot each time!

1. Ensure you have your phone set to require a pin each time you swipe to log in
2. Lock the phone using the top button
3. When prompted for you pin, make an emergency call and quickly press cancel.
4. Log in and you will be taken to the home screen.

A phone near enough destroyed - now pretty usable!

Friday, 25 March 2011

Automatically Refreshing an XPage

I've been working on a dashboard style application recently for which users will typically open an XPage and leave it sitting in the background until they flick it open for an update.

The problem with this is that the screen does not automatically refresh and it isn't always easy to our poor users to remember to hit F9 when they want to update.

Therefore, I have made use of the following 2 solutions.  One to reload and entire page and another to reload a particular panel / ID on the XPage via a partial refresh.  Both of these are on a timer setting.

Full Update
<
script type="text/javascript">
setTimeout(function() { window.location.reload(); }, 180000);
</script>
Partial Refresh
<
xp:scriptBlock id="scriptBlock2">
<xp:this.value>
<![CDATA[
setInterval(function() {
XSP.partialRefreshPost("#{id:<ID of panel / ID>}", {
onStart: null,
onComplete: null,
onError: null
})
}, 180000)
]]>
</xp:this.value></xp:scriptBlock>