#2440 WebTable in WebDialog

Jeremy Criquet Mon 17 Aug 2015

I feel a bit silly that I can't get this but...

Has anyone tried putting a WebTable into a WebDialog (in @Js)? Something like:

WebDialog( window ) {
  title = "blah"
  body = WebTable { model = MyWebTableModel( data ) }
  commands = Dialog.okCancel
}.open

The model has numCols and numRows greater then 0 and the cells all return a Str for text and header.

Placing this anywhere else (not in a WebDialog) displays perfectly fine. However, when in the WebDialog, it doesn't want to show and inspecting the html shows the <table> as having nothing in it (no <tr> tags).

I've tried just about everything I can think of with this one. refreshRows and relayout don't seem to help, even when placed in WebDialog.onOpen.

I've looked through all the Fantom/Javascript for Table, TablePeer, WebTable, WebTablePeer, etc. all to no avail. I can't seem to figure out why it isn't working.

I'm at a bit at a loss with this one...

andy Mon 17 Aug 2015

Stick it in a ConstraintPane - that should do the trick:

it.body = ConstraintPane
{
  minw=600; maxw=600
  minh=400; maxh=400
  WebTable { model = MyWebTableModel(data) }
}

Jeremy Criquet Tue 18 Aug 2015

Yup, tried that as well, to no avail. The issue is that the table in the DOM isn't being populated with any tr elements, as if TablePeer.refresh was never being called.

andy Tue 18 Aug 2015

Can you post your model code? Or send me an email

Jeremy Criquet Wed 19 Aug 2015

So, it seems the issue is that if a Table has a height of 0, it does not bother creating it's inner <tr> elements in the DOM. Very strange but makes sense, I suppose.

I was only putting a width in my ContraintPane, which is why I had not noticed that before.

Login or Signup to reply.