It is currently Thu Aug 28, 2014 1:23 am




Post new topic Reply to topic  [ 6 posts ] 
 control columns to edit and override value in cell 
Author Message
General
General

Joined: Thu Jul 31, 2008 2:08 pm
Posts: 386
Location: Chico, CA
Post control columns to edit and override value in cell
I am trying to setup a table for data entry. Two issues have arisen that I cannot figure out the solution to. First I have a table with multiple columns, but only two of the many columns need to be edited. How can I make it so that when tab is pressed it goes between the two editable columns and then down a row. Right now all 10 columns have to be tabbed through before it goes down a row.

Secondly how do I make it so when a cell is typed into it overrides the value? Right now it just starts adding digits to the current value.

One more thing is there a way to make enter act like the tab key in the table.

All three of these solutions will make data entry much faster.

_________________
Jonathan


Wed Mar 25, 2009 1:38 pm
Profile
General
General

Joined: Thu Jul 31, 2008 2:08 pm
Posts: 386
Location: Chico, CA
Post Re: control columns to edit and override value in cell
i figured out 2/3 to control the enter key and which columns to move between i used this on the keypressed event of the table.

Code:
if(event.keyCode == 10):
   if(event.source.selectedColumn == 3):
      event.source.selectedColumn = 2
   elif(event.source.selectedColumn == 2):
      event.source.selectedColumn = 3
      event.source.selectedRow -= 1


i still do not know how to overwrite the value in the cell.

_________________
Jonathan


Wed Mar 25, 2009 2:22 pm
Profile
General
General

Joined: Thu Jul 31, 2008 2:08 pm
Posts: 386
Location: Chico, CA
Post Re: control columns to edit and override value in cell
after further testing the solution previously posted does not work if the sort order of the table is changed. the selected cells starts to jump all over the place until i sort the table back to how it was orginally. then it starts to work correctly.

_________________
Jonathan


Wed Mar 25, 2009 3:22 pm
Profile
Moderator
Moderator

Joined: Sun Apr 02, 2006 2:46 pm
Posts: 4051
Location: Sacramento, CA
Post Re: control columns to edit and override value in cell
Ok, I have tweaked your code a bit, but the "jumping around" that you noticed is actually a minor bug in the table'ss setSelectedRow() logic that focuses on the newly selected row, but fails to translate for the sorting. This has been fixed for 3.3.2.

As for overwriting the cell on edit - I agree that would be better. I'll add this as a feature request.

Code:
if(event.keyCode == 10):
   if(event.source.selectedColumn == 3):
      event.source.selectedColumn = 2
   elif(event.source.selectedColumn == 2):
      def setLater(row = event.source.selectedRow, event=event):
         event.source.selectedColumn = 3
         # to counteract the default enter keypress behavior
         event.source.selectedRow = row
      fpmi.system.invokeLater(setLater)

_________________
Carl Gould
Co-Director, Software Engineering
Inductive Automation


Thu Mar 26, 2009 8:37 am
Profile WWW
Cadet
Cadet

Joined: Thu May 12, 2011 7:21 pm
Posts: 4
Post Re: control columns to edit and override value in cell
I hate being one of those people who drags up old threads, but is it now possible to set the cell of a table to overwrite for data entry?


Thu May 12, 2011 7:25 pm
Profile
General
General

Joined: Thu Jul 31, 2008 2:08 pm
Posts: 386
Location: Chico, CA
Post Re: control columns to edit and override value in cell
in the change log forum thread FactoryPMI version 3.3.2 has the update to override values in editable table cells.

Quote:
April 22, 2009 - FactoryPMI 3.3.2 released.

Changelog Entry

Version 3.3.2 build 2754 (Release Date 4/22/2009)

New: fpmi.tag.writeToTagSynchronous() call allows synchronous tag updates.
Improved: Table.setColumnAttributesDataset now uses automatic type-coersion.
Improved: Table editing now overwrites/selects all when editing begins.
Improved: Accessability improved on the dynamic property customizer.
Improved: Various improvements to the IP Cam Viewer component to support Linksys and Mobotix cameras.
Improved: Low level comm detail should improve HTTP keep-alive performance.
Improved: Mouse scroll wheel support added to script editors.
Improved: Easy chart axes now have a minimum auto-range size of 1.0 to prevent strange tick units on flatline data.
Fixed: Bug that caused projects to be unable to launch in Applet mode.
Fixed: Bug that caused an error on classic charts in category mode that had zero rows of data.
Fixed: Bug that caused tabbing off the last cell of an editable table and then clicking a button caused the cell to not commit the edit.
Fixed: Bug in table.setValue() that caused it to not coerce from python datatypes well.
Fixed: Bug that caused the Designer's custom palettels to not be re-created if they were lost.
Fixed: Chart now draws selection highlight correctly when the chart has a border.
Fixed: Easy Chart now correctly fires mouse events.
Fixed: Bug that caused the module editor's buffer to get cleared when also running the script playground.
Fixed: Datasource can now support -1 for the Max Idle pooling parameter.
Fixed: Minor bug in the HTML formatting of the Table's exportHTML function.
Fixed: Possible NPE when deleting a component.
Fixed: Bug that caused the internal authentication profile to not perform soft failover correctly.

_________________
Jonathan


Fri May 13, 2011 7:30 am
Profile
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: