-
Sorry for my last post, Ive not see your last post Yvonne...
I try now.
Thanks
Fabio
Quote:
Originally Posted by
yvonne.milne
Hi Fabio,
For example:
Code:
////////////////////////////////////////////////////////////////
// Event delegate for 'searchpanel' event
proc Customers_section1_searchpanel()
sp_container = createObject("container")
sp_container.addObject("sp_label", "label")
sp_label.move(5, 3, 80, 20)
sp_label.text = "Company Name"
sp_container.addObject("osp_textbox", "textbox")
sp_textbox = osp_textbox
osp_textbox.move(85, 3, 100, 20)
sp_container.addObject("sp_search", "commandbutton")
sp_search.move(190, 3, 60, 20)
sp_search.text = "Search"
sp_search.click = sp_search_handler
sp_container.addObject("sp_clear", "commandbutton")
sp_clear.move(255, 3, 60, 20)
sp_clear.text = "Reset"
sp_clear.click = sp_reset_handler
this.addSearchPanel(sp_container)
this.addProperty("SearchPanel",sp_container) // Add reference to the object as a property
endproc
////////////////////////////////////////////////////////////////
// handlers for the Search Panel
proc sp_search_handler()
Lianja.showDocument("section:section1?action=search&text="+sp_textbox.text)
endproc
proc sp_reset_handler()
Lianja.showDocument("section:section1?action=search&text=")
sp_textbox.text = ""
endproc
Now I can do this:
Code:
oSearchPanel = Lianja.get("Customers.section1").SearchPanel
? oSearchPanel.sp_label.text
or this:
Code:
? Lianja.get("Customers.section1").SearchPanel.sp_label.text
Regards,
Yvonne
-
You can test your code interactively first.
Search panels are typically contained within a section. Why not just have a proc that creates it and you call it giving it the section I'd and oage ID.
If you must write it this way then put some debugging in to see what your code is doing.
-
Thanks Barry, in fact, is what I always try to do, with the debugger and interactive.
Unfortunately it is not so "simple" as with VFP, where intelisense could suggest the name of the objects .. Until the 2.0 .. or you know whatever you call or go to trial ... or ask to you masters :D
However, there are almost .. then I try to post the complete code, if someone is interested.
ciao
Fabio
-
Ok, in App builder, all work fine.. but in App Center, no.
Code:
sp_container.addObject("sp_clear", "commandbutton")
sp_clear.move(500, 3, 60, 20)
sp_clear.text = "Reset"
sp_clear.click = sp_reset_handler
// this.addSearchPanel(sp_container)
oActiveSection.addSearchPanel(sp_container)
// this.addProperty("SearchPanel",sp_container) // Add reference to the object as a property
oActiveSection.addProperty("SearchPanel", sp_container) // Add reference to the object as a property
endproc
////////////////////////////////////////////////////////////////
// handlers for the Search Panel
proc sp_search_handler()
////////////////////////////////////////////////////////////////
private sp_mainTable, sp_comboCondition, sp_combo, sp_textbox
sp_mainTable = ""
sp_comboCondition = ""
sp_combo = ""
sp_textbox = ""
dialog box "sp_search_handler"
oActivePage = lianja.activepage
ActicePage = oActivePage.id
oActiveSection = Lianja.get(ActicePage).activesection
sp_mainSection = oActiveSection.id
the row:
oActivePage = lianja.activepage
give error...
how to do?
thanks
Fabio