Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Process a request
Message
 
À
11/12/2001 23:31:15
Jerry Tovar
Dana Corporation Dana It
Maumee, Ohio, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Produits tierce partie
Divers
Thread ID:
00593092
Message ID:
00593111
Vues:
26
>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




Markus Egger
President, EPS Software Corp
Author, Advanced Object Oriented Programming with VFP6
Publisher, CoDe Magazine
Microsoft MVP since 1995
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform