Mats,
Thanks for the message. Your logic works great!!!!
One more question if you don't mind, now that I have this new
field, in my case it is a hidden, do you know how I set values
within this field at a later time. (i.e. it gets initialized to
something in the onBeforeInitEvent, but I would like to set
certain values later)?. Similiar to what one would do in an
onBeforeDisplayEvent.
Any suggestions?
Thanks,
Shawn Keller
Mats Svensson <[EMAIL PROTECTED]> wrote:
>How about this (it actually works in ND 4.1.3.8, JDK1.1.8, NT4.0SP4):
>
>1) Every page that subclasses your page must have
>[[SPIDERINCLUDE
>SRC=C:\NetDynamics\NetDynamics40\Projects\yourProject\yourPage.html]]
>somewhere in the html code. This is a reasonable assumption since they need to
>place your output somewhere.
>
>In yourPage.html you can have any combination of HTML and spider tags you
>want, but you need to handle the tags somehow.
>
>2) Assume you only have **stInclude** in yourPage.html.
>3) Create a page pgAnything in the Studio that subclasses com.mydomain.myPage
>When pgAnything is displayed, **stInclude** will be replaced by the
>string 'defaultValue'.
>4) com.mydomain.myPage is included below.
>I'll explain the code on request. (Something for the
>obfuscated NetDynamics/Java contest :-)
>
>///////////////////////////// com.mydomain.myPage
>package com.mydomain;
>
>import spider.visual.CSpPage;
>import spider.visual.CSpStaticText;
>import spider.session.CSpString;
>import spider.event.CSpInitEvent;
>import spider.event.ISpInitListener;
>import spider.event.adapters.CSpFileBasedEventAdapter;
>
>public class myPage extends CSpPage {
> {
> addInitListener((ISpInitListener) new CSpFileBasedEventAdapter () {
> public int onBeforeInitEvent(CSpInitEvent event) {
> myPage.this.addChild(
> new CSpStaticText(
> "stInclude",
> myPage.this,
> null, // No bound data field
> "aLabel",
> "", // Userdefined HTML
> "", // ExtraHTML
> new CSpString("theValue"),
> false, // automatically read data
> new CSpString("defaultValue"),
> false // HTML Escaping
> )
> );
> return spider.CSpFileBased.PROCEED;
> }
> });
> }
>}
>
>
_________________________________________________________________________
For help in using, subscribing, and unsubscribing to the discussion
forums, please go to: http://www.netdynamics.com/support/visitdevfor.html
For dire need help, email: [EMAIL PROTECTED]