Reusable WebContainer with internal Controls

  1. 2 weeks ago

    Carl F

    Nov 29 Pre-Release Testers, Xojo Pro Webster, NY USA

    I have several WebPages that will display their own WebContainer. Each occurrence could use another WebContainer that would be placed at the top and inside this WebContainer will be a table and one WebButton

    Lets call the WebContainer at the top the HeaderContainer and the one below that the BodyContainer. The HeaderContainer and BodyContainer is all set and is displayed ion the correct location using EmbedWithin

    Needs for HeaderContainer
    I need to set the WebButton Caption and the WebButton.Action to different values depending on the BodyContainer selected
    WebButton.Action will perform a file download defined in a method contained in BodyContainer
    The filename.ext is defined prior to calling the method contained in BodyContainer

    I have created the HeaderContainer to include:
    Label1 as WebLabel
    Button1 as WebButton
    ButtonActionFileName as type text
    Button1.Action is defined as PDF.Download( ButtonActionFileName )

    Inside the WebPage I detect the Choice.Text of a Item.Name of a WebToolbarMenu to select the correct Item desired
    Then I created a Public Property ds as WebContainer as follows

    ds = New PDF_IDENTIFIER_Container Dim Top_Space_Height As Integer = TextField1.Top + TextField1.Height + Toolbar.Height + 18 Dim Page_Space_Width As Integer = Self.Width - 80 Dim Page_Space_Height As Integer = Self.Height - (TextField1.Height + Toolbar.Height) - 10 ds.EmbedWithin(Self, TextField1.Left + 40, Top_Space_Height, Page_Space_Width, Page_Space_Height) '--- This embeds the Container in the correct location on the WebPage

    IDENTIFIER is a specific name of a desired Container

    Inside New PDF_IDENTIFIER_Container the HeaderContainer is placed as myHeaderContainer with Super = HeaderContainer

    I set myHeaderContainer.Labe1.Text and myHeaderContainer.ButtonActionFileName = "Filename.ext" and that information does set the HeaderContainer values

    I cannot set myHeaderContainer.ButtonAction.Enabled = True when file operations are completed and the file is ready.

    So how do I set myHeaderContainer.ButtonAction.Enabled to be enabled?
    Is there a way to perform a Computed Property to pass and set HeaderContainer.Label1.Text, HeaderContainer.Button1.Caption and potentially HeaderContainer.Button1.Action

    Resolved. Interesting how typing out the definition of need can result in solutions

  2. Carl F

    Nov 30 Pre-Release Testers, Xojo Pro Answer Webster, NY USA

    Resolved. Interesting how typing out the definition of need can result in solutions

or Sign Up to reply!