Hi,
I started work this morning with an idea for a new application. I thought that I’d have another go at trying to build an app in Xpages, but no matter how many times I do this, I always seem to fall at the first hurdle. I try to do something which seems like it should be very simple, but all my experiences of trying to find decent reference documentation for xpages has been absolutely horrible which makes it incredibly frustrating.
I started by trying to make a header for all of my forms. I have a logo to use and had placed it as an image resource on a custom control but unfortunately, the logo is a bit large. No problem, I thought, I can just scale it to 80% using properties, like when using image resources on Forms. But no - there is no percent option for height on an image resource, and the width one scales it to 50% of the page, not of the original image size. Fair enough, I’ll just need to compute the size of the image. Click on the little diamond next to the hight, choose ‘Compute Value’ and ‘Compute on page load’. Right. Now what? I guess I write a bit of script which returns the height of the image. ‘this.height * 0.8’ seems to translate into a height of 0px when previewed as does ‘return this.height * 0.8’. Just using ‘this.height’ as a test seems to work, but I think actually just does nothing. this.height - 10 also does nothing - the image is displayed without any height modification in the style. I’ve tried this.getHeight() * 0.8 (returns 0px), getComponent(‘myLogoName’).height and getComponent(‘myLogoName’).getHeight() both of which result in a Command Not Handled Exception.
How on earth are you supposed to figure out what to write for these computed properties? I’ve googled this every which way I could think of but didn’t come up with any useful documentation. Is there any?
I’ve been going round and round in circles for this for an hour or so now and it’s made me very fed up. I’m probably missing something really simple but it’s completely eluded me so far. I realise I could easily just have modified the original image in a graphics program in 2 seconds, but I can’t stand not being able to figure out how to do this.
If anyone can point me in the right direction to solve this tiny problem, I’d be very grateful, but I’d be even more grateful to be pointed to some good documentation about this sort of thing. I’ve seen blog after blog about building Xpages applications with forms and views and the big stuff, but nothing about these little things.
I’m sorry if this has come across a bit ranty, but I’m so keen to get on board with Xpages and every time I try to get started, I immediately seem to come across something not-quite-standard that I want to do and come up against a brick wall. I’ve been writing Notes/Domino applications for nearly 10 years so knowing what I want to do and not being able to do it is fairly soul-destroying, when I can do ‘classic’ Notes development virtually without thinking about it.
Now for a deep breath and to try and persevere with the actual workings of the app without a logo (massive or otherwise) for the time being.
Emily.