Hi Andrew,

I tried to do it that way originally too.  It doesn't work, because ND
will not let an HREF send the value of a hidden field (at least thru
the studio interface).  But, it _can_ send the value of a page session
object.  So, in addition to putting the value into the hidden field,
also put it into a page session object.  Then setup the HREF to send
the page session object to the next page.

Only caveat (and I've not tested this to make sure it is truly
necessary) is that you have to be sure you set the value of the page
session object _before_ the HREF is displayed (ie. HTML is generated).
Seems to me that if you don't the HREF will encode whatever value
happens to be in the page session object at the time (which could be
anything, like the value from a previous web event).

Say something like so (untested):

   //[[SPIDER_EVENT<hrTest_onBeforeDisplayEvent>
   public int hrTest_onBeforeDisplayEvent(CSpDisplayEvent event)
   {
      putPageSessionObject("sesPagWebSite", new CSpString(webSite));
      return (PROCEED);
   }
   //]]SPIDER_EVENT<hrTest_onBeforeDisplayEvent>

Also, depending on your page, it might be possible to get rid of the
hidden field.  Hiddens are only useful if you're submitting a page
via a FORM (i.e. with buttons).

Later,
Ryan

Andrew Choi wrote:
> 
> I am very new user of ND. I am trying to understand some codes written by ND5.
> 
> In a ND page, there are one HREF and Hidden tag. When user click the href, the ND 
>page open a new browser with an information in Hidden tag.
> The Hidden tag has URL address, so HREF can open the new browser.
> The paroblem that I am in is "How  the HREF to know the Hidden tag", because I 
>couldn't find anything that can explain the link.
> 
> The code is that
> 
> this_onBeforeDisplayEvent
> {
>    :
> webSite = "URL Address"
>    :
>  }
> 
> hrTest_onBeforeHtmlOutputEvent
> {
>    :
> CSpHref test = (CSpHref) getDisplayField("hrTest");
>        test .setHtmlText (
>        CSpUtil.replaceSubstring (
>                     hr.getHtmlText (),
>                     "SRC=",
>                     "width=\"62\" height=\"64\" border=\"0\" alt=\"This is Web 
>site\" SRC="));
>                 return (PROCEED);
> }
> 
> hfTest_onBeforeDisplayEvent
> {
> CSpHidden csh = (CSpHidden) getDisplayField("hfTest");
>         csh.setValue(new CSpString(webSite));
>         return (PROCEED);
> }
> 
> hrTest_onWebEvent
> {
>         int command = PROCEED;
>         command = doAction(event);
>         return(command);
> }
> 
> Please send me any information for this question.
> 
> Thanks
_________________________________________________________________________

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]

Reply via email to