0

I am trying to add an onShow event to a Mobile Page Heading as per p. 326 oF the XPages Extension Library book.

My code is as follows :-

<xe:djxmHeading id="djxmHeading1" back="All Areas" moveTo="byArea">
<xe:this.label><![CDATA[#{javascript:param.get("Rep")}]]></xe:this.label>
    <xp:this.onShow>
        <![CDATA[#{javascript:sessionScope.put("RepName", param.get("Rep"))}]]>
    </xp:this.onShow>
</xe:djxmHeading>

which looks similar to the example in the book. But I'm getting the following error:

Unknown property this.onShow. It is not defined on tag xe:djxmHeading.

Any ideas what I'm doing wrong?

Thanks

Martin Perrie
  • 398
  • 5
  • 16

2 Answers2

2

hhmm, this may have been removed.

You can very easily achieve something similar with something like:

<xe:djxmHeading id="djxmHeading1" back="All Areas" moveTo="byArea">
    <xe:this.label><![CDATA[#{javascript:
        sessionScope.put("RepName", param.get("Rep"));
        return param.get("Rep");
    }]]></xe:this.label>
</xe:djxmHeading>

This will allow you to compute something before the heading is shown

Simon McLoughlin
  • 8,293
  • 5
  • 32
  • 56
  • Thanks Simon - that does the trick. Could it be related to version of the ExtLib I have installed? – Martin Perrie Jun 29 '12 at 07:59
  • no im using the latest and it seems to be gone, I no it was there at one point alright – Simon McLoughlin Jun 29 '12 at 08:36
  • Do you think it will be re-instated in a future release? – Martin Perrie Jun 29 '12 at 09:45
  • I work on the team I'll look into it (ha I actually MAY have written that code in the book), wasn't aware of this change. Most likely if it was removed it may be because it didn't work correctly. I'll suggest looking into it, but the above seems to preform exactly the same so I'm not sure if it will happen – Simon McLoughlin Jun 29 '12 at 09:52
  • That seems reasonable - I wonder if there are corrections to the book documented anywhere on IBM Press. Will tweet Paul Hannan on that. Thx again for your help! – Martin Perrie Jun 29 '12 at 10:12
  • Thanks Martin for the heads-up – Paul Hannan Jun 29 '12 at 14:13
0

The onShow property was available in the beta but is not available in the version included with 8.5.3 Update Pack 1. The property is also not available in the public beta of 9.0. Simon's suggestion of an alternative is a good one.

Peter Presnell
  • 380
  • 2
  • 15