Page 2 of 2 FirstFirst 12
Results 11 to 14 of 14

Thread: CommandButton code

  1. #11
    Senior Member
    Join Date
    Feb 2012
    Location
    Rome - Italy
    Posts
    1,893
    Sorry for my last post, Ive not see your last post Yvonne...

    I try now.

    Thanks
    Fabio
    Quote Originally Posted by yvonne.milne View Post
    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

  2. #12
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    7,148
    Blog Entries
    22
    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.
    Principal developer of Lianja, Recital and other products

    Follow me on:

    Twitter: http://twitter.com/lianjaInc
    Facebook: http://www.facebook.com/LianjaInc
    LinkedIn: http://www.linkedin.com/in/barrymavin

  3. #13
    Senior Member
    Join Date
    Feb 2012
    Location
    Rome - Italy
    Posts
    1,893
    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

    However, there are almost .. then I try to post the complete code, if someone is interested.

    ciao
    Fabio

  4. #14
    Senior Member
    Join Date
    Feb 2012
    Location
    Rome - Italy
    Posts
    1,893
    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

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Journey into the Cloud
Join us