Selecting a table row
I can't figure out how to programmatically select a jtable row. can someone fill me in? there must be an easy method call, but I can't seem to find it.
Here is the method :
JTable.setRowSelectionInterval(int beginIndex, int endIndex);Olek
Similar Messages
-
Disable Lead selection for table row cloumn
HI Team,
I have table with multiple rows and multiple columns.
Based on the lead selection of the row we are displaying the some form.
But in table row there are some columns like enter date, when the user is trying to enter the date, it displaying the form because of lead selection and it is not allowing the user to enter the date.
So, I want disable the lead selection for some columns.
How can I do this?
Regards,
BAlaHi
I think that you can get the UI Table in the wdDoModifyView method, and then the UI Column and play with his values, is something like this:
IWDTable table =(IWDTable)view.getElement( ");
And then play with the "column" methods.
Josué Cruz -
Indesign cc crash on selecting multiple table row
If i try to select more than a row or the entire column indesign crash and quit. exported to cs6 and opened it works perfectly
https://www.dropbox.com/s/2ih8nu2cfc1rjs3/tableproblem.inddHi,
I'm experiencing exactly the same error - this is on a MacPro4.1 with Mountain Lion. I've repaired permissions and all the hardware checks out. Seems to crash on table selection - also in overprint the redraw on table selections is all over the place (selecting the top row seems to select 2 below it, switching to standard view seems to display correctly). CC seems very buggy, hopefully I can save my work as a template and use CS6 to finish up (going to print in less than 2 hours!)
Worth noting that there is no other program running in the background and it happens from a clean reboot.
Here's the report:
Process: Adobe InDesign CC [227]
Path: /Applications/Adobe InDesign CC/Adobe InDesign CC.app/Contents/MacOS/Adobe InDesign CC
Identifier: com.adobe.InDesign
Version: 9.0.0.244 (9000)
Code Type: X86-64 (Native)
Parent Process: launchd [118]
User ID: 501
Date/Time: 2013-06-27 15:37:57.208 +0100
OS Version: Mac OS X 10.8.4 (12E55)
Report Version: 10
Interval Since Last Report: 123663 sec
Crashes Since Last Report: 4
Per-App Interval Since Last Report: 81445 sec
Per-App Crashes Since Last Report: 4
Anonymous UUID: EE196355-9B41-C217-A3F7-7C12613A3228
Crashed Thread: 0 Dispatch queue: com.apple.main-thread
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000000000
VM Regions Near 0:
-->
__TEXT 0000000100000000-0000000100006000 [ 24K] r-x/rwx SM=COW /Applications/Adobe InDesign CC/Adobe InDesign CC.app/Contents/MacOS/Adobe InDesign CC
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 com.adobe.InDesign.Widgets 0x0000000111d308a3 0x111cec000 + 280739
1 com.adobe.InDesign.Tables UI 0x00000001181d6954 0x118153000 + 538964
2 com.adobe.InDesign.Tables UI 0x00000001181d5fc7 0x118153000 + 536519
3 com.adobe.InDesign.Tables UI 0x00000001181d8b42 0x118153000 + 547650
4 com.adobe.InDesign.Table Model 0x0000000113abca9b 0x113aa4000 + 101019
5 com.adobe.InDesign.Table Model 0x0000000113abc0b5 0x113aa4000 + 98485
6 com.adobe.InDesign.Table Model 0x0000000113aba2a5 0x113aa4000 + 90789
7 com.adobe.InDesign.Table Model 0x0000000113b5404e 0x113aa4000 + 720974
8 com.adobe.InDesign.Text 0x00000001133d3859 0x113267000 + 1493081
9 com.adobe.InDesign.Text 0x00000001133e11a9 0x113267000 + 1548713
10 com.adobe.InDesign.Text 0x000000011340e518 0x113267000 + 1733912
11 com.adobe.InDesign.Text 0x0000000113409613 0x113267000 + 1713683
12 com.adobe.InDesign.Text 0x000000011342847a 0x113267000 + 1840250
13 com.adobe.InDesign.Text 0x000000011342833a 0x113267000 + 1839930
14 com.adobe.InDesign.Text 0x00000001134220a8 0x113267000 + 1814696 -
Multiple Selection of Table Rows
Hi Friends
I created a web dynpro application which displays a table with multiple records.
I added a button "REMOVE" to delete the selected rows from the table.
It is working good if I select single row, but if I want to delete more than one row I am not able to select the rows and how can I delete all the selected rows.
ThanksChange the selection property of node binded to table as 0..n.
This will allow you to select multiple rows.
To get multiple rows, use get_selected_elements method of if_wd_context_node.
Code for your reference :
DATA: wd_node TYPE REF TO if_wd_context_node,
wa_temp TYPE REF TO if_wd_context_element,
lt_temp TYPE wdr_context_element_set.
wd_node = wd_context->get_child_node( name = 'NODE' ).
CALL METHOD wd_node->get_selected_elements
RECEIVING
set = lt_temp.
LOOP AT lt_temp INTO wa_temp.
wd_node->remove_element( EXPORTING element = wa_temp ).
ENDLOOP. -
Add selected table row value to PageFlowScope so I can access in taskflow
Hi all,
Running into a problem getting a value from a selected ADF table row to a taskflow that is displayed as an inline popup. Here's the scenario. I have a view which displays a table. When I click on an edit btn I display my taskflow as an inline popup. What I would like to do is take the currently selected table row, pull off lets say the row name value and pass it to my taskflow for display. I've tried settting this value inside a mbean when I click the edit btn using:
AdfFacesContext.getCurrentInstance().getPageFlowScope().put("editTargetNameSource", targetName);
String tmpClear = (String) AdfFacesContext.getCurrentInstance().getPageFlowScope().get("editTargetNameSource");Which seems to get set but when I attempt to grab this value using EL inside my taskflow jspx page it looks to not be set.
<af:outputLabel value="Selected Row" id="ol1"/><af:outputText value="#{pageFlowScope.editTargetNameSource}"It seems like pageFlowScope for my popup taskflow != pageFlowScope for the page my table lives in. I've tried setting this as a input page param but I have a feeling I'm missing something. I'd like to be able to set this value inside my bean when a user clicks the edit btn and then display this value in my taskflow popup.
Any help is appreciated,
-WraithThanks for the links Timo. I still must be missing something here. In the vids you linked it looked like he was using regions to pass params from main page to a taskflow; setting a param on child taskflow (causes param to be required when dragging into main page). So I think I understand I add an expected param to my taskflow which somehow will be set by my main page. The part I'm missing is from my main page how can I get the selected table row value and set it in the expected pageflowscope param that my taskflow is expecting?
I've tried several things:
1) Using managed bean associated with my main page; setting param inside the bean on main page btn click and then try accessing this mbean param (couldn't access this value as different pageflowscope I believe)
2) Programmatically setting PageFlowScope as I linked in previous post.
3) using setPropertyListener I can set a static value setting value in pageflowscope.start and then inside adfc.config for the task set start value to another value expected by the taskflow page. This seemed to work but I can't figure out how to do the programmatic version of this using the currently selected row and its value.
One who seems to be missing something,
-Wraith -
I have a standard html table in and ICE div and want my
client to be able to add table rows to enter new problems reported.
When in edit mode we can edit content in the existing rows, but do
not seem to be able to add a new row. Suggestions?
MorrisHello Morris,
You can set table rows to be repeating regions, which will
make your table a repeating group element. Doing this allows your
users to duplicate the table rows and add new ones.
It sounds like the first thing you you will want to do is
remove the DIV wrapping the table in Dreamweaver. Then, place your
cursor in a table cell (the <td> elements in the row) and go
to Insert > InContext Editing > Create Editable Region. Do
this for each cell in the row you want to be editable. After you
have specified the editable cells in your table row, select the
table row (<tr> element of your table), and go to Insert >
InContext Editing > Create Repeating Region. This will allow
editors to duplicate the table rows, and edit the cells within the
row you have specified as editable.
Take a look at the following section of the Dreamweaver help
for more information on repeating regions:
http://help.adobe.com/en_US/Dreamweaver/10.0_Using/WS228F034D-1255-463f-BE80-D075F0BACF11. html
And please let me know if you need further assistance with
this.
Best regards,
Corey -
Framemaker10: can't cut and paste tables, rows, or columns
When I select a table row, copy, and then try to paste it as a new row, only text pastes in. When I Edit>Paste Special, the only options provided are Text and Unicode Text.
I used to be able to cut and paste rows but that is no longer an option. Has anyone experienced this? Know a fix?
Editing my maker.ini files does not fix it.Exactly how are you attempting to copy/paste?
For a whole table, I select the marker, copy, paste wherever.
For a row, I'm able to position my cursor in a row, highlight the row, then paste either at the end of that table or separately.
Haven't tried columns, but they probably work the same way. -
ADF Faces - Select data from a table row
Hi! I have to build a Select One table but I'd like to use instead the combination: radio button (to select) command button (to submint), only a command button placed in each row wich make both action with a single click.
Is it possible? How?
Thanks!Maybe some variant of the below will work for you:
SELECT *
FROM
SELECT transaction_id
, employee_name
, customer_number
, customer_name
, ROW_NUMBER() OVER (PARTITION BY employee_name ORDER BY DBMS_RANDOM.RANDOM) AS rn
FROM tbl_transactions
WHERE rn <= 10
; -
Hi,
I have a problem with JTable. ...i have just started working with JTables and still have not got a complete hang of how they function.
I have a table whose model is "AbstractTableModel". I have different data in each row of the table therefore i have a celledtior and cell renderer per row. Each row is rendered as a combo box. There is only one column in that table. What i need to do is when the user clicks on any of these the rows in the table i need to evaluate what is the content in that row(in the combo box-It should be the values that have not been used up yet in the other rows...so basically as you add rows the combo box content will keep shrinking till all the possible vlaues are exhausted).
I added a celleditor listener for every row. When the user clicks on the cell the event get's captured but the row value that shows up is not row the user selected. The value is always the previous selected row. Each cell is rendered as a combo box.
For example if the user selected the first row in the table then the value of the row selected is -1. If the the user adds two more rows and selects the third row then the value selected is 0 (previos selected).
What i cannot figure out is how in the world is this value obtained.
Please help !! I tried everything i can think of to get the correct value of the row selected.
Thanks a lot for your time and patience.
ArchanaHello Suman,
Please, look at 'No First Select from Table' section of this blog: [/people/jarrod.williams/blog/2006/12/14/visual-composer-tips-and-tricks|/people/jarrod.williams/blog/2006/12/14/visual-composer-tips-and-tricks]
Good luck,
Ola -
How to pass the selected table row data from popup to source view
Hi ,
I have requirement of passing the data from popup view to source. , searching some data in popup view and displaying in table,
Like i am passing some input and click search button will display the data in table, when select any of the row in the table and click on the another button , i should be able to pass the select row to the source view and also should close the popup.
When i implement , In the popup windiw, when i enter the customer no, and click on search button, it is closing the popup itslef. not able to see the data in popup.
Can u tell me what is that soultion.
Regards
VijayHi Harsimran
Thanks for the reply,
1) Source view
In "Source View" i have input field called Customer_no. But, the end user will not have any idea , what customer no to enter. so i am searching the customer no in the popup view.
1) Customer_no( This is an inputfiled , to get the customer no from the popup view)
2) Get Customer NO( This is a button to call the popup view)
"Get Customer NO" This button action will open the popup view.
In this popup, i have
1) Input field (To enter the search term)
2) Search (To seach the customer no based on the search term)
3) Table ( To display the search data)
4) Button in Table tool bar called "Select" .( To close the popup view after selected the required data in the table to pass it back to the source view).
so in the popup view what happening is, when i click on the search button itself , it is closing the popupview by transfering the first row of the tbale ,with out select the required row in the table.
i need to close the window after click on the "Select" button in the toolbar , after selected the required row data to trasfer in the table.
Can u pelase tell me what are the modifcations i need to do it.
Regards
Vijay -
How to get the index of table row without selection?
Hi all,
I have an table designed in XML view.Now i have added an change method for qty cell "valqty". When user inputs the qty in the cell and press enter this method is triggered now I want to know which index of the table is currently edited.Through which i can get the value of other cell in the same row.
NOTE: The table row doesn't have selection either multiple or single
I tried the following inside the valqty method but it now working
this.getValue();
this.getBindingContext().getProperty('PRD_NUM');
<Table id="idProductsTable"
inset="false"
items="{oModel>/deliverylist}"
visibleRowCount= "7"
mode="MultiSelect"
modeAnimationOn="true">
<headerToolbar>
<Toolbar>
<Label text="Products"></Label>
</Toolbar>
</headerToolbar>
<columns>
<Column
minScreenWidth="Tablet"
demandPopin="true">
<Text text="Order" />
</Column>
<Column
minScreenWidth="Tablet"
demandPopin="true">
<Text text="Quantity" />
</Column>
</columns>
<items>
<ColumnListItem>
<cells>
<Text text="{oModel>PRD_NUM}" />
<Input value="{oModel>DEL_QUAN}" change="valqty" maxLength="13" />
</cells>
</ColumnListItem>
</items>
</Table>
ThanksThanks Robin,
But in my case oEvent.getSource() is returning the cell instance and
oEvent.getSource().getBindingContext() is undefined
Hence not getting the value
I also tried the following
oEvent.getSource().getParent().getParent().indexOfItem()
But index returned is -1 -
No rows selected in table Transfer Rules
Hi All,
I have a Generic master datasource which is working fine. I am trying to append a field ZEINH to generic existing master datasource which uses user exit in R/3. It is working fine in R/3.
I have replicated R/3 datasource to BW and assign source system and datasource to infosource.I can see the ZEINH field in Transfer structure .I have tried to map ZEINH with infoobject of same domain and data element in the Infobject assign column of Transfer rule.
When It does not propose transfer rule for new field,however old fields are there. When I select new field and try to transfer to the comm.struc/Trns. rule column, it gives me error"No rows selected in table Transfer Rules"
Thanks in advance for your attentionHi,
In 'Transfer rules' tab, in the right frame, in the 'Infoobject' column, type in a name of infoobject to which you want to map incoming data from datasource.
Best regards,
Eugene -
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. -
Default selection of a row in the table
Dear all,
I have given output of one table as the input to an RFC and the output of this RFC is given to a table and the same scenario we followed for the graphs also. By default first row of the table is getting selected because of that the second table or graph is getting displayed without any user interaction. Please tell us how can we avoid the above. I tried by using guard condition of select but i am unable to control it. Please tell us detailed procedure by which directly i can follow the same.
Regards,
Suman.Hello Suman,
Please, look at 'No First Select from Table' section of this blog: [/people/jarrod.williams/blog/2006/12/14/visual-composer-tips-and-tricks|/people/jarrod.williams/blog/2006/12/14/visual-composer-tips-and-tricks]
Good luck,
Ola -
Table rows can't be selected / highlighted
Hi All,
I would like to know how table rows in BSP can be selected / highlighted. I was working with enhancement in standard application ERP_IT, but I need table rows to be selected to put some validation. Does anyone have an idea how to do this?
Regards,
LouieHi Louie,
You should pass the following parameters to the TableView.
selectionMode = "MULTISELECT"
displayMode = ' '
Answered!
Maybe you are looking for
-
My ipod touch is not recognized by my computer anymore
I don't know what to do. It started happening after I updated Itunes a couple of days ago.
-
IPhoto not connected to internet
I am getting the message that iPhoto not connected to internet. Why, internet working fine.
-
Version Compatibility on Type Specification Like
Hi, I'm Copying one Z Function Module from 4.6 version to 4.7 version. In 4.7 version the Type Specification Like is not allowed. When i'm using the Like type Specification the Internal table which i refered is not holding the value. Anyone can su
-
Snow Leopard Created New Keychains
After the SL upgrade I now have two additional keychains in the sidebar besides the standard login, system and one other that I created for account passwords. Both of these new keychains are the same and are my user name for my account on this comput
-
I have purchased on line Adobe ExportPDF, Annual and it has failed to download to our iMac O S X as a novice I would appreciate some advise, ( shocked at the cost of this product so cannot afford to have it sitting there not in use)