How do i keep my table row selected when i come back to the same page?
I have have the following issue.
I have a table with many rows. I select one row and click the button which takes me to another page. From that page when i click the back button which takes me back to previous page but the problem is that the row is no longer selected. How would i fix this problem?
Any idea, suggestion or sample code will be appreciated.
Thanks
Nahman
Here you go..
1. To Get the selected Rows:
DATA: TV TYPE REF TO CL_HTMLB_TABLEVIEW,
LT_FORMS TYPE TIHTTPNVP,
TABLE_EVENT TYPE REF TO CL_HTMLB_EVENT_TABLEVIEW.
tv ?= CL_HTMLB_MANAGER=>GET_DATA( request = request
name = 'tableView'
id = 'tvX' ).
IF tv IS NOT INITIAL.
table_event = tv->data.
clear selectedRowIndexTable.
selectedRowIndexTable = table_event->PREVSELECTEDROWINDEXTABLE.
if table_event->event_type eq CL_HTMLB_EVENT_TABLEVIEW=>CO_ROW_SELECTION.
read table selectedRowIndexTable with key table_line = table_event->ROW_INDEX
transporting no fields.
if sy-subrc eq 0.
delete selectedRowIndexTable index sy-tabix.
else.
field-symbols <i> type i.
append initial line to selectedRowIndexTable assigning <i>.
<i> = table_event->ROW_INDEX.
endif.
endif.
ENDIF.
ENDIF.
<b>Page attribute:</b>
selectedRowIndexTable TYPE INT4_TABLE
2. To store the selected row index into Server side cookie...
CALL METHOD CL_BSP_SERVER_SIDE_COOKIE=>SET_SERVER_COOKIE
EXPORTING
NAME = 'select_row'
APPLICATION_NAME = 'NONE'
APPLICATION_NAMESPACE = 'NONE'
USERNAME = SY-UNAME
SESSION_ID = 'NONE'
DATA_VALUE = selectedRowIndexTable
DATA_NAME = 'sbsp'
EXPIRY_TIME_REL = 3600.
3. Get the value from Server side cookie..
CALL METHOD CL_BSP_SERVER_SIDE_COOKIE=>GET_SERVER_COOKIE
EXPORTING
NAME = 'select_row'
APPLICATION_NAME = 'NONE'
APPLICATION_NAMESPACE = 'NONE'
USERNAME = SY-UNAME
SESSION_ID = 'NONE'
DATA_NAME = 'sbsp'
CHANGING
DATA_VALUE = selectedRowIndexTable.
Hope this will help you...
<b>* Reward each useful answer</b>
Raja T
Similar Messages
-
The internet pages don't display properly I'm using osx10.3.3, yahoo for example asks me to update, but I cant find out how, as the apple store just keeps sending back to the same page with no down load option...do i need to up date or is it just my mac
What Mac model do you have? You might be able to upgrade the OS to Tiger 10.4 or Leopard 10.5.
Even browsers for Tiger 10.4 will get the update message.
You could try a newer browser than Safari, which is obsolete, by downloading Firefox v2.0.0.20 at http://www.oldapps.com/mac/firefox.php
Cheers, Tom -
HT4463 How do I get back to the same page I was on?
When I have finished reviewing an app, if I click the back arrow in the top left corner it takes me back to the first page of the category. Not very user friendly when there are dozens of pages to click through to get back to where you were. How do I get back to the same page I was on?
This is what I mean: The users guide gives me all these instructions. BUT, it does not give instructions to just STOP. I don't
Pause a song
Tap .
Resume playback
Tap .
Raise or lower the volume
Drag the onscreen volume slider or use the iPad volume buttons.
Restart a song or a chapter in an audiobook or podcast
Tap .
Skip to the next song or chapter in an audiobook or podcast
Tap .
Go to the previous song or chapter in an audiobook or podcast
Tap twice.
Rewind or fast-forward
Touch and hold or —the longer you hold the control, the faster the song rewinds or fast-forwards.
View album art full-size
Tap the album cover when playing a song.
I don't want to pause, resume playback, restart or any of these things. i just want to STOP. How do I do that? -
I have many photos with file extension of .PDD and that Photo Deluxe 4 no longer will operate in Win 7. How can I open? Next in Elements 11, how do I load and print different pictures and different sizes options on the same page?
Thanks,
Shirsbmgrams wrote:
I have many photos with file extension of .PDD and that Photo Deluxe 4 no longer will operate in Win 7. How can I open?
See here:
Reading PhotoDeluxe PDD Files -
How an INDEX of a Table got selected when a SELECT query hits the Database
Hi All,
How an Index got selected when a SELECT query hits the Database Table.
My SELECT query is as ahown below.
SELECT ebeln ebelp matnr FROM ekpo
APPENDING TABLE i_ebeln
FOR ALL ENTRIES IN i_mara_01
WHERE werks = p_werks AND
matnr = i_mara_01-matnr AND
bstyp EQ 'F' AND
loekz IN (' ' , 'S') AND
elikz = ' ' AND
ebeln IN s_ebeln AND
pstyp IN ('0' , '3') AND
knttp = ' ' AND
ko_prctr IN r_prctr AND
retpo = ''.
The fields in the INDEX of the Table EKPO should be in the same sequence as in the WHERE clasuse?
Regards,
VijiHi,
You minimize the size of the result set by using the WHERE and HAVING clauses. To increase the efficiency of these clauses, you should formulate them to fit with the database table indexes.
Database Indexes
Indexes speed up data selection from the database. They consist of selected fields of a table, of which a copy is then made in sorted order. If you specify the index fields correctly in a condition in the WHERE or HAVING clause, the system only searches part of the index (index range scan).
The primary index is always created automatically in the R/3 System. It consists of the primary key fields of the database table. This means that for each combination of fields in the index, there is a maximum of one line in the table. This kind of index is also known as UNIQUE. If you cannot use the primary index to determine the result set because, for example, none of the primary index fields occur in the WHERE or HAVING clause, the system searches through the entire table (full table scan). For this case, you can create secondary indexes, which can restrict the number of table entries searched to form the result set.
reference : help.sap.com
thanx. -
URGENT: Insert multiple rows in a view object cache from the same Page
Please let me know whether I can get insert multiple rows in the same view object from a single page.
I'm using UIX on Jdeveloper 9.0.5.2
Thanks a lot.Hi,
please check Duncan Mills how-to on this
http://www.oracle.com/technology/products/jdev/tips/mills/JSP_Multi_Row_Edits.html
Frank -
Firefox 4 will not go to the selected webpage; the round arrow keeps turning and nothing happens or sometime it works after a minute or so. Internet Explorer works fine.
Configure your Firewall and Antivirus
https://support.mozilla.org/en-US/kb/configure-windows-firewall-allow-firefox-access -
Please help!! After installing OS X Maverick it told me to restart to fully update and now it keeps restarting and telling me that it has failed and to restart again, only to tell me again that it has failed and needs to restart. What should i do??
I went to the apple store and got my laptop looked over by a technician who then told me that the hard drive was broken, which was the reason why it was doing so. It's best to take it to the store and get a good decision on what's wrong with it and get the solution. I hope this helps.
-
How to increment an element in an array and put it back in the same array?
I have an array of values generated by another part of my program. My goal is to count the number of occurences for each integer value in the array and put these values in a new array. This new array will be a histogram of the input array. My approach is to do auto-indexing with a for loop. In the loop I use a "index array" to get the current value of the histogram array and a "replace array subset" to update the array element with "current+1". The problem is that when I wire the output of the "replace array subset" VI back to its input, I get a wire error. I guess I cannot wire it like that, but what should I do? Is there a completely different approach to do this that
is more elegant?
Thanks for your help!
BenoitHi Benoit,
I believe the thing that's missing is a shift register.
Right-click on the edge of your "For loop" and select add shift register.
Wire an initialized array to the shift register left terminal before entering the "for loop". Wire from this same terminal (inside the loop) as the source of the info used in your "index array" and replace array. The results of these two operations (just the way you are doing it now) gets wired to the "right terminal" of the shift register (inside the loop).
What ever you stuff into the right terminal, gets returned via the left terminal on the next iteration of the loop. When the loop is done, your final array of counts can be accessed by wiring from the "right terminal" (outside the loop).
Ben
Ben Rayner
I am currently active on.. MainStream Preppers
Rayner's Ridge is under construction -
I tried to update Firefox. Everything went well until restarting computer. Result was nothing....got the same as I had before. Each time I tried to open Firefox, I got message to restart computer to complete installation of update. This goes on over and over. I have tried to uninstall Firefox using Control Panel and I get same results.....a message to restart the computer and this repeats itself also.
You can try to boot the computer in Safe mode (press F8 on the boot screen) to see if that allows to remove the Firefox program folder (C:\Program Files\Mozilla Firefox\) if you can't uninstall Firefox or remove/rename that folder in regular mode.
-
Multiple details table on the same page
Newbi to APEX. Can I have muliple details table for update/insert in tabular format on the same page with the same master? Thanks!
In the meantime, I can answer to your questions:
· Why does JHeadstart not make use of the UIX-Struts integration (see Chapter 15 of the UIX developers Guide)?This has been done to allow the same page to be run both with Struts and MVC Framework, without needing to change the page. Using the UIX-Struts integration would have made the pages 'controller aware'.
· How do you specify which columns/attributes in a Table Layout are sortable?As far as generation is concerned, you can only specify the whole table to be sortable. In case of UIX you can post-gen modify the <sortableHeader> tag of each column separately. In case of JSP you can remove the <a href> tag for each column that you do not want to sort on.
Jan Kettenis
JHeadstart Team -
Two forms that update differrent tables on the same page?
I tried to add two forms that update different tables on to one page.
Problem is when I do that the forms gives me an error saying the field does not exist. It's like it is trying to update one table with the other tables fields.
As an example Say I have one forms that is for people table and another one that is the Jobs table.
When I go to update the people table, it sends the data for the jobs fields too I get an error like the field job description does not exist.
I have two different forms for these and everything.
I would hope it is possible to have two forms that update different tables on the same page.I was trying the exact same thing, but i managed to work round it by setting the steps to hide one region, so the user would enter the form see one region submit the region then direct back to the same page with the different region visible and the original hidden.
I don't know if this would be acceptable for you... -
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 to join two internal table rows in alternative manner into one internal table?
How to join two internal table rows in alternative manner into one internal table?
two internal tables are suppose itab1 & itab2 & its data
Header 1
Header 2
Header 3
a
b
c
d
e
f
g
h
i
Header 1
Header 2
Header 3
1
2
3
4
5
6
7
8
9
INTO itab3 data
Header 1
Header 2
Header 3
a
b
c
1
2
3
d
e
f
4
5
6
g
h
i
7
8
9Hi Soubhik,
I have added two additional columns for each internal table.
Table_Count - It represents the Internal Table Number(ITAB1 -> 1, ITAB2 -> 2)
Row_Count - It represents the Row Count Number, increase the row count value 1 by one..
ITAB1:
Header 1
Header 2
Header 3
Table_Count
Row_Count
a
b
c
1
1
d
e
f
1
2
g
h
i
1
3
ITAB2:
Header 1
Header 2
Header 3
Table_Count
Row_Count
1
2
3
2
1
4
5
6
2
2
7
8
9
2
3
Create the Final Internal table as same as the ITAB1/ITAB2 structure.
"Data Declarations
DATA: IT_FINAL LIKE TABLE OF ITAB1. "Final Internal Table
FIELD-SYMBOLS: <FS_TAB1> TYPE TY_TAB1, "TAB1
<FS_TAB2> TYPE TY_TAB2. "TAB2
"Assign the values for the additional two column for ITAB1
LOOP AT ITAB1 ASSIGNING <FS_TAB1>.
<FS_TAB1>-TABLE_COUNT = 1. "Table value same for all row
<FS_TAB1>-ROW_COUNT = SY-TABIX. "Index value
ENDLOOP.
"Assign the values for the additional two column for ITAB2
LOOP AT ITAB2 ASSIGNING <FS_TAB2>.
<FS_TAB2>-TABLE_COUNT = 2. "Table value same for all row
<FS_TAB2>-ROW_COUNT = SY-TABIX. "Index value
ENDLOOP.
"Copy the First Internal Table 'ITAB1' to Final Table
IT_FINAL[] = ITAB1[].
"Copy the Second Internal Table 'ITAB2' to Final Table
APPEND IT
LOOP AT ITAB2 INTO WA_TAB2.
APPEND WA_TAB2 TO IT_FINAL.
ENDLOOP.
"Sort the Internal Table based on TABLE_COUNT & ROW_COUNT
SORT IT_FINAL BY ROW_COUNT TABLE_COUNT.
After sorting, check the output for IT_FINAL Table, you can find the required output as shown above.
Regards
Rajkumar Narasimman -
How to view data in tables by selecting the synonym from the database objec
I could not figure out how to view data in tables by selecting the synonym from the database objects navigation tree. I had to first choose the synonym, view the details of the synonym to determine the table name, and then select the table from the database objects tree. Is this the only way available?
This functionality currently does not exist. I don't see it on the 1.1 statement of direction either, so perhaps someone from Oracle can give some insight as to when this could be expected.
Eric
Maybe you are looking for
-
Getting error while executing the SQL ( ver 8.1.7.0.0)
I am running a simple query involved with joins. When i ran the query with first set of criteria mentioned in the WHERE clause there is no problem. But when I try to run the same just by doing some correction in the WHERE clause, following errors is
-
CL_GOS_ATTACHMENT_LIST
Hi friends, in my program i create different attachments like this: CONCATENATE 'UPC' ordendpago INTO is_object-objkey SEPARATED BY space. * Indicamos el tipo de objeto URL is_object-objtype = 'FMPSO'. rel_doc-objkey = docum
-
So can you stram google video into your iWeb page and make it full screen?
-
Hi, I have an existing code that says select bukrs belnr gjahr buzei augdt shkzg dmbtr kokrs kostl aufnr hkont werks prctr projk fkber from bseg into table t_bseg for all entries in t_jrnl_chg_ptr where bu
-
Why does iust stop when installing mt.lion it says paused
will some one answer this quiston someone from apple cause been try ing to install for more than a week iknow iam not all that comupter savy but iam disabled had 8stroks 10 heart atts but not like thisneed help .