Code: Select all
;{- Enumerations / DataSections
;{ Windows
Enumeration
#Window_0
EndEnumeration
;}
;{ Gadgets
Enumeration
#Web_0
EndEnumeration
;}
Define.l Event, EventWindow, EventGadget, EventType, EventMenu
;}
Procedure OpenWindow_Window_0()
If OpenWindow(#Window_0, 450, 200, 400, 400, "Window_0", #PB_Window_SystemMenu|#PB_Window_SizeGadget|#PB_Window_MinimizeGadget|#PB_Window_TitleBar)
WebGadget(#Web_0, 15, 30, 360, 200, "")
EndIf
EndProcedure
Procedure NavigationCallback(Gadget,URL$)
CallDebugger
If FindString(URL$,":",1)>0
MessageRequester("",URL$)
EndIf
;ProcedureReturn #True
EndProcedure
OpenWindow_Window_0()
lookup$=""
lookup$+"<select name="+Chr(34)+"Base Currency"+Chr(34)+">"
lookup$+" <option selected value="+Chr(34)+"AUD"+Chr(34)+">Australia Dollar AUD</option>"
lookup$+" <option value="+Chr(34)+"USD"+Chr(34)+" onClick='window.location=" + #DQUOTE$ +":USD" + #DQUOTE$ + "'>USA Dollar USD</option>"
lookup$+" <option value="+Chr(34)+"GBP"+Chr(34)+">British Pound GBP</option>"
lookup$+" <option value="+Chr(34)+"EUR"+Chr(34)+">Euro EUR</option>"
lookup$+" <option value="+Chr(34)+"NGN"+Chr(34)+">Nigeria Naira NGN</option>"
lookup$+" <option value="+Chr(34)+"GHC"+Chr(34)+">Ghanaian Cedi GHC</option>"
lookup$+" <option value="+Chr(34)+"TZS"+Chr(34)+">Tanzanian Shilling TZS</option>"
lookup$+" <option value="+Chr(34)+"XOF"+Chr(34)+">CFA Franc XOF</option>"
lookup$+"</select>"
txt.S=GetGadgetItemText(#Web_0,#PB_Web_HtmlCode)
SetGadgetItemText(#Web_0,#PB_Web_HtmlCode,lookup$)
;{- Event loop
Repeat
SetGadgetAttribute(#Web_0, #PB_Web_NavigationCallback, @NavigationCallback())
Event = WaitWindowEvent()
Select Event
; ///////////////////
Case #PB_Event_Gadget
EventGadget = EventGadget()
EventType = EventType()
If EventGadget = #Web_0
EndIf
; ////////////////////////
Case #PB_Event_CloseWindow
EventWindow = EventWindow()
If EventWindow = #Window_0
CloseWindow(#Window_0)
Break
EndIf
EndSelect
ForEver
;
;}
Please I need help. What is the "onClick" function that I need to use to trigger the NavigationCallback function on my test code, when I click on the Drop-Down-List option "USA Dollar USD" on the WebGadget.
What I'm expecting to happen is that when I choose/click on the option "USA Dollar USD" I will get a message requester showing me the URL$ string that is passed to the Callback function, but I'm not getting anything!
Any help or advice would be greatly appreciated!