'Submit To' Based on Number in Table Cell
Hi,
Upon clicking a Submit button, I'm trying to have my form go to certain people based on a number in a table cell.
For example, if the dollar amount in the table cell I named "TotalPrice" is $1,000 or greater, it goes to one group, and if it is less than $1,000, it goes to another group.
Here is the script I was trying, but not having any success...
var vEmail;
var vCC;
if (Page1.Table1.Row[11].TotalPrice.rawValue >= 1000)
vEmail = Page1.Buyer.rawValue;
vCC = Page1.RequestorEmail.rawValue + "[email protected]";
else
vEmail = Page1.Buyer.rawValue;
vCC = Page1.RequestorEmail.rawValue;
Any advice would be appreciated.
Regards,
ZeroZone
var vEmail;
var vCC;
if (Page1.Table1.Row.all.item(11).TotalPrice.rawValue >= 1000)
vEmail = Page1.Buyer.rawValue;
vCC = Page1.RequestorEmail.rawValue + ";[email protected]";//make sure to separate emails with semicolons(;)
else
vEmail = Page1.Buyer.rawValue+";[email protected]";
vCC = Page1.RequestorEmail.rawValue;
app.mailMsg({bUI:true,cTo:vEmail,cSubject:"My Subject",cCC:vCC})
Kyle
Similar Messages
-
JTABLE Number Editor - Table Cell Renderer Clash
Hello gentlemen,
I have a JTABLE with an editable column 1. I implement a number editor and a table cell renderer (pls see below) to this column. I apply the setClickCountStart(2) method to the number editor in order to render each cell in the column editable only after two clicks. However, I believe setClickCountStart(2) is somehow overridden by a "default" functionality in my
CustomTableCellRenderer.
My problem is that any cell I select (click only once) in column1 is automatically editable whereas I only want a cell to be editable after two clicks.
Please see my code below. Any comment is more than welcome!
Cheers.
hoodNumberEditor = new NumberEditor();
hoodNumberEditor.setClickCountToStart(2);
class CustomTableCellRenderer extends DefaultTableCellRenderer {
public Component getTableCellRendererComponent(JTable table,
Object obj, boolean isSelected, boolean hasFocus, int row, int column) {
Component cell = super.getTableCellRendererComponent(
table, obj, isSelected, hasFocus, row, column);
if (isSelected) {
cell.setBackground(Color.white);
cell.setForeground(Color.black);
return cell;
CustomTableCellRenderer customrenderer = new CustomTableCellRenderer();
table.getColumn(1).setCellRenderer(customrenderer);
table.getColumn(1).setCellEditor(hoodNumberEditor);1) Your custom cell renderer does nothing extra, so you can depend on default renderer.
2) Instead of extending JLabel and implementing TableCellReneder, you should extend DefaultTableCellRenderer and override its get renderer method because DefaultTableCellRenderer itself extends JLabel and aditionally it does some optimizations etc., which you can miss if you implement your own renderer.
3) If you set foreground and background color in last else statement also, then you can see the values correctly in windows L&F as well.
Thanks! -
I am building a calander with indesign.
i have created a table including cells, and
was wondering how can I number the cells
automaticly from 1-30 without having to go
through all of the cells one by one?
is there any way to do it?http://indesignsecrets.com/need-to-build-a-calendar-in-indesign.php
Bob -
Get table cell value on click without using submit or action
hello ,
i am having html table containing values retrieved from database.
i want to create table cell as a link and want to pass cell's value to the next page without using submit, radio button, checkbox.
it is feasible in PHP and ASP but i want to solve in jsp. pls suggest the solution.
Edited by: Avinash123 on Dec 16, 2008 2:58 AMHere is sample code
<script type="text/javascript">
function callForm(data)
frm.action="anotherjsp.jsp?value="+data;
frm.submit();
</script>
<form name="frm" action="">
<table id="test" border='1'>
<tr >
<td onclick="callForm('Data1')" > Data1 </td>
<td onclick="callForm('Data2')" > Data2 </td>
<td onclick="callForm('Data3')" > Data3 </td>
<td onclick="callForm('Data4')" > Data4 </td>
</tr>
</table>
</form> -
Get the raw/column number of a left-mouse clicked table cell
is this possible to get the row/column number of
a cell where a mouse is clicked? Accutally, i want to implement a
dynamic one column list which the user can "Add" or "Delete" some entries. The
"Add" function is all right. The "Delete" function
makes me upset because I cannot catch the cell's location where the
mouse is choosing. I tries to use "Active Cell", it seems does not
work. Do you have any clue? is this possible to implement the dynamic list using the "listbox"? thanksI would use the EditPos property value. In my testing, it always returned the row and column of the cell I had left-clicked on.
-
I made a large table where each cell contains a number indicating
the level of a parameter.
Some of these cells would need an explanation. And I'd like to put this
explanation outside of the table so as to keep it filled with
numeric values. I thought that a note would be the perfect tool to make
this kind of table explanation.
Hence I tried to insert a footnote within a cell,
but the menu stay as grey as deaf.
It doesn't even give me the smallest word of explanation about
this error or inability.
I didn't find any help on how to insert a footnote within a table cell?
Is it prohibited?
Why?
<pre>--------
As long as you'll see students making graphics with pen on paper,
you'll see the missing keystone of the software empire.
dan</pre>fruhulda wrote:
Yes, you can't use footnote within tables.
Bad news, but clear and fast answer.
I appreciate .
I'd appreciated to read this as quickly and clearly in the inline help.
Do you know if this banning of notes within tables
is lifted with Pages'09?
Otherwise, I'll submit a feedback.
<pre>--------
As long as you'll see students making graphics with pen on paper,
you'll see the missing keystone of the software empire.
dan</pre> -
Inline Error Message in a table cell
There is a requirement where in an error message is to be thrown in a table cell.
(For eg, when the filed value is getting populated from a VO.Considering the scenario where the value is null for some reasons.)Can anyone suggest to implement the same?It is possible with the controller coding.
User putAttrDialogMessage method on pageContext.
public void putAttrDialogMessage(OAWebBean webBean,
OAException message)
Registers a dialog message for a web bean that is not based on a view object. The dialog message will be displayed in the message box located in the top section of the current page and also attached to the corresponding region item as an inline message.
The proper way for preserving the bad value which caused the exception is by using OAAttrValException as follows:
OAMessageTextInputBean textField = ....; // webBean in question
OAAttrValException attrEx = new OAAttrValException(
OAAttrValException.TYP_VIEW_OBJECT, // Just default it to ViewObject
null, // View Usage Name as null
null, // The primary key as null
textField.getDataAttributeName(), // The attribute name
value, // The attribute bad value which caused validation failure
"FND", // Message application short name
"ATTR_EXCEPTION_MSG"); // Message code
pageContext.putAttrDialogMessage(textField, attrEx);
Parameters:
webBean - the web bean to which the message belongs
message - an OAException object representing the dialog message. An appropriate message type must be set on the exception object through the constructor.
Do let me know if you got struck. -
Read Only and HTML Table Cell Attributes
Hi Guys,
I believe i have come accross a bug - i'm been working on a form that can be filled out and printed - when going into print for sake of the output looking nice i set the form element to read-only.
As soon as an element such as a drop down box, text feild, text area, etc which display as "[selected value]" in plain text in read only mode, are changed to the read only mode apex seem to ignore the html table cell attributes.
For example i have a id number in the top left and then a version number in the top right. Both use a text feild; the top left uses 'width="100%"' for it's HTML Table Cell Attribute to push the right cell to the right. and the right cell has 'align="right"'. Now this works fine when read only is off... but as soon as read only is on, both the width and the alignment are totally ignored, and i can't find any sign of them in the code.
Because this is for printing; using the "disable" on the form element instead of "read only" function, isn't appropriate as disabled will make the elements faded and hard to read when printed, and keeping the elements as is will allow the user to edit information on the print screen - which is not appropriate.
Is this a bug? Will it be fixed soon? Is there any work around?
Cheers,
AlexUse the "Read Only Element Table Cell(s) Attributes" in the Read Only region of the Item edit form.
Scott -
How to enable a table cell dynamically?
Hi
I have a javafx TableView with editable and non-editable columns. I have set editable columns CellFactory to a custom EditableTextCell.This makes the whole column editable on load of the Scene.
I have one more requirement for the same table. I have to make the table cell editable at runtime based on a flag in item mapped to tablerow. Only a single row cell should get editable not all the cells in column. How to do that? Please suggest.Perhaps something like this
create or replace view v_myview
as
select id, name, 'table1' as tbl_nm from table1
union all
select id, name, 'table2' from table2
union all
select id, name, 'table3' from table3
union all
select id, name, 'table4' from table4
select name
from v_myview
where id = 101
and tbl_nm = :P101_TABLE_NAME; -
Small issue with custom table cell editor and unwanted table row selection
I'm using a custom table cell editor to display a JTree. Thing i notice is that when i select a value in the tree pop-up, the pop-up closes (as it should) but then every table row, from the editing row to the row behind the pop-up when i selected the value becomes highlighted. I'm thinking this is a focus issue, but it thought i took care of that. To clairfy, look at this: Before . Notice how the "Straightening" tree item is roughly above the "Stock Thickness" table row? When i select Straightening, this is what happens to my table: After .
My TreeComboBox component:
public class TreeComboBox extends JPanel implements MouseListener {
private JTextField itemField;
private TreeModel treeModel;
private ArrayList<ActionListener> actionListeners = new ArrayList<ActionListener>();
private Object selectedItem;
* Creates a new <code>TreeComboBox</code> instance.
* @param treeModel the tree model to be used in the drop-down selector.
public TreeComboBox(TreeModel treeModel) {
this(treeModel, null);
* Creates a new <code>TreeComboBox</code> instance.
* @param treeModel the tree model to be used in the drop-down selector.
* @param selectedItem tree will expand and highlight this item.
public TreeComboBox(TreeModel treeModel, Object selectedItem) {
this.treeModel = treeModel;
this.selectedItem = selectedItem;
initComponents();
* Returns the current drop-down tree model.
* @return the current <code>TreeModel</code> instance.
public TreeModel getTreeModel() {
return treeModel;
* Sets the tree model.
* @param treeModel a <code>TreeModel</code> instance.
public void setTreeModel(TreeModel treeModel) {
this.treeModel = treeModel;
* Returns the selected item from the drop-down selector.
* @return the selected tree object.
public Object getSelectedItem() {
return selectedItem;
* Sets the selected item in the drop-down selector.
* @param selectedItem tree will expand and highlight this item.
public void setSelectedItem(Object selectedItem) {
this.selectedItem = selectedItem;
String text = selectedItem != null ? selectedItem.toString() : "";
itemField.setText(text);
setToolTipText(text);
* Overridden to enable/disable all child components.
* @param enabled flat to enable or disable this component.
public void setEnabled(boolean enabled) {
itemField.setEnabled(enabled);
super.setEnabled(enabled);
public void addActionListener(ActionListener listener) {
actionListeners.add(listener);
public void removeActionListener(ActionListener listener) {
actionListeners.remove(listener);
// MouseListener implementation
public void mouseClicked(MouseEvent e) {
public void mouseEntered(MouseEvent e) {
public void mouseExited(MouseEvent e) {
public void mousePressed(MouseEvent e) {
public void mouseReleased(MouseEvent e) {
showPopup();
private void initComponents() {
setLayout(new GridBagLayout());
itemField = new JTextField();
itemField.setEditable(false);
itemField.setText(selectedItem != null ? selectedItem.toString() : "");
itemField.addMouseListener(this);
add(itemField, new GridBagConstraints(0, 0, 1, 1, 1.0, 0.0,
GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0));
private void showPopup() {
final TreePopup popup = new TreePopup();
final TreeComboBox tcb = this;
final int x = itemField.getX();
final int y = itemField.getY() + itemField.getHeight();
int width = itemField.getWidth() + popupButton.getWidth();
Dimension prefSize = popup.getPreferredSize();
prefSize.width = width;
popup.setPreferredSize(prefSize);
SwingUtilities.invokeLater(new Runnable() {
public void run() {
popup.show(tcb, x, y);
popup.requestFocusInWindow();
private void fireActionPerformed() {
ActionEvent e = new ActionEvent(this, ActionEvent.ACTION_PERFORMED, "TreeComboBoxSelection");
for (ActionListener listener : actionListeners) {
listener.actionPerformed(e);
private class TreePopup extends JPopupMenu {
private JTree tree;
private JScrollPane scrollPane;
public TreePopup() {
initComponents();
initData();
private void initData() {
if (treeModel != null) {
tree.setModel(treeModel);
private void initComponents() {
setFocusable(true);
setFocusCycleRoot(true);
tree = new JTree();
tree.setRootVisible(false);
tree.setShowsRootHandles(true);
tree.setFocusable(true);
tree.setFocusCycleRoot(true);
tree.addTreeSelectionListener(new TreeSelectionListener() {
public void valueChanged(TreeSelectionEvent e) {
tree_valueChanged(e);
scrollPane = new JScrollPane(tree);
add(scrollPane);
private void tree_valueChanged(TreeSelectionEvent e) {
DefaultMutableTreeNode node = (DefaultMutableTreeNode) tree.getLastSelectedPathComponent();
setSelectedItem(node.getUserObject());
fireActionPerformed();
this.setVisible(false);
}My TreeComboBoxTableCellEditor:
public class TreeComboBoxTableCellEditor extends AbstractCellEditor implements TableCellEditor, ActionListener {
protected TreeComboBox treeComboBox;
protected ArrayList<CellEditorListener> cellEditorListeners = new ArrayList<CellEditorListener>();
public TreeComboBoxTableCellEditor(TreeComboBox treeComboBox) {
this.treeComboBox = treeComboBox;
treeComboBox.addActionListener(this);
public Object getCellEditorValue() {
return treeComboBox.getSelectedItem();
public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) {
treeComboBox.setSelectedItem(value);
return treeComboBox;
public void actionPerformed(ActionEvent e) {
stopCellEditing();
}Any thoughts?
Edited by: MiseryMachine on Apr 3, 2008 1:21 PM
Edited by: MiseryMachine on Apr 3, 2008 1:27 PMAs I said, you have to have empty context elements before additional rows will be open for input.
For instance if you want to start with 5 rows available for input do the following to your internal table that you will bind:
data itab type standard table of sflight.
do 5 times.
append initial line to itab.
enddo.
context_node->bind_table( itab ).
The other option if you need n number of rows is to add a button to the table toolbar for adding more rows. When this button is pressed, you add a new context element to the node - thereby creating a new empty row in the table. -
How do i add a number in a cell which is already formatted
how do i add a number in a cell which is already formatted
IT seems that my orginal query has been corrupted
the orginal question was how to preserve rows and columns in numbers automatically.ie the cells are not consecutivecell a1 a3 etc
working on a league table when sorting the league table ,I need to preserve the row and column I can preserve row and column by using the drop down menu on every cell,but would like to do it automatically… -
How to make the diagonal line in the swing table cell?
Hi all,
How to make the diagonal line in the swing table cell just like the link below?
http://61.132.17.188/webber/table.gifOne improvement.. To get a line that is neat, use a bit of Graphics2D
public void paintComponent(java.awt.Graphics g)
int w = getSize().width;
int h = getSize().height;
// draw a line between (0,0) and (w,h)
g.setColor(getForeground());
if (strTop == null)
strTop = " ";
if (strBottom == null)
strBottom = " ";
java.awt.Graphics2D g2 = (java.awt.Graphics2D)g;
g2.setRenderingHint(java.awt.RenderingHints.KEY_ANTIALIASING,java.awt.RenderingHints.VALUE_ANTIALIAS_ON);
//g2.setStroke(new java.awt.BasicStroke(14.0f));
g.drawLine(0, 0, w, h);
//the following lines will draw the two strings,
//one above the top of the line and the above below it.
g2.drawString(strTop, (w/2)+2, (h/2)-2);
g2.drawString(strBottom, 2, (h / 2) + 2);
//the x,y for drawString are only based on assumption. //do necessary changes to suit ur needs.
}Then create a TableCellRenderer and set it to the Table Header for ur table's 1st row.....
Cheers -
Table Cell Editor which allows to input multiple lines of text...
Hi there
Does anyone know how to write a table cell editor which allows users to input multiple lines of text? please provide some sample if possible...
Thanks
KenI'm assuming you also want the renderer to display multiple lines? if so, make a class that extends JTextArea and that implements the TableCellEditor and TableCellRenderer interfaces, then set instances of this as the editor and renderer for the TableColumn in question. The implementation of most of the methods in these interfaces is trivial, often just this.setBackground() based on the table.getSelectionBackground() or table.getBackground(), a this.setText() based on the value passed in, then just a 'return this'.
You might want to make an abstract class which implements these interfaces for you, and which delegates to a simple abstract method that you override to return the renderer/editor component.
Note that you must use two instances of the class you make, one for the renderer and one for the editor, since it must be able to be able to render the remainder of the table's cells without interfering with the JTextArea performing the editing. (alternatively you could make two classes that extend JTextArea, each just implementing one of the interfaces, but this is more effort I think.) Also note that you must increase the table's row height to get more than one row visible. -
Selected Table Cell Border in 1.4.2
Hi All!!
I am facing a problem with JDK 1.4.2_01 & Windows L&F. I am unable to see the yellow border around the selected cell in JTable. Was working fine with 1.4.1_03.
A bug with id: 4674205 was reported with 1.4.0 stating :
" In the Windows Look and Feel, the selected cell in a JTree or JTable is framed with a yellow rectangle. To accurately match the real Windows UI, it should be a black and white dotted rectangle instead. (This was part of bug 4268204,which was marked fixed, but this part hasn't been fixed.) This behavior was fixed for JList, but not JTree or JTable. "
Now it has been fixed and closed.
May be they might have removed setting of yellow border for the selected cell to match with native windows UI.
But selected cell border is very much necessary for my project. Can any one please suggest me a workaround.
With Regards,
LRKHi Sai!
Thanks for your reply. It will not be feasible in my application as it already has huge number of tables with some of them already having complex renderers and editors.
I was looking at something which i can set globally so that it will reflect to all of the tables in the application in a particular L&F.
I tried setting
UIManager.getDefaults().put("Table.focusCellHighlightBorder",Color.yellow);
and
UIManager.put("Table.focusCellHighlightBorder",Color.yellow);
But no luck.
Any other inputs are most welcome.
With Regards,
LRK -
Robohelp HTML 9 hyperlinks in table cells help
Hi,
I'm creating a table in robohelp html 9 and adding hyperlinks in the table cells. If the hyperlink is the first word in that cell robohelp is adding styling code to the link eg <td><a href="#" style="color: #0000ff; text-decoration: underline; ">test</a></td>.
If I add a link to the second word in a table cell the styling does not appear or even if I add a space before the link the code does not appear eg <td> <a href="#">test</a> </td>.
The code appears when I flick between design and HTML views but it does not make any difference in which view I create the link.
No matter how many times I delete this code is keeps coming back. Can anyone please help me? Is there some default that gives this the styling code?Does anyone else get this issue?
A table with the different examples is below. It was created in design view by clicking table>insert table>OK. Links added by clicking the insert hyperlink button.
<table style="border-collapse: separate; border-collapse: separate;" cellspacing="0"
width="33.333%" border="1">
<col style="width: 100%;" />
<tr>
<td><a href="#" style="color: #0000ff; text-decoration: underline; ">test
that has the added code</a></td>
</tr>
<tr>
<td> <a href="#">test with space in front of link</a> </td>
</tr>
<tr>
<td><a href="#" style="color: #0000ff; text-decoration: underline; ">test</a></td>
</tr>
<tr>
<td>A <a href="#">test</a> </td>
</tr>
</table>
Thanks in advancedI have the same problem with those stupid links in tables - I've been working on this for HOURS and HOURS...... Based on previous experience, I assumed it must only be me and an ill-formed stylesheet. The table/link issue just came to my attention because I am in the process of changing styles/formats to a new company standard (new link color) and thought I really screwed my CSS up as I was changing things!
My only workaround thusfar has been to rewrite some data in the tables so that text will precede the link (yes, I did). And where I just couldn't do that, I resigned myself to the problem and forced a different color on the links (changing the #0000ff). One plus was that RH didn't rewrite the color code once it was changed manually..... but then I realized later that I didn't consider the hover color when I did this, so I now have to go back and correct them.
So glad to find your post...........
I played with the idea of adding hidden text, but was worried that the problem was really a result of an issue with my CSS and doing that wasn't the proper way to fix it. So, without guilt, I took Rick's suggestion and added an invisible dot/period at the beginning of every link in a table, when that link is the first or only content in the td. Did the trick! Now the links assume my declared css style!
I submitted a bug report.......
Thank you!!!
Maybe you are looking for
-
How to populate a html table in a JSF page
Hi, I need help on the following issue: My code calls an business layer API which returns me a string in html format which produces a html table. I have a JSF page with a bunch of other JSF components and I want to insert this html table at the botto
-
Well, i was on my laptop now and all of a sudden a pop up message appeared and said "your download is complete" so i went to go check it out and it was 'MacProtector'. i cant delete it and it keeps opening unwanted web pages, please help me sort this
-
Mac Mini (Intel) Ticking/Clicking Sound
I purchased a new Mac Mini (1.8, 80gb, 1gb, superdrive) about a week ago, and have enjoyed using it ever since, however I recently there is a ticking or clicking sound coming from the unit which sounds to me like it may be the hard disk either starti
-
Alternatives to Cross Project Links
Hi, Cross Project Links (External Tasks) is an out-of-the-box feature that allows to create dependencies between workplans. The basic functionality has not changed from Project Server 2003 (or ever in earlier versions) to Project Server 2013, includi
-
MacBook Pro 2010 + 27" display?
Hi all I have MacBook Pro (January 2010) with 2nd graphic card GeForce 9600M GT 512MB and I would like use that 2nd graphic card to connect 27" Apple display. That will be works fine? That graphic card can work on 2560x1440 resolution? regards Aron