bugpyFormex - Bugs: bug #36805, Display and edit problems for...

 
 

bug #36805: Display and edit problems for Table widget

Submitted by:  Tran Phuong Toan <phuotran>
Submitted on:  Sat Jul 7 13:39:34 2012  
 
Category: GUISeverity: 3 - Normal
Item Group: Feature requestStatus: Fixed
Privacy: PublicAssigned to: Sander De Bock <sdebock>
Open/Closed: Closed

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

Please log in, so followups can be emailed to you.

 

(Jump to the original submission Jump to the original submission)

Sat Jan 19 18:46:44 2013, comment #7:

Fixed in commit 877b93c

Tables can now be edited from inside an InputDialog. See the following example
giving the following output after changing the entries in the first column to '1'.

Note

  • You have to use the itemtype='widget' syntax to get the results of the table back in the dialog results.
  • The result is an array for the ArrayModel, and a list for

the TableModel.

  • TableModel can have per row or per column different type.
  • Default TableModel type is str.
  • The possibility of adding a plain widget to the dialog items

is intended for widgets that just display information or that aid in the working of other input fields. They can not return a value, as they do not even have a key (name).

I leave this bug open for a while, in case some problems arise with the new functionality.

Benedict Verhegghe <bverheg>
Project Administrator
Thu Jan 17 09:18:11 2013, comment #6:

For the nested results: consider this example:

def run2():
"""Table widget in InputDialog"""
dataTable = np.arange(40).reshape((-1, 2)).tolist()
# print(dataTable)
table = widgets.Table(dataTable, label='table',chead=[1, 2], edit=True)

input_data = [
dict(name='bla',value=None,text="A constant info field",itemtype='info'),
_I('clist',['First','Third'],text="itemtype 'list' with check=True",itemtype='list',choices=['First','Second','Third','Fourth'],check=True),
table
]
dialog = widgets.InputDialog(input_data, autoprefix=True,caption='InputDialog',modal=True)
print dialog.getResult()
print table.tm.arraydata

The getResults() will only output [('bla', None), ('clist', ['First', 'Third'])], while we also want the table.tm.arraydata in the results I imagine!

I have not found a way to fix this without breaking something else.

Sander De Bock <sdebock>
Project MemberIn charge of this item.
Wed Jan 16 22:33:52 2013, comment #5:

We need to revive this bug, or close it.

I am not sure I understand the problem with the nested results.

As far as Array/Table model is concerned: I suggest Array to be used for float/int tables, while Table holds just strings.
We could add a list of validator and/or convertor functions though, permitting the table to have different type of values in different columns.

Benedict Verhegghe <bverheg>
Project Administrator
Fri Aug 24 10:44:33 2012, comment #4:

The ArrayModel could rely on the data being a numpy array, and thus could also use numpy methods and access elements as data[row,column].

The TableModel will always us a list of lists and elements are accessed as data[row][column]. This model could allow rows of unequal length.

Benedict Verhegghe <bverheg>
Project Administrator
Fri Aug 17 11:10:30 2012, comment #3:

Fixed the "array" problem.
It seems two different functions are called depending on the type of list/array:

ArrayModel
and
TableModel

But I don't really see the point of this.

Still to do:
getResults to show nested widget results.

Sander De Bock <sdebock>
Project MemberIn charge of this item.
Fri Aug 10 09:29:58 2012, comment #2:

Fixed it so now you can edit tables.
Array->list can be fixed easily by IF statement and tolist, but thinking of other way.

New bug found: InputDialog > getResults will only show the results of the 'items' i.e. the dictionaries added, not the results of the nested Widgets.
Quick fix: ask directly for result of nested Widget, e.g.:
table.tm.arraydata , but thinking of a way to make it general for all widgets.

Sander De Bock <sdebock>
Project MemberIn charge of this item.
Thu Aug 9 15:07:39 2012, comment #1:

Editing a Table widget has not been implemented yet. Still I consider it important, so I have added an entry for this in the Tasks list. Now we are just waiting for somebody to pick it up ;)

Benedict Verhegghe <bverheg>
Project Administrator
Sat Jul 7 13:39:34 2012, original submission:

Table widget can't display numpy arrays. Data have to be converted into List.

Editing the table through the interface (parameter edit=True) doesn't work.

Tran Phuong Toan <phuotran>
Project Member

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #26161:  testTable.py added by phuotran (2kB - text/x-python)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by sdebock (Updated the item)
  • -unavailable- added by bverheg (Posted a comment)
  • -unavailable- added by phuotran (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 7 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Thu Nov 14 19:04:05 2013bverhegStatusReady For Test=>Fixed
      Open/ClosedOpen=>Closed
    Sat Jan 19 18:46:44 2013bverhegItem GroupNone=>Feature request
      StatusIn Progress=>Ready For Test
    Fri Aug 10 09:26:05 2012sdebockStatusNone=>In Progress
      Assigned toNone=>sdebock
    Sat Jul 7 13:39:34 2012phuotranAttached File-=>Added testTable.py, #26161

    Back to the top


    Powered by Savane 3.1-cleanup