Trapping the selected row in the table using boolean checkbox
Hi,
I am using Jdev 11.1.1.2.0 with ADF 11g.
I have a screen that has a table with an additional column of 'Select boolean checkbox'. I have assigned a valuechangelistener method that helps me know which row has been selected. But the issue is it gets fired for all the rows in the table once I select/de-select a checkbox of 1 single row.
How can I handle this? Yes I can iterate through the table rows and check the values of the checkbox. But that is not I want, I also want to trap the de-select event.
What is the way to achieve this?
Timo Hahn wrote:
I don't see a bug in this behavior. This is because each row gets stamped when they render.
The way to do this is to use an attribute (which can be transient) to hold the status of the check box. Exactly this does the link I gave.
TimoHi,
Why I am saying it as a bug is because it is not firing the event for the record where the event has occurred. instead the event is fired for each row which should definitely not what is expected. And because of this we have to add an additional variable.
Now it becomes more complex if I have to handle de-selection as well, b'coz if the valuchangelistener is going to fire for all the records then I need to know which row was previously selected and now de-selected as now the de-selected record will also return a false.
So any better solution, anyone?
Similar Messages
-
How to obtain the selected rows in the model with af:Table using selectMany
Hi ,
I am using multi select af:Table and it is based on a programmatically populated view. When the table is single select I can use the getCurrentRow at the view implementation. I wonder whether there is a way to get list of selected rows within the view implementation for the multi-select scenario.
I saw some ways of doing it in the page's backing bean but it will be more appropriate if I could do it at the model project.
Thanks
My environment is JDeveloper 10.1.3.3 and jdk 1.4Thanks for your reply.
What you say makes sense. I thought there might be way of setting the selected rows in the model also as we do woth the current row.
But looks like these two different things.
Anyway I am doing it by passing the values through the backing bean.
Thanks -
How to delete or remove the selected row in a table
Dear Experts,
I'm facing a typical requirement in VC, similiar to variable selection screen in BI Queries :
I will have two tabes and if the user selects data from one table it will be moved to target table.I'm able to populate the target table with the value but I'm not able to delete the selected row from the source table.
Any help in this regard would be highlt appreciated.
Thankx in advance.
Regds,
Srinivasan.Hi
Follow the following steps -
1. Create two buttons.One for 'delete row' and another one for 'insert row'.
2. Assign the proper system action as per the name.
2. Change the name of both buttons as common name.
3. To trigger the actions simultaneously add a star before the action.( For Example : *select)
4. Change the visibility of any one of the button as 'false'. (so it will not get displayed)
5. Now, if u click the visible button both actions will be triggered simultaneously.
Regards
Sandeep -
How to get the selected rows in a table
Hi,
How to get the ids of all the selected rows. On Page load a query is executed that shows the data in a table with a checkbox in the first column to select the rows and delete. Now if a user select multiple rows how do I get the ids of selected rows in the backend code.
ThanksPlease search the forum before posting questions.
refer following thread for table selection.
Re: Record selection with MessageCheckBox and print the selected record.
--Prasanna -
How to populate the selected row details of table in the next view?
hi,
Im having a table, on selecting a particular row of a table by clicking on a radio button. i need that row details to be passed on(populated) to the next view when i navigate to that view by clicking on a button?
Thanks & Regards,
SureshHi Suresh,
Your scenario is simple. Just follow the ex as shown below
(Assuming you want default selection view provided by table itself.)
1>Create 2 views (Ex:A and B)
2>Create a Context with a node and attributes(For Ex:Person as node and Fname and Last Name as attributes
2>In A view create a table with F name and L Name(map to context as well) and a action button to navigate to B view when you selected a particualr row o.k
3>In B view, create a TextView with mapping to LastName(or all the data if you want from input selection) from the context
If you want you can add back action button from B view to A view for easy navigation.
4>Execute the application and select any row in the table appeared, press next action button,you can see that the selected row details will be shown in second(B) view.
If you do the above example, I think you can easily find the solution for navigation issue.. try it out.
In case if you are not able to ...let me know..I have that example.
Hope that helps
Regards
Praveen -
How to save the selected rows from Advance table into database
Hi
I have requirement like..
In custom page , Manager Search the Candidates and selects the candidate ROWS from advance table.
The reqt is how to save the selected multiple rows into the database.hi Reetesh,
In Custom page
Supoose the Recruiter Search is for Position Finance Mangager , it retrieves 100 rows , out of which Recruiter select 10 rows .
So in Such scenario how to save this 10 rows against Recruiter
, i mean , Is i need to create custom table, to save Recruiter , these selected 10 rows.
I hope u understand my question -
How to directly access a SELECTED row in a table using MasterColumn
I'm using a table with MasterColumn (TreeByNestingTableColumn) contains checkbox element.
In order to get the selected row I have to navigate the whole tree which is a very expensive when the tree is big.
I also tried without check box by just using MULTI ROW SELECTION property of the table but that didn't work.
Is there a way to directly access selected row like we do in the standrard table control?
Any help would be appretiated.
regards
Qamarhi, Qamar
Just Check out the Following Link's
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webdynpro/tutorial on creating a tree structure in a table - 27.htm
and also if u had not seen it before...............
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webdynpro/tutorial on creating tables in web dynpro - 11_0_.htm
regard's
Dheerendra -
How to move the selected rows from a table control in dialog programming
hiiiiiiii Every1
I have to update some fields for a slected row in table control on click of a button and save it in database.
Regards
Sachin Dhingrasee below example, I have added INSERT option after DELETE option, you can use same table or you can use differnt table by populating into that table and insert into the db table. If you want to use same internal table then use below code
LOOP AT itab INTO demo_conn WHERE mark = 'X'.
insert into table from itab.
ENDLOOP.
REPORT demo_dynpro_tabcont_loop_at.
CONTROLS flights TYPE TABLEVIEW USING SCREEN 100.
DATA cols LIKE LINE OF flights-cols.
DATA: ok_code TYPE sy-ucomm,
save_ok TYPE sy-ucomm.
DATA: itab TYPE TABLE OF demo_conn.
TABLES demo_conn.
SELECT * FROM spfli INTO TABLE itab.
LOOP AT flights-cols INTO cols WHERE index GT 2.
cols-screen-input = '0'.
MODIFY flights-cols FROM cols INDEX sy-tabix.
ENDLOOP.
CALL SCREEN 100.
MODULE status_0100 OUTPUT.
SET PF-STATUS 'SCREEN_100'.
ENDMODULE.
MODULE cancel INPUT.
LEAVE PROGRAM.
ENDMODULE.
MODULE read_table_control INPUT.
MODIFY itab FROM demo_conn INDEX flights-current_line.
ENDMODULE.
MODULE user_command_0100 INPUT.
save_ok = ok_code.
CLEAR ok_code.
CASE save_ok.
WHEN 'TOGGLE'.
LOOP AT flights-cols INTO cols WHERE index GT 2.
IF cols-screen-input = '0'.
cols-screen-input = '1'.
ELSEIF cols-screen-input = '1'.
cols-screen-input = '0'.
ENDIF.
MODIFY flights-cols FROM cols INDEX sy-tabix.
ENDLOOP.
WHEN 'SORT_UP'.
READ TABLE flights-cols INTO cols WITH KEY selected = 'X'.
IF sy-subrc = 0.
SORT itab STABLE BY (cols-screen-name+10) ASCENDING.
cols-selected = ' '.
MODIFY flights-cols FROM cols INDEX sy-tabix.
ENDIF.
WHEN 'SORT_DOWN'.
READ TABLE flights-cols INTO cols WITH KEY selected = 'X'.
IF sy-subrc = 0.
SORT itab STABLE BY (cols-screen-name+10) DESCENDING.
cols-selected = ' '.
MODIFY flights-cols FROM cols INDEX sy-tabix.
ENDIF.
WHEN 'DELETE'.
READ TABLE flights-cols INTO cols WITH KEY screen-input = '1'.
IF sy-subrc = 0.
LOOP AT itab INTO demo_conn WHERE mark = 'X'.
DELETE itab.
ENDLOOP.
ENDIF.
WHEN 'INSERT'.
READ TABLE flights-cols INTO cols WITH KEY screen-input = '1'.
IF sy-subrc = 0.
LOOP AT itab INTO demo_conn WHERE mark = 'X'.
itab1 = itab.
modify itab1.
ENDLOOP.
ENDIF.
if not itab1 is initial.
INSERT dbtab FROM TABLE itab1.
endif.
ENDCASE.
ENDMODULE. -
How determine the selected rows in a table
Hi All,
I have a table with a multi selection enabled. Now if the 3 and 5 rows are selected how do I determine this using properties or methods/apis?
Thanks in advance.
Best regards,
DivyaLet <i>Rows </i>be the context node to which the property Table.<i>dataSource</i> is bound.
Then you get the selected context elements / table rows via the context API:
for (int j = 0, n = wdContext.nodeRows().size(); j < n; ++j)
if (wdContext.nodeRows().getLeadSelection() == j
|| wdContext.nodeRows().isMultiSelected(j)
/* row at index j is selected */
Armin -
How to Calculate sum for the selected rows in ALV gird using custom button
Hi I am trying to implement an ALV Grid display where the user can select few rows in the output and if he click on some custom button he should get the sum for only those rows.
Can anyone give me some idea regarding this.
Thanks in advanceWhile building the fieldcatalog for amount field use gt_fieldcat-do_sum = 'X'. And use the below for doc type sorting and subtotal.
* ALV data declarations
data: it_sortcat type slis_sortinfo_alv occurs 1,
wa_sort like line of it_sortcat.
perform build_sortcat.
*& Form build_sortcat
* Build Sort catalog
FORM build_sortcat .
wa_sort-spos = 1.
wa_sort-fieldname = 'EBELN'.
wa_sort-SUBTOT = 'X'. "subtotals any totals column by this field
* gd_sortcat-tabname
APPEND wa_sort TO it_sortcat.
wa_sort-spos = 2.
wa_sort-fieldname = 'EBELP'.
* gd_sortcat-tabname
APPEND wa_sort TO it_sortcat.
ENDFORM. " build_sortcat
call function 'REUSE_ALV_LIST_DISPLAY'
exporting
i_callback_program = gd_repid
i_callback_top_of_page = 'TOP-OF-PAGE'
is_layout = gd_layout
it_fieldcat = fieldcatalog[]
it_sort = it_sortcat
i_save = 'X'
tables
t_outtab = it_ekko
exceptions
program_error = 1
others = 2.
Regards,
Chandru -
V v urgent ... how to get the selected rows in the vl02n transaction
Hi ,
I have requirement that i have selected the line items in the vl02n transaction.
If I select only one row there is option gs_get_cursor-line.
If I select more than one line item at a time I am getting only the last value in to gs_get_cursor-line.
Can anybody let me know how to get the multiple line items that are selected
It is very urgent ..
Plz HelpHi,
can you check the E_row_id .
v_row type LVC_S_ROW
read table itab index E_ROW-index.
regards,
Ajay
Edited by: Ajay on Feb 14, 2008 6:22 PM -
How can I get the values of the selected row in the report?
Hi All:
I have a dynamic query(lexical parameters)that columns are selected at the run time. And depend on the values, I'd like to do another query just for certain row. For example, when I double click on the fifth column of the fifth row. I'd like to collect all the column values of this fifth row. I think It likes drill-down report, but I don't need a detail report. I just want a string of the combination column's values. Would you please help?
Thanks, in advances, for your help.
TDHi:
I got it.
Thx,
TD -
Passing selected rows in a table to Popup Iview
Hi all,
I have a main iview in which i search and display some data in a table. Users can select multiple rows from the table and upon clicking on a button in the table toolbar, all the selected rows should be passed to a popup iview.
But, when i tried, only one value is passed to the popup.
I need to update a set of rows together from the popup iview.
Is it a limitation of pop iviews in VC, or did i miss out anything?
I have selected "multiple select" option for the source table.
Can anyone advice us on this???
Thanks alot in advance
ShobinHi Sreeni,
Thanks alot for your reply.
As I saw in some forum posts in SDN, multiple data rows can not be passed to a pop up.
My application has a list of submitted appointment orders which the authorized person can approve. I wanted a popup in order to provide a confirmation message when the user multi select and approve many AOs together.
I found a work around without using pop ups. Instead, I used layers to show the confirmation message. I passed the selected rows to another table using signal in and out.
It works now.
Thanks alot
Shobin -
Enable/disable operation buttons according to the selected row in table?
Hi,
I used JDev 11.1.1.2.0
On my main page, it has a query section and display search result to a table component, and also has some operation buttons like (update/delete) on the toolbar.
I want to enable/disable the operation buttons according to some filed value of the selected row in the table, and I searched the OTN forum, found more questions like this but seemed no found one right solution.
The table is single selection, and has a status column, its data type is Integer, and I want to enable buttons when the selected row's status field value is 0 or 1, disable buttons when status value is other values.
Table code like:
<af:table value="#{bindings.VO1.collectionModel}" var="row"
rows="#{bindings.VO1.rangeSize}"
emptyText="#{bindingsVO1.viewable ? 'No data to display.' : 'Access Denied.'}"
fetchSize="#{bindings.VO1.rangeSize}"
rowBandingInterval="0"
filterModel="#{bindings.VOCriteriaQuery.queryDescriptor}"
queryListener="#{bindings.VOCriteriaQuery.processQuery}"
filterVisible="true" varStatus="vs"
selectedRowKeys="#{bindings.VO1.collectionModel.selectedRow}"
selectionListener="#{bindings.VO1.collectionModel.makeCurrent}"
rowSelection="single" id="resId1">
Operation buttons code like:
<af:commandToolbarButton text="Update" id="ctb2" action="editDAF"/>
Any suggestion will be great help.
Thanks,
zeroxinHi,
create an attribute binding in the PageDef file for the status field. Then setup the button PartialTriggers property to point to the table ID. The button's disabled property then points to the status attribute binding like
#{bindings.statusField.inputValue=='value'}
Frank -
How to read the selected row value of a table node
hi
i have a node of table type, displaying few records & with each record a NEXT button is there.
now i want to read the values of the selected row of the table & want to process next with NEXT button.
pls tell me how to read the values of the selected row only.
reds.data : lo_nd type ref to if_wd_context_node,
lo_nd1 type ref to if_wd_context_node,
lt_temp type wdr_context_element_set,
wa_temp type ref to if_wd_context_element,
ls_node1 type sflight,
lt_node1 type STANDARD TABLE OF sflight.
lo_nd = wd_context->get_child_node('CN_MAIN').
CALL METHOD lo_nd->get_selected_elements
RECEIVING
set = lt_temp.
loop at lt_temp INTO wa_temp.
CALL METHOD wa_temp->get_static_attributes
IMPORTING
static_attributes = ls_node1.
APPEND ls_node1 TO lt_node1.
CLEAR ls_node1.
ENDLOOP.
'CN_MAIN' is the node whose selected values are to be picked and stored in internal table lt_node1.
Other option by Thomas :
DATA lo_nd_cn_main TYPE REF TO if_wd_context_node.
DATA lt_temp TYPE wdr_context_element_set.
FIELD-SYMBOLS <wa_temp> LIKE LINE OF lt_temp.
DATA lt_node1 TYPE wd_this->elements_cn_main.
FIELD-SYMBOLS <ls_node1> LIKE LINE OF lt_node1.
lo_nd_cn_main = wd_context->get_child_node( name = wd_this->wdctx_cn_main ).
lt_temp = lo_nd_cn_main->get_selected_elements( ).
LOOP AT lt_temp ASSIGNING <wa_temp>.
APPEND INITIAL LINE TO lt_node1 ASSIGNING <ls_node1>.
<wa_temp>->get_static_attributes( IMPORTING STATIC_ATTRIBUTES = <ls_node1> ).
ENDLOOP.
Maybe you are looking for
-
I enter dates and appointments on my iPhone Calendar but they do not sync with my iCal or iCloud Calendar on my Mac Pro. BUT dates entered on the Mac Pro do sync and appear on my iPhone Calendar. What am I doing wrong please? How do I resolve it? Eve
-
Got a new MacBook Pro and migrated my settings and applications from old computer. Reinstalled Microsooft Office from a disk, after I opened a document and it said I was missing some software components. Now when I open any office application, I get:
-
Hi, Can anyoneon BT Infinity tell me what their experience is with xbox live and in particular 1st person shooters like MW2 or Black Ops. I am currently with Virgin and their P2P throttling has completely ruined online gaming. Its super laggy and if
-
SAP_WAPI_DECISION_COMPLETE : Processing can be rejected option
In my workflow I am using a decision task which sometimes has to be approved in the background. This decision task has two outcomes Approve and Reject. I am also using the option "PROCESSING CAN BE REJECTED" under details tab of the approval step in
-
I just left my iPod on hold for two minutes when i came back the screen was blank and it wont come back on the hold switch is not on, i have tried plugging it in to my Mac but it wont recognize it and i have tried re setting it Its dead! Any ideas ot