Results 1 to 3 of 3

Thread: How can I add objects to a custom section?

  1. #1

    How can I add objects to a custom section?

    Hi,

    I have created a class based on a section. Like so.

    define class contTopStatusBar as container
    layout = "vertical"
    fixedheight = 40
    backcolor = "white"
    enddefine
    This works fine.

    However, I want the class to have certain UI objects in it by default.

    But I can't seem to get that working.

    I have tried different ways to get this working. Does "this" work in class based on container?
    define class contTopStatusBar as container
    layout = "vertical"
    fixedheight = 40
    backcolor = "white"
    this.addObject("buttonTest","commandbutton")

    enddefine
    Thanks.

    Herb

  2. #2
    Lianja Team yvonne.milne's Avatar
    Join Date
    Feb 2012
    Location
    Berkshire, UK
    Posts
    1,842
    Hi Herb,

    Try this:

    Code:
    //
    // Lianja custom section for page "page1" section "section1"
    //
    
    define class page1_section1 as section
    enddefine
    define class contTopStatusBar as container
            layout = "vertical"
            fixedheight = 40
            backcolor = "white"
    	add object buttonTest as commandbutton
    
    enddefine
    
    proc page1_section1 
    	page1_section1 = createobject("page1_section1")
    	page1_section1.addobject("cont1", "contTopStatusBar")
    	cont1.buttontest.caption = "Hello"
    	page1_section1.addobject("cont2", "contTopStatusBar")
    	cont2.buttontest.caption = "World"
    return page1_section1
    Regards,

    Yvonne

  3. #3
    Thats's perfect Yvonne!!!

    This works.

    define class herbButton as commandbutton
    proc click()
    Lianja.showMessage("Button was clicked")
    endproc


    enddefine

    define class contTopStatusBar as container
    layout = "vertical"
    fixedheight = 40
    backcolor = "white"
    add object buttontest as herbButton

    enddefine



    proc page1_section1
    page1_section1 = createobject("page1_section1")

    page1_section1.addobject("cont1", "contTopStatusBar")
    cont1.buttontest.caption = "Hello"
    page1_section1.addobject("cont2", "contTopStatusBar")
    cont2.buttontest.caption = "World"


    return page1_section1

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