>I understand the following voodoo example of having a push button change the text of a textbox.
>
>
>***Straight from the voodoo docs. Works fine. Keeps displaying same
>***page with different text.
>LOCAL loPage
>loPage = NewObject("WCPage","voodoo.prg")
>loPage.NewObject("txtDemo","WebTextbox","voodoo.prg")
>loPage.txtDemo.Label = "Example Text: "
>loPage.NewObject("cmdTest","DemoButton","shop_wizards.prg")
>loPage.DoEvents()
>Response.Write(loPage.Render())
>
>DEFINE CLASS DemoButton AS WebButton OF Voodoo.prg
> Caption = "Click Me!"
>
> FUNCTION Click
> IF NOT THIS.Parent.txtDemo.Value = "This rocks!"
> THIS.Parent.txtDemo.Value = "This rocks!"
> ELSE
> THIS.Parent.txtDemo.Value = "How about this?"
> ENDIF
> ENDFUNC
>ENDDEFINE
>
>
>However, what I want to do in the click() method of the button is to run some process, and then display a totally different page to the user. I must be missing something but how do you do this with the voodoo controls?
One way would be to run your process, and then navigate to another page. Or navigate first, and do the processing in the OnLoad() of the next page. Here's the code that does that:
<
>FUNCTION Click
THIS.Page.Navigate("NextPage.Voodoo")
ENDFUNC<
>
Another way would be to use a WebPageFrameContainer control with two pages (and no tabs, so the pages aren't really visible). You can then simply switch to the second page (x.ActivePage = 2), which shows the result after processing.
Regards,
Markus