checkbox in webListbox?

  1. ‹ Older
  2. 4 years ago

    Brock N

    18 Aug 2015 Pre-Release Testers, Xojo Pro

    @Toni R can have a complete sample source, I have trouble creating what is written!!

    Here's a basic example:
    https://www.dropbox.com/s/t7hpy00tpu0mdwu/EmbedCCinListbox.xojo_binary_project?dl=0

  3. Michel B

    18 Aug 2015 Pre-Release Testers, Xojo Pro

    @Brock N Here's a basic example:
    https://www.dropbox.com/s/t7hpy00tpu0mdwu/EmbedCCinListbox.xojo_binary_project?dl=0

    Works great. Thank you Brock :)

  4. Juan T

    3 Oct 2015 Pre-Release Testers, Xojo Pro

    Hi Brock, how change your sample to embed a webtextfield instead to make a editable cell?

  5. Alexis C

    30 Nov 2015 Pre-Release Testers, Xojo Pro Puerto Rico, USA

    Hi Brock Nash
    can i use webtextbox with same way for edit data on the weblistbox

  6. Brock N

    1 Dec 2015 Pre-Release Testers, Xojo Pro

    @Alexis Cnbsp;Lugo Hi Brock Nash
    can i use webtextbox with same way for edit data on the weblistbox

    Yes you can. You can embed any containerControl. It will be up to your code to manage and destroy them however.

  7. Alexis C

    10 Dec 2015 Pre-Release Testers, Xojo Pro Puerto Rico, USA

    Hi Brock Nash

    i add same code you have but with TextBox but i can no see it on the col 1

    Help
    ------ CellClick
    if cccb <> nil then
    ListBox1.cellPrependControl(cccb, row, 0)
    end
    If mText <> nil Then
    ListBox1.cellPrependControl(mText,row,1)
    End If
    ---------
    on Show

    ListBox1.AddRow
    ListBox1.AddRow

    cccb = new CCCheckBox
    cccb.EmbedWithin(session.CurrentPage, 0, 0, cccb.Width, cccb.Height)
    ListBox1.cellPrependControl(cccb, 1, 0)

    mText = new tTextBox
    mText.EmbedWithin(session.CurrentPage, 0, 0, mText.Width, mText.Height)
    ListBox1.cellPrependControl(mText,1,0)

  8. Oliver O

    16 Mar 2016 Pre-Release Testers, Xojo Pro https://udemy.seminar.pro

    @Brock N Yes you can. You can embed any containerControl. It will be up to your code to manage and destroy them however.

    I'm not familiar with this. What would one have to do to 'destroy' such objects? What is the problem?

  9. Michel B

    16 Mar 2016 Pre-Release Testers, Xojo Pro

    @Oliver O I'm not familiar with this. What would one have to do to 'destroy' such objects? What is the problem?

    Once the container control is embedded, Xojo does not know how to destroy it. That will need to be done in JavaScript.

  10. Alexis C

    28 Mar 2016 Pre-Release Testers, Xojo Pro Puerto Rico, USA

    Hi Brock Nash

    i am using you example project and i add textfield but i can get it to works

  11. 2 years ago
  12. last year

    Tom D

    11 Dec 2018 Pre-Release Testers, Xojo Pro

    @Brock N Here's a basic example:
    https://www.dropbox.com/s/t7hpy00tpu0mdwu/EmbedCCinListbox.xojo_binary_project?dl=0

    Hi Brock,

    I just read trough this thread and downloaded your sample. Pretty neat. I was wondering if you have ever embedded a checkbox in the column heading that would check and uncheck all the checkboxes in that column? If not do you have any advice on how to tackle that? I'm assuming of course that you can embed a container control in a heading?

  13. Brock N

    12 Dec 2018 Pre-Release Testers, Xojo Pro

    @Tom D Hi Brock,

    I just read trough this thread and downloaded your sample. Pretty neat. I was wondering if you have ever embedded a checkbox in the column heading that would check and uncheck all the checkboxes in that column? If not do you have any advice on how to tackle that? I'm assuming of course that you can embed a container control in a heading?

    Look at the cellSelector method above. You should be able to create something similar for the heading, if you use chrome just inspect the DOM for the listbox and figure out the route for the header cell. Jquery/CSS Selectors are an easy thing to learn and then you could literally embed a container anywhere in your app

  14. Tom D

    12 Dec 2018 Pre-Release Testers, Xojo Pro

    Thanks for the tip. Right now I'm struggling to get checkboxes in every cell in a column. The code below doesn't work. If you have any advice on how to create multiple checkboxes and embed them in a column of listbox cells as well as being able to address their values in some indexable way I'm all ears.

    Public Property cccb() as CCCheckBox
    
    Sub Shown() Handles Shown
      ListBox1.AddRow
      ListBox1.AddRow
      ListBox1.AddRow
      ListBox1.AddRow
      
      Dim idx,n As Integer
      n = ListBox1.RowCount - 1
      ReDim cccb(n)
      
      For idx = 0 To n
        cccb(idx) = new CCCheckBox
        cccb(idx).EmbedWithin(session.CurrentPage, 0, 0, cccb(idx).Width, cccb(idx).Height)
        ListBox1.cellPrependControl(cccb(idx), idx, 0)
      Next
    End Sub
  15. Brock N

    12 Dec 2018 Pre-Release Testers, Xojo Pro

    @Tom D
    You could also look at using the "<raw>" tag in your cells to embed an image of a check/emptybox and use the cell click event to toggle and track it. Check the WebListBox.Cell documentation if you want to see an example of the "<raw>" tag being used

  16. Brock N

    12 Dec 2018 Pre-Release Testers, Xojo Pro

    Try this, drag in a new listbox and call this in the shown event

    for r as integer = 0 to 20
    Listbox1.AddRow
    listbox1.Cell(r,0) = "<raw><input type='checkbox' onchange='alert(this.checked)'>test</input></raw>"
    next
  17. Brock N

    12 Dec 2018 Pre-Release Testers, Xojo Pro

    Here's an example project using the RAW tag with eventing hooked up

    https://www.dropbox.com/sh/pz4rirgt66uzjhk/AABmnx8Qc2slLmMEnMBAkemda?dl=0

  18. 10 months ago

    Tom D

    1 Feb 2019 Pre-Release Testers, Xojo Pro

    Thanks Brock. I missed this earlier but I'll go play with it now.

  19. Maximilian T

    12 Feb 2019 Pre-Release Testers, Xojo Pro Europe, Germany, Berlin

    I just tried to modify this to make popup menus work in listbox cells as well, but failed. I'm adding rows like this:

    For r As Integer = 0 To 20
    Me.AddRow
    Dim rows() As String
    rows.Append "<raw><select>"
    rows.Append"<option value=""volvo"">Volvo</option>"
    rows.Append"<option value=""saab"">Saab</option>"
    rows.Append"<option value=""opel"">Opel</option>"
    rows.Append"<option value=""audi"">Audi</option>"
    rows.Append"</Select></raw>"
    Dim html As String= Join(rows,EndOfLine)
    Me.Cell(r,0) =html
    Next

    The popup menu shows up and displays "Volvo", but clicking it does not reveal the other items. If someone sees what I'm missing...

  20. Brock N

    12 Feb 2019 Pre-Release Testers, Xojo Pro

    @MaximilianTyrtania I just tried to modify this to make popup menus work in listbox cells as well, but failed. I'm adding rows like this:

    For r As Integer = 0 To 20
    Me.AddRow
    Dim rows() As String
    rows.Append "<raw><select>"
    rows.Append"<option value=""volvo"">Volvo</option>"
    rows.Append"<option value=""saab"">Saab</option>"
    rows.Append"<option value=""opel"">Opel</option>"
    rows.Append"<option value=""audi"">Audi</option>"
    rows.Append"</Select></raw>"
    Dim html As String= Join(rows,EndOfLine)
    Me.Cell(r,0) =html
    Next

    The popup menu shows up and displays "Volvo", but clicking it does not reveal the other items. If someone sees what I'm missing...

    Try removing the Listbox Click Events:

    ExecuteJavaScript("document.getElementById('" + Listbox1.ControlID + "').removeEventListener('mousedown', Xojo.input.begin);")

    See:
    https://forum.xojo.com/46100-what-can-i-embed-within-a-weblistbox

  21. 4 months ago

    Hi Brock!

    I'm just getting into some of this Xojo web stuff and have a lot to learn.

    Your examples are really cool and got me thinking. I am hoping to find a way to allow users to "drag" a row by a canvas I added to your container with the checkbox but am missing too much to even know if it is even possible.

    Here is a quickly modified version of your project that I hoped to prove my concept with:
    https://www.dropbox.com/s/lb9nkas789ne2de/EmbedCCinListbox%20ED.xojo_binary_project.zip?dl=0

    I have done canvas drags in other projects where I generate dynamic controls and it works pretty well. Here the drag and drop of the independant canvas works but once embedded in your container the drag doesn't work.

    Do you have any insights to share with regards to my objective?

    Thanks in advance!

or Sign Up to reply!