cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
JMP is taking Discovery online, April 16 and 18. Register today and join us for interactive sessions featuring popular presentation topics, networking, and discussions with the experts.
Choose Language Hide Translation Bar
pmroz
Super User

Copy/Paste from textbox or stringcolbox?

Hello folks,

I create reports using textboxes and tableboxes containing stringcolboxes and numbercolboxes.  Is there a way to copy things from these displays?  I don't want to use texteditboxes, because people could change the content.

Thanks,

Peter

10 REPLIES 10
txnelson
Super User

Re: Copy/Paste from textbox or stringcolbox?

You can select and cut at paste any table box or column witnin the table box, using the selection tool.  You can find that tool in the pull down menu area, or you can simply hover over the the display window and click the "s" key and it will change to the selection tool.  Then simply click on what you want to select and then use the copy key strokes or the Edit==>Copy selection from the pull down menus.  Then just type the letter "a" and you will be taken out of the selection tool.

Also, you can rt. mouse click on any table box, and select "Make into Data Table" and it will then place the table into a data table, and let you cut and paste specific cells.

Jim
pmroz
Super User

Re: Copy/Paste from textbox or stringcolbox?

Thanks Jim I'm aware of that technique.  The problem with that approach is you can only copy all of the text, not some of it.  Sometimes I'm displaying 40-50 lines of text, and users want to copy a single word or sentence.

txnelson
Super User

Re: Copy/Paste from textbox or stringcolbox?

You can specify in jsl to allow for the data table to be selectable.  You can specify the number of rows that can be selected, and then take action based upon the selection.  Go to Help==>Scripting Index and look up the table box.  You will see the messages that can be sent to it that will permit selection, etc.

Jim
pmroz
Super User

Re: Copy/Paste from textbox or stringcolbox?

Still no joy.  If you select a row in a tablebox and hit CTRL-C, you get the entire table.  This is the example from the scripting index:

Names Default To Here( 1 );

New Window( "Mountains",

    tb = Table Box(

        String Col Box( "Mountain",

                  {"K2", "Delphi", "Kilimanjaro", "Grand Teton"} ),

        Number Col Box( "Elevation (meters)", {8611, 681, 5895, 4199} ),

        Plot Col Box( "", {8611, 681, 5895, 4199} )

    )

);

tb << Set Selectable Rows();

txnelson
Super User

Re: Copy/Paste from textbox or stringcolbox?

If you set up your display so you can select the rows you want, and then have a Button Box that has the jsl behind it to take the selected rows, and to grab just the column you want, then it can copy that to the paste buffer.

Jim
ms
Super User (Alumni) ms
Super User (Alumni)

Re: Copy/Paste from textbox or stringcolbox?

Yes, that's a little strange.

Here's an idea for a workaround (not thoroughly tested); just select an item to copy it:

New Window("test", Table Box(ncb = Number Col Box("data", {1, 2, 3, 4}), <<Set Selectable Rows()));

ncb << set row change function(

    Function({this},

        Set Clipboard(ncb[this << get selected rows][1])

    )

);


pmroz
Super User

Re: Copy/Paste from textbox or stringcolbox?

Thanks MS that's an interesting way to do it.  Wasn't aware of the set clipboard function.  However I'm dealing with basic users who understand ^C and ^V, and this might confuse them.

txnelson
Super User

Re: Copy/Paste from textbox or stringcolbox?

To approach this from a different angle.......you could use a New Data View as the display vehicle, which will allow all of the cutting and pasting one can do to a data table.  The problem to be over come is that a user can change the values.  So to overcome this, you could place a Make Row State Handler on the data table, that looks to a "Private" copy of the data table, and changes any changed values back to the original values.  Therefore always insuring the cut and paste will get the original values.

Jim
pmroz
Super User

Re: Copy/Paste from textbox or stringcolbox?

That's a reasonable possibility.

For my other case of just selecting text from a text box I'm going to try out using texteditboxes.  Users could change the text but I'm not saving it anywhere.  For that matter they could copy the text and then change it in wherever they paste it to (i.e. word, power point etc.).