How to display .lvm filename in data portal?
When I drag a .lvm file to the data portal, it lists it as 'LabVIEW_Data' rather than the filename that I dragged there. When I drag another .lvm file it lists it as 'LabVIEW_Data2'. How can I get it to display the filenames that were dragged there instead of a generic 'LabVIEW_Data'?
Hi Dewey,
Unzip the below attached two VBScript files somewhere on your hard drive where you're willing to leave them. Then run the "Custom LVM Load.VBS" in DIAdem SCRIPT. Now drag a new LVM file into the Data Portal. You should see the Group take on the name of the LVM file. The custom load event only renames the Group if the channels in that last Group were loaded with the "LVM" DataPlugin.
You can configure your DIAdem to always start with the "Custom LVM Load.VBS", declared as part of DIAdem's launch cycle, by editing the "Start Script" field in the "General Settings" dialog and then saving the settings prior to shutting down DIAdem.
Ask if you have further questions,
Brad Turpin
DIAdem Product Support Engineer
National Instruments
Attachments:
Custom LVM Load.zip 1 KB
Similar Messages
-
How to display metadata such as data load date in answers report title?
We have a requirement to display the last load date of the data relevant to the report the user is viewing. We have such information stored in a metadata table listed by the fact table the report is referencing. Our proposed solution is to create new answers reports off of this metadata table and put each report (with the appropriate filter on the fact table) on each dashboard section where the corresponding report is placed. One problem with this approach is the load date information will not be reflected in the print form of the report as the date is dashboard content - not report content. Is there any way to overcome this situation (other than create a ton of variables specifically created for this purpose)? I'm open to entertaining javascript ideas, if necessary. I would love to know how to push this OBIEE envelope further. Thanks in advance.
Hi,
I discuss with some people who are familiar with SharePoint, we both thought Windows Explorer may
not accept the custom metadata.
if we want to do some customization, it is recommended to ask for help in development forum.
http://social.msdn.microsoft.com/Forums/windowsdesktop/en-US/home?category=windowsdesktopdev
If you have any feedback on our support, please click
here
Alex Zhao
TechNet Community Support -
How to display success message when data is changed in the custom tab in MM
Hi,
I have added a new custom data tab in the MM01/MM02/MM03 transactions. Whenever I do changes to fields in the custom tab in MM02 transaction, and no changes in the standard tabs, I will get a message stating "No Changes Made".
But if I do changes in the standard tabs, it works as usual with display of message "Changes to particular material has been done.
Please let me know, if anyone of you know, how to display the success message if the changes to the custom tab is done.
Thanks in advance,
sudhanvaHi Sudhanva,
The exit EXIT_SAPLMGMU_0001 is a function exit that you can use for custom validation but not to add custom tab/screen.
But the message issued by SAP is not related to this Function Exit.
If you have used a Screen Exit, then there must be some Function Exits also in the same Enhancement using which you can assign the value of custom fields to/from the standard structure. Thus when the value of any custom field is changed the system can understand that the some changes have been changed and will not issue the message.
In case you have used a BADI, there can be other methods in the BADi using whcih you can assign the value of custom fields to/from the standard structure. This might also prevent the message from being displayed.
I could try giving you further details if you can provide the name of the Enhancement/BADi that you used to add the additional tab.
Hope this helps.
Regards,
Abhisek. -
How to display maximum (most recent) date value in a query
hello,
I have the following query:
StudentNumber | ExternalOrganization | Date | | NumbeOfAdmissions
0112 050 06/27/2007 1
0234 060 07/15/2008 1
1356 025 01/08/2008 1
My dilemma is how to display only the row that has the most recent Date, e.g. here I want to only see the row with student number 0234 and date 07/15/2008; everything else should be hidden.
I know it should be very simple....yes/no?
thanksHi
even I am facing the same problem..
Can you please tell me what did you do to get most recent record..
Even I have made my date field as KF.. n have put condition on it.. but not getting desired result.. may be I am missing something.. somewhere..
I resolved it.. thanks
Regards
Swati
Edited by: Swati on Feb 17, 2009 7:49 AM -
How to display document last modfied date time in core result web part?
Hi,
We have a requirment in the sharepoint application where we need to display last modified date&time of document in core result web part.
To support this we have specify the property <Column Name="Write"/> in custom XSL.
But it displays only the modified date.Is there is way to display modified date and time as well?
D.GaneshIf you want to modify the
XML can do i tin the
template "DisplayTemplate":
An example:
Replace
<xsl:value-of select="write" />
by
<xsl:value-of select="ddwrt:FormatDate($write, 1033, 2)"/>
But I think the managed property"Write"
is returned only as
Date without
Time. By
this time will
always 00:00.
To see the resulting XML
can replace
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
<xsl:template match="/">
<xmp><xsl:copy-of select="*"/></xmp>
</xsl:template>
</xsl:stylesheet>
Where you see the format
of "write"
http://msdn.microsoft.com/en-us/library/ms546985(v=office.14).aspx
Miguel de Hortaleza -
Sorry, I know it was talked about before but I can't find it.
How do you get Aperture to display the full filename under the photo in grid or other view's that includes .nef or .jpg?
PowerBook G4 Mac OS X (10.4.6)first, check which Metadata set your View Options for Grid are set to; i.e., choose View Options from View.
next, add (and reorder) File Name from the Metadata/Other popup tab to your Metadata set. that will include the extension.
if you wish, remove the version name from the set.
if your thumbnails are small, you might not see the whole file name under the thumbnail in the grid. in fact, you might not see it at all! -
SOLUTION - How to display a BLOB content in Portal Report
Courtesy of Kelly Wong:
1. Every time a record of the file information is inserted into the
PORTAL30.WWDOC_DOCUMENT table while you inserted a record to the blob
field in a portal form that you created.
[The fact that a file uploaded appears in the WWDOC_DOCUMENT table is actually a side-effect of Forms file upload, this may change in a future version. However this example gives a pretty good solution to the problem - Dmitry]
2. If you describe the PORTAL30.WWDOC_DOCUMENT table, you will find
that a few of the columns are: NAME, FILENAME, MIME_TYPE, BLOB_CONTENT,
CREATOR, etc.
3. I created a pl/sql procedure that takes a NAME parameter.
The code of the procedure is as follows:
CREATE OR REPLACE Procedure get_url
(V_FILENAME IN VARCHAR2)
IS
url varchar2(100);
BEGIN
url := '/pls/portal30/docs/'| |v_filename;
portal30.wwv_redirect.url(p_url =>url);
END;
4. I then created a portal report, select NAME, FILENAME, MIMETYPE,
CREATOR fields from PORTAL30.WWDOC_DOCUMENT. (remember, no BLOB_CONTENT
field is selected!) My select statement is:
SELECT '<A
HREF="scott.get_url?v_filename='| |name| |'">'| |filename| |'</A>' filename,
name,mime_type,creator
from portal30.wwdoc_document
where creator = 'KELLY'
You can see that I am passing in "NAME" instead of "FILENAME" into the
get_url procedure because the it needs the "NAME" info to display the
file.
Actually, the content in the NAME column is something like:"563.TXT",
and the content in the FILENAME column is "F15675/IPORTAL_LOCAL.TXT".
The hyperlink can be either on the NAME or FILENAME field, as long as
you pass in the content of "NAME" into the procedure.
And it should be fairly easily to substring the FILENAME to show only
"IPORTAL_LOCAL.TXT" if the client doesn't like to see the number
portion.
That is, when I click on the link, I am able to see my file in a new
browser window.The only drawback in this scenario is if there is a link
from your document to a portal component (form/report), it may not link
to the form/report. If there are links in the document link to other
document (html, txt, etc.), it will be no problem. It just open the
document in another browser window.
Please feel free to give me any comment on this and post it to the forum
if needed. I just don't want to search for the original questions in
the forum and attach the reply to it.
Regards;
Kelly.Is this method working also for portal 3.0.9?
I can't get it to work.
Is there a way do put a link to download the content of a blob field inside a report in version 3.0.9 that comes with iAS 1.0.2.2?
Thank's in advance
Mauro -
How to display the user in a Portal page?
This is certainly a qyestion many of you have come across:
What is the best way to display the portal username in a portal page?
Thanks in advance for your help,
MiguelFrom a dynamic page, you'll want to call:
htp.p(wwctx_api.get_user());
For info on how to print out other information from their profile, you'll want to review the documented API calls at:
http://portalstudio.oracle.com/pls/ops/docs/FOLDER/COMMUNITY/PDK/plsql/doc/astart.htm -
HOW TO DISPLAY BW REPORTS(LINKS) IN PORTAL??
Hi All,
I am haveing Links of BW Report i have to display those reports in portal
How can i achive this except URL IVIEW??
I want to know that is theare any inbuilt template of Iview or any othere method to display thease reports in portal??
Any help will be highly appretiated.
Thanks in Advance.
Vinit SoniHi Vinit,
After looking into ur BW url , i think u r not using webtemplates.
u can follow below steps
Creating an BEx Web Application iView :
1.Right-click on the iViews folder, and choose New → iView. The iView Wizard displays.
2.Select iView template create an iView from an existing iView template radio button.
3.Choose Next.
4.In the iView Wizard, select BEx Web Application iView radio button.
5.Choose Next.
6.Enter a name, iView ID and iView ID Prefix.
7.Choose Next.
8.Choose SAP BW2.x/3.x radio button from Version.
9.Choose Next.
10.Select the SAP BW system alias SAP_BW and in the BEx Web Application Query String, copy the query id from the URL of your desired query from the string text &INFOCUBE onwards (for example, &CMD=LDOC&INFOCUBE=0MKTG_C01&QUERY=ZMKTG_C01_Q7001).
11.Choose Next.
And also maku sure u have configured WAS settings in system object u have created
Hope this helps u
Regards
Krishna. -
How to Display Time-Dependent Characteristic Data In Query
Hi Experts,
I have encountered a problem. I want to use Time-Dependent Chart. And want to display different value according characteristc's valid from time. For Example,
The Characteristic 0COSTCENTER has the navigation attribute 0COMPANY, The data as:
0COSTCENTER Valid from Valid To 0COMPANY
BW2305 20070101 20070430 A
BW2305 20070501 99991231 B
I want the report can display as :
0COSTCENTER Valid from Valid To 0COMPANY AMOUNT
BW2305 20070101 20070430 A 1000
BW2305 20070501 99991231 B 2000
But when I set the query's key date 20070420, the report display as:
0COSTCENTER Valid from Valid To 0COMPANY AMOUNT
BW2305 20070101 20070430 A 1000
BW2305 20070501 99991231 A 2000
when I set the query's key date 20070520, the report display as:
0COSTCENTER Valid from Valid To 0COMPANY AMOUNT
BW2305 20070101 20070430 B 1000
BW2305 20070501 99991231 B 2000
Can anybody tell me how I can get report expected.
Thanks in advance.
SFHi,
1) Add the characterstics 0COSTCENTER ,0DATETO,DATEFROM and 0COMPANY to the cube.
2) And also add these 4 IOs to the Communication structures which has update rules with the concern cube.
3) I hope , you already have 0COSTCENTER in the Commnication structure and mapping for that infoobject at both Update rules and Transfer rules.
4) Leave to the Blank(no mapping) mappings for the IOs 0DATETO,DATEFROM and 0COMPANY in the Transfer rules.But make 1:1 mapping in the Update rules for these 2 infoobjects.
5) Write the below code in the strt routine of the Update rules:
TYPES: BEGIN OF type4.
include structure like /BI0/QCOSTCENTER.
TYPES END OF type4.
DATA:
ITAB4 TYPE STANDARD TABLE OF TYPE4
WITH HEADER LINE
WITH NON-UNIQUE DEFAULT KEY INITIAL SIZE 0.
SELECT * FROM /BI0/QCOSTCENTER INTO CORRESPONDING FIELDS
OF TABLE ITAB4
WHERE OBJVERS = 'A'.
loop at DATA_PACKAGE.
READ TABLE ITAB4 WITH KEY COSTCENTER = DATA_PACKAGE-MATERIAL
DATETO LE DATA_PACKAGE-PSTNG_DATE
DATEFROM GE DATA_PACKAGE-PSTNG_DATE.
IF SY-SUBRC EQ 0.
DATA_PACKAGE-DATETO = ITAB4-DATETO.
DATA_PACKAGE-DATEFROM = ITAB4-DATEFROM.
DATA_PACKAGE-COMP_CODE = ITAB4-COMP_CODE.
ENDIF.
Modify DATA_PACKAGE.
endloop.
ABORT = 0.
Here I assumed you have Posting date in the Communication structure and used to map to Fiscalperiod of the cube.
6) Do the Master data upload to Cost center and active the master data of it always before uploading the data to cube.
7) Do the uploading to cube from Sratch.
With rgds,
Anil Kumar Sharma .P
Message was edited by:
Anil Kumar Sharma -
How to display reply in flex data grid?
Hello All,
Frompast couple of months i am working on a Flex Application which used MySQL databse and PHP as server side language. In this application user can login and they can post their comments which will be displayed in a datagrid. This will have a reply button where other users can send their reply. My problem is how i will be displying the reply of a msg in a datagrid. Here is the screenshot of my datagrid
I thought of 2 options:
1. Displaying the reply in the datagrid and disaply in the same row: i don know how we can do this.
2. Store all the replies in data base and display in toher panel though a button. From flex side it is easy to do but i don know how i can store them in database.
Please let me know if you have any ideas/tutorials on thisThis is only in theory, haven't actually checked it but I think it could work
If each one of those posts is done by an itemrender, your renderer can have 2 states stateone and statetwo for example.
The reply state (statetwo) being bigger and containing space for the reply post.
Store your replies in the database and have another boolean column ( Tinyint(1) or something) in your MySql db indicating that a particular post has a reply . When you pull your data from the database and put in in an arraycollection check this column for each post and use it to set the state of the itemrenderer.
That way posts with no reply with be state one, and posts with replies will be state 2 and you can populate the reply field with data from the object in your arraycollection.
I suppose it all does depend on how you get your data from MySQL and how you store it in Flex but I think states is a way you could accomplish things like this. -
How to display appcmd /config xml data into a single table
Hi,
I extracted my IIS sites using appcmd
appcmd /site /config /xml > c:\temp\iisconfig.xml
afterwhich I would like to grab the data from this xml and export into excel file
[xml]$iisconfig = get-content c:\temp\iisconfig.xml
I would like to get the Site Name, Bindings, Physical Directory Path and AppPool from this xml file and output to a excel file
#Physical Path Directory
$iisPhysicalPath = $iisconfig.appcmd.site.site.application.VirtualDirectory.PhysicalPath
#Application Pool
$iisAppPool = $iisconfig.appcmd.site.site.application.applicationPool
#Site Details (Site Name, Binding)
$iisSite = $iisconfig.appcmd.site
It doesn't have a single command to output into a table. How do I combine all these code and display in a single table?
JeronTry it like this:
$sites=[xml](c:\windows\system32\inetsrv\appcmd.exe list site /xml)
$sites.appcmd.site
\_(ツ)_/ -
How to display our own selected data in a search help using a exit
Hello,
I had created a Search Help Exit to restrict the values to be displayed in the search help. This code was written under the event 'DISP' in the exit. But it is not giving the desired result. So I want to replace the RECORD_TAB of the exit with my own selected data. For this I had written code for selection under the event 'SELECT'. But when I try to overwrite RECORD_TAB with this, this create errors.
What should I do to overwrite the values of the RECORD_TAB field with my own values?
Regards,
AbijithHi,
This is how we implemented the code modify the values in search help exit.
Check if display process button is pressed
IF callcontrol-step = 'DISP'.
Read the parameter ID for company code.
GET PARAMETER ID 'BUK' FIELD lv_bukrs.
IF sy-subrc EQ 0.
lwa_bukrs-sign = 'I'.
lwa_bukrs-option = 'EQ'.
lwa_bukrs-low = lv_bukrs.
APPEND lwa_bukrs TO lr_bukrs.
ENDIF.
Check if any entry is made in Test account/Testity account name
LOOP AT shlp-selopt INTO lwa_selopt.
CASE lwa_selopt-shlpfield.
WHEN 'ZZTEST'.
lwa_roy-sign = lwa_selopt-sign.
lwa_roy-option = lwa_selopt-option.
lwa_roy-low = lwa_selopt-low.
APPEND lwa_roy TO lr_roy.
WHEN 'ZZTEST_NAME'.
lwa_roy_name-sign = lwa_selopt-sign.
lwa_roy_name-option = lwa_selopt-option.
lwa_roy_name-low = lwa_selopt-low.
APPEND lwa_roy_name TO lr_roy_name.
ENDCASE.
ENDLOOP.
Get customer in entered for a company code
SELECT kunnr
bukrs
FROM knb1
INTO TABLE lt_knb1
WHERE kunnr IN lr_roy
AND bukrs IN lr_bukrs.
IF sy-subrc EQ 0.
SORT lt_knb1 BY kunnr.
Get customer name for the customer.
SELECT kunnr
name1
FROM kna1
INTO TABLE lt_kna1
FOR ALL ENTRIES IN lt_knb1
WHERE kunnr EQ lt_knb1-kunnr
AND mcod1 IN lr_roy_name.
IF sy-subrc EQ 0.
SORT lt_kna1 BY kunnr.
ENDIF.
ENDIF.
Get Values for Testty account selected by standard search help
CALL FUNCTION 'F4UT_PARAMETER_VALUE_GET'
EXPORTING
parameter = 'Ztest'
fieldname = 'Ztest' " Reference to search help parameter
TABLES
shlp_tab = shlp_tab " Reference to field of Seatinfo
record_tab = record_tab
results_tab = lt_test_help
CHANGING
shlp = shlp
callcontrol = callcontrol.
Get Values for Testty account Name selected by standard search help
CALL FUNCTION 'F4UT_PARAMETER_VALUE_GET'
EXPORTING
parameter = 'Ztest1'
fieldname = 'Ztest1' " Reference to search help parameter
TABLES
shlp_tab = shlp_tab " Reference to field of Seatinfo
record_tab = record_tab
results_tab = lt_roy_help
CHANGING
shlp = shlp
callcontrol = callcontrol.
LOOP AT lt_knb1 INTO lwa_knb1.
CLEAR lwa_kna1.
READ TABLE lt_kna1
INTO lwa_kna1
WITH KEY kunnr = lwa_knb1-kunnr
BINARY SEARCH.
IF sy-subrc EQ 0.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = lwa_kna1-kunnr
IMPORTING
output = lv_kunnr.
lwa_roy_help-ztest1 = lv_kunnr.
lwa_roy_help-ztest = lwa_kna1-name1.
APPEND lwa_roy_help TO lt_roy_help .
ENDIF.
ENDLOOP.
SORT lt_ztest_help.
DELETE ADJACENT DUPLICATES FROM lt_roy_help COMPARING ZTEST1.
Finally transport the computed numbers into the search help data.
CALL FUNCTION 'F4UT_PARAMETER_RESULTS_PUT'
EXPORTING
parameter = 'ZTEST1'
fieldname = 'ZTEST1'" Reference to search help parameter
TABLES
shlp_tab = shlp_tab " Reference to field of Seatinfo
record_tab = record_tab
source_tab = lt_roy_help
CHANGING
shlp = shlp
callcontrol = callcontrol.
Finally transport the computed numbers into the search help data.
CALL FUNCTION 'F4UT_PARAMETER_RESULTS_PUT'
EXPORTING
parameter = 'ZTEST''
fieldname = 'ZTEST'' " Reference to search help parameter
TABLES
shlp_tab = shlp_tab " Reference to field of Seatinfo
record_tab = record_tab
source_tab = lt_roy_help
CHANGING
shlp = shlp
callcontrol = callcontrol.
ENDIF.
Nabheet -
How to display a particular transaction over portal as per its id
hi
we have a requirement like this...
we have already developed some 200 iviews and the corrosponding pages...
now we want to develope an application either in web dynpro or pdk that we will upload over portal. that application will be having an inputfield for entering transaction number and a search button.
on the click of button our application must be able to search and display the corrosponding transactional iview already developed
plz guide on how this is possibleHi,
I don't think message input text allows to set URI property and it is available with MessageStyledText.
So if you want to achieve your requirement then you can take two items one message text input and other one as messageStylesText then if it is readonlymode then hide input text and render MessageStyled text and viceversa.
In this case you will be able to display links in case of Readonly text.
Regards,
Reetesh Sharma -
How to display time duration (NOT dates) with an input mask in a JTable?
Background: I am trying to display in a JTable, in two columns, the start position and time duration of an audio clip.
They are stored as type float internally eg. startPosition = 72.7 seconds.
However I wish to display on screen in the table in HH:mm:ss:S format. eg. 00:01:12:7. The user can edit the cell and input values to update the internal member fields.
Problem: I am finding it very difficult to implement this - what with the interactions of MaskFormatter, DefaultCellEditor etc.
Also using SimpleDateFormat and DateFormatter does not work as they insist on displaying the day, month, year also in the table cell.
Taking the Swing Tutorial TableFTFEditDemo example as a template,
(http://java.sun.com/docs/books/tutorial/uiswing/components/example-1dot4/index.html#TableFTFEditDemo)
does anyone know how to do this?
I can post my (buggy) modifications to the example code - if it would help.
Appreciate any help.
thanks,
AnilHere are my modifications to the TableFTFEditDemo example. If you run it, you get an exception
like java.lang.NumberFormatException: For input string: "18:00:03.500"
The two modified classes are taken from the Tutorial and are listed below:
=================
* IntegerEditor is a 1.4 class used by TableFTFEditDemo.java.
import javax.swing.AbstractAction;
import javax.swing.BorderFactory;
import javax.swing.DefaultCellEditor;
import javax.swing.JFormattedTextField;
import javax.swing.JOptionPane;
import javax.swing.JTable;
import javax.swing.JTextField;
import javax.swing.KeyStroke;
import javax.swing.SwingUtilities;
import java.awt.event.ActionEvent;
import java.awt.event.KeyEvent;
import java.awt.Color;
import java.awt.Component;
import java.awt.Toolkit;
import java.text.DateFormat;
import java.text.NumberFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import javax.swing.text.DateFormatter;
import javax.swing.text.DefaultFormatterFactory;
import javax.swing.text.MaskFormatter;
import javax.swing.text.NumberFormatter;
class TimeRenderer {
float seconds;
TimeRenderer(String str) {
int hSec = Integer.parseInt(str.substring(0,2)) * 60 * 60;
int mSec = Integer.parseInt(str.substring(2,4)) * 60;
int sSec = Integer.parseInt(str.substring(4,6));
float tSec = Integer.parseInt(str.substring(6,7))/10.0F;
seconds = hSec + mSec + sSec + tSec;
* Implements a cell editor that uses a formatted text field to edit Integer
* values.
public class IntegerEditor extends DefaultCellEditor {
JFormattedTextField ftf;
static Date zeroTime = new Date(0L);
private boolean DEBUG = true;
SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss.S");
MaskFormatter maskFo = new MaskFormatter("##:##:##.#");
protected MaskFormatter createFormatter(String s) {
MaskFormatter formatter = null;
try {
formatter = new MaskFormatter(s);
} catch (java.text.ParseException exc) {
System.err.println("formatter is bad: " + exc.getMessage());
System.exit(-1);
return formatter;
public IntegerEditor(int min, int max) throws ParseException {
super(new JFormattedTextField(new MaskFormatter("##:##:##.#")));
ftf = (JFormattedTextField) getComponent();
// Set up the editor for the cells.
ftf.setFormatterFactory(new DefaultFormatterFactory(new DateFormatter(sdf)));
ftf.setFocusLostBehavior(JFormattedTextField.PERSIST);
// React when the user presses Enter while the editor is
// active. (Tab is handled as specified by
// JFormattedTextField's focusLostBehavior property.)
ftf.getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), "check");
ftf.getActionMap().put("check", new AbstractAction() {
public void actionPerformed(ActionEvent e) {
if (!ftf.isEditValid()) { // The text is invalid.
ftf.setBorder(BorderFactory.createLineBorder(Color.RED));
ftf.setBackground(Color.PINK);
ftf.postActionEvent(); // inform the editor
} else
try { // The text is valid,
ftf.commitEdit(); // so use it.
ftf.postActionEvent(); // stop editing
} catch (java.text.ParseException exc) {
// Override to invoke setValue on the formatted text field.
public Component getTableCellEditorComponent(JTable table, Object value,
boolean isSelected, int row, int column) {
JFormattedTextField ftf = (JFormattedTextField) super
.getTableCellEditorComponent(table, value, isSelected, row, column);
System.out.println("value:" + value);
// long milliseconds =(long) (Float.parseFloat(value.toString()) * 1000);
long milliseconds =(long) (((Float) value).floatValue() * 1000);
Date dt = new Date(milliseconds);
ftf.setValue(dt);
return ftf;
// Override to ensure that the value remains an Integer.
public Object getCellEditorValue() {
JFormattedTextField ftf = (JFormattedTextField) getComponent();
Object o = ftf.getValue();
try {
Calendar cal = Calendar.getInstance();
cal.setTime((Date)o);
float seconds = cal.getTimeInMillis()/1000.0F;
return sdf.format(o);
//return new Float(seconds);
} catch (Exception exc) {
System.err.println("getCellEditorValue: can't parse o: " + o);
exc.printStackTrace();
return null;
// Override to check whether the edit is valid,
// setting the value if it is and complaining if
// it isn't. If it's OK for the editor to go
// away, we need to invoke the superclass's version
// of this method so that everything gets cleaned up.
public boolean stopCellEditing() {
JFormattedTextField ftf = (JFormattedTextField) getComponent();
if (ftf.isEditValid()) {
try {
ftf.commitEdit();
} catch (java.text.ParseException exc) {
} else { // text is invalid
ftf.setBorder(BorderFactory.createLineBorder(Color.RED));
ftf.setBackground(Color.PINK);
return false; // don't let the editor go away
return super.stopCellEditing();
//=====================================================
* TableFTFEditDemo.java is a 1.4 application that requires one other file:
* IntegerEditor.java
import javax.swing.JFrame;
import javax.swing.JDialog;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.table.AbstractTableModel;
import java.awt.Dimension;
import java.awt.GridLayout;
import java.text.ParseException;
* This is exactly like TableDemo, except that it uses a
* custom cell editor to validate integer input.
public class TableFTFEditDemo extends JPanel {
private boolean DEBUG = false;
public TableFTFEditDemo() throws ParseException {
super(new GridLayout(1,0));
JTable table = new JTable(new MyTableModel());
table.setPreferredScrollableViewportSize(new Dimension(500, 70));
//Create the scroll pane and add the table to it.
JScrollPane scrollPane = new JScrollPane(table);
//Set up stricter input validation for the integer column.
// table.setDefaultEditor(Float.class,
// new IntegerEditor(0, 100));
//If we didn't want this editor to be used for other
//Integer columns, we'd do this:
table.getColumnModel().getColumn(3).setCellEditor(
new IntegerEditor(0, 100));
//Add the scroll pane to this panel.
add(scrollPane);
class MyTableModel extends AbstractTableModel {
private String[] columnNames = {"First Name",
"Last Name",
"Sport",
"# of Years",
"Vegetarian"};
private Object[][] data = {
{"Mary", "Campione",
"Snowboarding", new Float(5.7), new Boolean(false)},
{"Alison", "Huml",
"Rowing", new Float(3.5), new Boolean(true)},
{"Kathy", "Walrath",
"Knitting", new Float(2.9), new Boolean(false)},
{"Sharon", "Zakhour",
"Speed reading", new Float(20.8), new Boolean(true)},
{"Philip", "Milne",
"Pool", new Float(10.5), new Boolean(false)}
public int getColumnCount() {
return columnNames.length;
public int getRowCount() {
return data.length;
public String getColumnName(int col) {
return columnNames[col];
public Object getValueAt(int row, int col) {
return data[row][col];
* JTable uses this method to determine the default renderer/
* editor for each cell. If we didn't implement this method,
* then the last column would contain text ("true"/"false"),
* rather than a check box.
public Class getColumnClass(int c) {
Object obj = getValueAt(0, c);
System.out.println("getColumnClass.obj:" + obj);
return obj.getClass();
public boolean isCellEditable(int row, int col) {
//Note that the data/cell address is constant,
//no matter where the cell appears onscreen.
if (col < 2) {
return false;
} else {
return true;
public void setValueAt(Object value, int row, int col) {
if (DEBUG) {
System.out.println("Setting value at " + row + "," + col
+ " to " + value
+ " (an instance of "
+ value.getClass() + ")");
data[row][col] = value;
fireTableCellUpdated(row, col);
if (DEBUG) {
System.out.println("New value of data:");
printDebugData();
private void printDebugData() {
int numRows = getRowCount();
int numCols = getColumnCount();
for (int i=0; i < numRows; i++) {
System.out.print(" row " + i + ":");
for (int j=0; j < numCols; j++) {
System.out.print(" " + data[i][j]);
System.out.println();
System.out.println("--------------------------");
* Create the GUI and show it. For thread safety,
* this method should be invoked from the
* event-dispatching thread.
* @throws ParseException
private static void createAndShowGUI() throws ParseException {
//Make sure we have nice window decorations.
JFrame.setDefaultLookAndFeelDecorated(true);
//Create and set up the window.
JFrame frame = new JFrame("TableFTFEditDemo");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
//Create and set up the content pane.
TableFTFEditDemo newContentPane = new TableFTFEditDemo();
newContentPane.setOpaque(true); //content panes must be opaque
frame.setContentPane(newContentPane);
//Display the window.
frame.pack();
frame.setVisible(true);
public static void main(String[] args) {
//Schedule a job for the event-dispatching thread:
//creating and showing this application's GUI.
javax.swing.SwingUtilities.invokeLater(new Runnable() {
public void run() {
try {
createAndShowGUI();
} catch (ParseException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
Maybe you are looking for
-
Calculated value for SAP Scripts
Hi All, I have made changes to two seperate print programs which are used to print Invoice and Packing Slip respectively. However, I'm using the dimension details from VEKP in both. When I calculate volume multiplying the length, breadth and height (
-
21406 events getting generated on all our production servers
Hi, We are getting below events on almost all our production servers (Exchange, Lync,etc.). Does anyone have any idea about this event. Log Name: Operations Manager Source: Health Service Modules Date: 2/10/2014 10:36:09 AM Event ID: 21406 Task Categ
-
Getting an Invalid XML Error when trying to update an Item through DI Server. What is wrong with the following code? <?xml version="1.0" encoding="UTF-16"?> <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"> <env:Header> <SessionID>
-
Add Content button not rendered inside Portlets on edit mode
Hi, I have a requirement where administrators will add some external content(Add content) either from taskflow or portlet and that external content (along with taskflow output) will be shown to the users based on some logic performed inside the taskf
-
Hi Maccies, There are several user accounts on my Mac. I have a file in /Users/Shared/ where all (user, group, and others) can read & write; and File -> Get Info also says "you can read and write". In actuality, only when I am logged in as the file o