Tableview OnClientCellClick
I used <b>setOnClientCellClick</b> but when ever its triggered its going to the java file and searching for the handler. I gave same name in the jsp which it doesnt find But the script is there when i check the source code. It always looks for the handler in
the main Java page(Jspdynpage)
Button works fine but table when i give within <b><u><%tablename.setOnClientCellClick %></u></b> creates this prob and there is no tag lib for tableview.
Any other suggestions why it might not be working?
i am using Jspdynpage
George
Hi...
give like this
<script language="javascript">
function process(){
catch here what u want...
</script>
<hbj:tableView id="myTableView1"
design="ALTERNATING"
headerVisible="true"
footerVisible="true"
fillUpEmptyRows="true"
visibleRowCount="5"
width="500 px" >
<% myTableView1.setJsObjectNeeded(true);
myTableView1.setOnClientCellClick("process()"); %>
</hbj:tableView>
regards,
Chinnadurai.R
Similar Messages
-
OnClientCellClick in htmlb tableview
hi
I have created a timer which will auto save every 10min.
I want the timer to reset each time a user clicks in a tableview.
I have already written the reset function, but my onClientCellClick doesn't work.
my table view looks like this:
<hbj:tableView
id="MultiRaterTable"
model="data.model"
headerVisible="false"
footerVisible="false"
design="ALTERNATING"
selectionMode="NONE"
visibleFirstRow="1"
visibleRowCount="100"
navigationMode="BYPAGE"
fillUpEmptyRows="false"
onNavigate="onNavigate"
onClientCellClick="InitializeTimer()">
<%
MultiRaterTable.setCellHeaderVisible(false);
MultiRaterTable.setUserTypeCellRenderer(new MRCellRenderer());
%>
</hbj:tableView>
but when I try to run the iview I get error:
Attribute 'onClientCellClick' not found in tag library 'HTMLB' for the tag tableView
pls help
thanks in advance
Anton KruseHi,
There is no TagLlib for "onClientCellClick" in tabelview.so use classlib for that as given below
<%MultiRaterTable.setClientCellClick(colIndex, "JavaScript") ;%>
or
<%MultiRaterTable.setClientCellClick("colKey", "JavaScript");%>
Refer these links also
http://etower.towersemi.com/irj/portalapps/com.sap.portal.pdk.htmlb.htmlbmanuals/docs/index.html
http://help.sap.com/saphelp_nw70/helpdata/en/d0/55074155bcf26fe10000000a1550b0/frameset.htm
Regards,
Tamil K -
Hello, I've created a HTMLB tableview, and i want when the user press in a cell, generates a context menu (Like right-click mouse).
I try to made it calling onCellClick(onPressCell) or onClientCellClick(onPresscell), but later i don't know how to catch the event and generate the context menu.
Somebody can help me??
ThanksOK,
HTMLB in EP5 has no PopupTrigger. You'll need to render an Image or InputField into each table cell (see PDK on how to do this.). Then (before rendering of course), you can call setHoverMenu(MyHoverMenu) on these components. The HoverMenu class itself has a setMenuTrigger method, which is used to define when (click/mouseover/etc) the HoverMenu will pop up.
Greets,
Armin -
Modify hbj:tableView with JavaScript
Hi forum-team,
does anyone know if it is possible to modify the contents of a hbj:tableView-Cell with JavaScript (e.g. modify the text within a cell)?
I only found some getClickedRow methods within the JavaScript API.
Regards,
FrankHi,
I can't get a code for this but can guide you.
There is onClientCellClick event for tableview which can be used for this. You will have to implement separate methods for each cell click, I hope. Also this is a classlib and not taglib. Check the documentation for more info on this.
http://help.sap.com/saphelp_nw70/helpdata/en/fd/01f34026d70b06e10000000a155106/frameset.htm
Also check these.
onClientRowSelection for tableView's
onClientCellClick in htmlb tableview
Regards,
Harini S -
How to display an alert message on click of link in tableview
Hi,
Following is the code for a tableview in layout section of a BSP( i have specified only one tableview column here). The requirement is to display an alert message on click of link in the first column that is "evbeg". Can anyone please help me how to achieve this? Appreciate quick response on this.
CREATE OBJECT lr_dateiterator TYPE cl_lso_bsp_it_trdates
EXPORTING im_application = application
im_tform = trainingform.
<htmlb:tableView id = "dates"
table = "<%= dates %>"
iterator = "<%= lr_dateiterator %>"
width = "100%"
rowCount = "<%= lp_len %>"
footerVisible = "FALSE"
sort = "SERVER" >
<htmlb:tableViewColumn columnName = "evbeg"
type = "user"
title = "<%= otr(LSO_FRONTEND/schedule) %>"
tooltipHeader = "<%= otr(LSO_FRONTEND/schedule) %>"
sort = "TRUE" >
</htmlb:tableViewColum>
Thanks and Regards,
Archana.you have to code in the iterator for this.
in the render_cellstart method of the iterator you need to code.
this is for a column.
when 'MATNR'.
data: text type string.
text = 'disp_alert()'. "this java script i placed in the page
data: lo_link type ref to cl_htmlb_link.
create object lo_link.
lo_link->id = p_cell_id.
lo_link->onclientclick = text.
lo_link->text = <fs>-matnr.
p_replacement_bee = lo_link.
below is the java script i added in my page..
< sc ri pt type="text/javasc ript" >
f u n ction disp_alert()
a l e rt("helloworld");
< /s c ript > -
SIGABRT error when choosing a row of a tableview
Hello, I am creating an iPhone app and I keep getting a "SIGABRT" error. I have a tableview where I want a separate webpage pushed for each rows.
Currently, what happens is that the table displays; however, when I pick a row it gives me a SIGABRT error. Please help.
Here is my first view (table view) .h file:
#import <UIKit/UIKit.h>
@interface videoTableViewController : UITableViewController
NSArray *videos;
@property (strong, nonatomic) NSArray *videos;
@end
Here is my first view (table view) .m file:
#import "videoTableViewController.h"
#import "videoURLController.h"
@interface videoTableViewController ()
@end
@implementation videoTableViewController
@synthesize videos;
- (id)initWithStyle:(UITableViewStyle)style
self = [super initWithStyle:style];
if (self) {
// Custom initialization
return self;
- (void)viewDidLoad
[super viewDidLoad];
videos = [NSArray arrayWithObjects:@"Welcome", @"Hello", @"Goodbye", nil];
// Uncomment the following line to preserve selection between presentations.
// self.clearsSelectionOnViewWillAppear = NO;
// Uncomment the following line to display an Edit button in the navigation bar for this view controller.
// self.navigationItem.rightBarButtonItem = self.editButtonItem;
- (void)viewDidUnload
[super viewDidUnload];
// Release any retained subviews of the main view.
// e.g. self.myOutlet = nil;
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
return (interfaceOrientation == UIInterfaceOrientationPortrait);
#pragma mark - Table view data source
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
// Return the number of sections.
return 1;
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
// Return the number of rows in the section.
return [self.videos count];
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
static NSString *CellIdentifier = @"videoCell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
// Configure the cell...
NSUInteger row = [indexPath row];
cell.textLabel.text = [videos objectAtIndex:row];
if (row == 0)
cell.detailTextLabel.text = @"Welcome";
if (row == 1)
cell.detailTextLabel.text = @"What we value";
if (row == 2)
cell.detailTextLabel.text = @"What does Honor mean?";
return cell;
// Override to support conditional editing of the table view.
- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath
// Return NO if you do not want the specified item to be editable.
return YES;
// Override to support editing the table view.
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath
if (editingStyle == UITableViewCellEditingStyleDelete) {
// Delete the row from the data source
[tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationFade];
else if (editingStyle == UITableViewCellEditingStyleInsert) {
// Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view
// Override to support rearranging the table view.
- (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath
// Override to support conditional rearranging of the table view.
- (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath
// Return NO if you do not want the item to be re-orderable.
return YES;
#pragma mark - Table view delegate
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
videoURLController *detailViewController = [[videoURLController alloc] initWithNibName:@"videoTableViewController" bundle:nil];
UIWebView *webView = [[UIWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 480)];
if (indexPath.row == 0){
[webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://www.google.com"]]];
// Pass the selected object to the new view controller.
[self.navigationController pushViewController:detailViewController animated:YES];
@end
Here is my videoURLController (second view/web view) .h file?
#import <UIKit/UIKit.h>
@interface videoURLController : UIViewController
@property (strong, nonatomic) IBOutlet UIWebView *webView;
@end
Here is my videoURLController (second view/web view) .m file?
#import "videoURLController.h"
@interface videoURLController ()
@end
@implementation videoURLController
@synthesize webView;
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Custom initialization
return self;
- (void)viewDidLoad
[super viewDidLoad];
// Do any additional setup after loading the view.
- (void)viewDidUnload
[super viewDidUnload];
// Release any retained subviews of the main view.
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
return (interfaceOrientation == UIInterfaceOrientationPortrait);
@endHello, I am creating an iPhone app and I keep getting a "SIGABRT" error. I have a tableview where I want a separate webpage pushed for each rows.
Currently, what happens is that the table displays; however, when I pick a row it gives me a SIGABRT error. Please help.
Here is my first view (table view) .h file:
#import <UIKit/UIKit.h>
@interface videoTableViewController : UITableViewController
NSArray *videos;
@property (strong, nonatomic) NSArray *videos;
@end
Here is my first view (table view) .m file:
#import "videoTableViewController.h"
#import "videoURLController.h"
@interface videoTableViewController ()
@end
@implementation videoTableViewController
@synthesize videos;
- (id)initWithStyle:(UITableViewStyle)style
self = [super initWithStyle:style];
if (self) {
// Custom initialization
return self;
- (void)viewDidLoad
[super viewDidLoad];
videos = [NSArray arrayWithObjects:@"Welcome", @"Hello", @"Goodbye", nil];
// Uncomment the following line to preserve selection between presentations.
// self.clearsSelectionOnViewWillAppear = NO;
// Uncomment the following line to display an Edit button in the navigation bar for this view controller.
// self.navigationItem.rightBarButtonItem = self.editButtonItem;
- (void)viewDidUnload
[super viewDidUnload];
// Release any retained subviews of the main view.
// e.g. self.myOutlet = nil;
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
return (interfaceOrientation == UIInterfaceOrientationPortrait);
#pragma mark - Table view data source
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
// Return the number of sections.
return 1;
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
// Return the number of rows in the section.
return [self.videos count];
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
static NSString *CellIdentifier = @"videoCell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
// Configure the cell...
NSUInteger row = [indexPath row];
cell.textLabel.text = [videos objectAtIndex:row];
if (row == 0)
cell.detailTextLabel.text = @"Welcome";
if (row == 1)
cell.detailTextLabel.text = @"What we value";
if (row == 2)
cell.detailTextLabel.text = @"What does Honor mean?";
return cell;
// Override to support conditional editing of the table view.
- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath
// Return NO if you do not want the specified item to be editable.
return YES;
// Override to support editing the table view.
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath
if (editingStyle == UITableViewCellEditingStyleDelete) {
// Delete the row from the data source
[tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationFade];
else if (editingStyle == UITableViewCellEditingStyleInsert) {
// Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view
// Override to support rearranging the table view.
- (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath
// Override to support conditional rearranging of the table view.
- (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath
// Return NO if you do not want the item to be re-orderable.
return YES;
#pragma mark - Table view delegate
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
videoURLController *detailViewController = [[videoURLController alloc] initWithNibName:@"videoTableViewController" bundle:nil];
UIWebView *webView = [[UIWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 480)];
if (indexPath.row == 0){
[webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://www.google.com"]]];
// Pass the selected object to the new view controller.
[self.navigationController pushViewController:detailViewController animated:YES];
@end
Here is my videoURLController (second view/web view) .h file?
#import <UIKit/UIKit.h>
@interface videoURLController : UIViewController
@property (strong, nonatomic) IBOutlet UIWebView *webView;
@end
Here is my videoURLController (second view/web view) .m file?
#import "videoURLController.h"
@interface videoURLController ()
@end
@implementation videoURLController
@synthesize webView;
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Custom initialization
return self;
- (void)viewDidLoad
[super viewDidLoad];
// Do any additional setup after loading the view.
- (void)viewDidUnload
[super viewDidUnload];
// Release any retained subviews of the main view.
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
return (interfaceOrientation == UIInterfaceOrientationPortrait);
@end -
Tableview getting refreshed when changing data in the rows
Hi Gurus,
Iu2019m doing a BSP with MVC. The requirement is as below.
In the main page there is a button u2018Create Orderu2019, to create a sales order, once I click this button, another screen (pop up) comes up and within that I have a Tableview display with the below fields with the data of 20 records.
Material no
Quantity
Delivery Date
Here user is allowed to choose the quantity and delivery date by selecting each row.(with MULTISELECT option in BSP)
The issue is after I select first row and change the quantity and date, and if I click on second row, the Tableview gets refreshed to enable the second row to be editable and the changes what I did on the first row are also refreshed.
So i want the Tableview not to be refreshed when selecting the multiple rows. So that I can keep the changes I make to the quantity and date fields Can you please suggest any method.
Cheers,
Srini.Hi Srinivas,
You need to capture the value entered by user in Quantity and date field and update the internal table with these values for the current selected row.
For ex.
The tableView code is like:
<htmlb:tableView id = "material"
headerText = "<%= otr(Z_SUS/HEADER_TEXT_MATERIALS) %>"
headerVisible = "true"
design = "alternating"
onRowSelection = "MyEventRowSelection"
selectionMode = "MULTILINEEDIT"
width = "880"
filter = "SERVER"
emptyTableText = "<%= otr(Z_SUS/EMPTYTABLE_MATERIALS) %>"
iterator = "<%= iterator %>"
table = "<%= gt_materials %>" />
In eventhandler OnInputProcessing :
DATA: lt_fields type tihttpnvp ,
ls_fields like line of lt_fields.
call method request->get_form_fields
changing
fields = lt_fields
Now the internal table lt_fields contains all the editable cell values , just update the internal table of your tableview with these values.
You can try these threads
[Thread-I.|Re: Retrieve changes made in tableView]
[Thread-II|https://forums.sdn.sap.com/click.jspa?searchID=24460585&messageID=5516977]
Search the forum for more information on this.
Regards,
Anubhav -
Issue with tableview data storing
Hi,
We are using MVC model, it has view-model-main controller and sub controller. I am displaying
4 columns on the tableview where 2 columns are editable. when i click update button on the screen
i have called do_handle_event method on sub controller, when i debug the code i am getting
table as initial always. I am not sure what am i missing here..can any one help me ?
Here is code
method DO_HANDLE_EVENT
data: o_event type ref to cl_htmlb_event,
visible_row type int4,
visible_last_row type int4,
visrow_count type int4 value 10,
it_osha like line of it_mfgprf_osha,
wa_osha type zpp1_mfgprf_osha,
o_app type ref to zcl_mfg_perf.
o_event = cl_htmlb_manager=>get_event( request ).
if o_event is not initial.
if o_event->id = 'osha_update'.
data: tv type ref to cl_htmlb_tableview.
tv ?= cl_htmlb_manager=>get_data(
request = runtime->server->request
name = 'tableView'
id = 'it_osha_history' ).
if tv is not initial.
data: tv_data type ref to cl_htmlb_event_tableview.
tv_data = tv->data.
if it_mfgprf_osha is not initial.
visible_row = tv_data->visiblefirstrowindex.
visible_last_row = visrow_count + visible_row - 1.
loop at it_mfgprf_osha into it_osha
from visible_row to visible_last_row.
it_osha-zosha_ytd = tv_data->get_cell_value(
row_index = sy-tabix column_index = 3 ).
endloop.
endif.
endif.
endif.
endif.
view
<htmlb:tableView id = "it_osha_history"
table = "<%=o_app->it_mfgprf_osha%>"
iterator = "<%=o_cont->osha_iterator%>"
headerText = "OSHA History"
headerVisible = "True"
sort = "SERVER"
onHeaderClick = "sort"
visibleRowCount = "10"
width = "100%"
design = "ALTERNATING"
allRowsEditable = "<%=o_app->ALLOW_RECORD_EDIT%>" />
Thanks!
LakshmikandhHi Guys,
Thanks for valuable suggestion. Let me give you over view of application. We have sub-controller
for all views, one controller and one model for those sub controllers and views.
Hi Sebastian,
Are you suggesting to use new model for all table view iterator ?
If i use iterator on that one model i can't use
that for other table view iterator..right ?
Hi raju,
If i get all the values on 'do_handle_data' method in the controller class, can i use that
for other table view iterator if i create a new table view iterator? can i have some
outline(example coding) of passing those values to sub controller ?
Thanks in advance.
Lakshmikandh -
Updation of internal table from tableview
Hi,
I am using a tableview in which coloumn-3(last_days) is editable.After editing it when user pressess on the button SAVE I should capture the changes and update it in database.
But here I am facing a problem.Always the field last_days is being filled with '000' irrespective of the value entered.
The below is the piece of code which I had written:
DATA: tv TYPE REF TO CL_HTMLB_TABLEVIEW,
wa like line of R_GT_VIEW.
tv ?= CL_HTMLB_MANAGER=>GET_DATA(
request = runtime->server->request
name = 'tableView'
id = 'tvx' ).
IF tv IS NOT INITIAL.
DATA: tv_data TYPE REF TO CL_HTMLB_EVENT_TABLEVIEW.
tv_data = tv->data.
loop at R_GT_VIEW into wa .
wa-last_days = tv_data->get_cell_value( row_index = sy-tabix
column_index = '3' ).
modify R_GT_VIEW from wa index sy-tabix.
endloop.
ENDIF.
Helpful answers will be rewarded.
ThanksHi,
Sorry....coz I replied in a haste...
Just to let you know....The method get_cell_value will not work if you are rendering a column as InputField.
Use the below mentioned code and this it should work....
DATA: tv TYPE REF TO cl_htmlb_tableview.
wa like line of R_GT_VIEW.
tv ?= cl_htmlb_manager=>get_data(
request = runtime->server->request
name = 'tableView'
id = 'tvx' ).
IF tv IS NOT INITIAL.
DATA: tv_data TYPE REF TO cl_htmlb_event_tableview.
tv_data = tv->data.
LOOP AT itab INTO wa .
data : if_value type ref to cl_htmlb_inputfield.
data : p_cell_id type string,
row_ix type string.
clear p_cell_id.
clear row_ix.
row_ix = sy-tabix.
condense row_ix.
concatenate p_cell_id 'TV_' row_ix '_3' into p_cell_id. "generating cell ID...Make Sure to use ur TableView Id instead of TV
if_value ?= cl_htmlb_manager=>get_data( request = request
name = 'inputField'
id = p_cell_id
if if_value->value is not initial.
wa-last_days = if_value->value.
endif.
MODIFY itab FROM wa INDEX sy-tabix.
ENDLOOP.
<i>Do reward each useful answer..!</i>
Thanks,
Tatvagna. -
How to read vales from dropdownlistbox placed in tableView Cells
Hi,
Thanks for reply.. I got problem of reading values from Dropdownlist box placed in tableView Cells. Please correct me or give some sample to read vales from dropdownlistbox placed in tableView Cells.
TableView column defined as
<htmlb:tableViewColumn columnName = "OT_REASON_CODE"
title = "OT Reason"
type = "User"
width = "6"
edit = "true" >
<htmlb:dropdownListBox id = "rcode"
table = "<%= I_YH008 %>"
nameOfKeyColumn = "OT_REASON_CODE"
nameOfValueColumn = "OT_REASON_DESC" />
</htmlb:tableViewColumn>
OnInput processing I am trying to read dorpdown list values selected.
W_YH022-ENDUZ = TABLE_EVENT->GET_CELL_VALUE(
ROW_INDEX = SY-TABIX
COLUMN_INDEX = 3 ). " Get time
DATA: data TYPE REF TO CL_HTMLB_DROPDOWNLISTBOX.
DATA: value type string.
value = TABLE_EVENT->GET_CELL_ID( row_index = SY-TABIX
column_index = '7'). " get Cell ID
data ?= CL_HTMLB_MANAGER=>GET_DATA(
request = runtime->server->request
name = 'dropdownlistbox'
id = value
IF data IS NOT INITIAL.
W_YH022-OT_REASON_CODE = data->selection. " +Cell Values...I am not getting cell values here+
endif.Hi:
Do like this
Layout
<htmlb:dropdownListBox id="mydropdownlist" >
<htmlb:listBoxItem key = "bpno"
value = "Business Partner Details" />
<htmlb:listBoxItem key = "bpaddress"
value = "Business Partner Address" />
</htmlb:dropdownListBox>
OnInpurProcessing event - >
DATA: lcl_dropdown TYPE REF TO cl_htmlb_dropdownlistbox.
data : selection2 type string.
lcl_dropdown ?= cl_htmlb_manager=>get_data(
request = runtime->server->request
name = 'dropdownListBox'
id = 'mydropdownlist' ).
IF NOT lcl_dropdown->selection IS INITIAL.
selection2 = lcl_dropdown->selection.
ENDIF.
Regards
Shshi -
"Select All" in tableview does not trigger event?
Hi,
I have a MULTISELECT table, and whenever I use the "Select all" or "Deselect all" feature, I don't seem to be able to capture the resulting event... Whenever I select one line, there's always a "tableView" event being triggered, allowing me to run the following code to recover the selected entries:
me->check_groups = table_event->GET_ROWS_SELECTED(
includeCurrentSelectedRow = 'X' ).
However, when I select all entries, there's not even an event being generated:
event = CL_HTMLB_MANAGER=>get_event( request ).
if event is not initial...
endif.
The above code fails; no event seem to be generated!!
Have I missed out on something; or is this a bug...? I would assume the built-in "select all" would trigger some kind of event... or do we have to check/program this manually?
Trondhi trond,
what i know is that for catching <b>request</b> u have to use <b>runtime</b> object.
so u may try this:
event = CL_HTMLB_MANAGER=>get_event( <b>runtime->server-></b>request ).
might be possible it will solve your problem.
Regards,
kamaljeet -
How to get editable value from thtmlb:tableView
Hi,
I create a tableview using tag thtmlb:tableView and set column editable. Now the value in the tableview can be changed, but I don't know how to get the changed value from tableview. Pls help me.
thanks in advance!Hi,
You can get the collection of the context node and any line of the table is an entity in the context node.
If it is not helpfull try to find a table called 'table' or 'tableview', maye it's an attribute in your context node.
Best regards,
Caíque Escaler -
Retrieving table values from tableview multiselect
Hi everyone,
I have a BSP with a tableView set on multiselect. When the user clicks on a button I want to rertieve the selected rows in my ABAP code and send them to a function module (in the form of a table). But I haven't been able to find code examples on how to do this, ie how to retrieve the selected rows. Can someone provide me with an example or a link to where I can find one? I can catch the button onClick event, but after that I need to get the rows that were selected by the user.
Thanks!
best regards,
DionisiosHI Dionisios,
In your input processing,
do something like
CLASS CL_HTMLB_MANAGER DEFINITION LOAD.
IF event_id = CL_HTMLB_MANAGER=>EVENT_ID.
DATA: event TYPE REF TO CL_HTMLB_EVENT.
event = CL_HTMLB_MANAGER=>get_event( runtime->server->request ).
if event->id = 'but1' and event->event_type = 'click'.
DATA: tv TYPE REF TO CL_HTMLB_TABLEVIEW.
tv ?= CL_HTMLB_MANAGER=>GET_DATA(
request = runtime->server->request
name = 'tableView'
id = 'tab1' ).
IF tv IS NOT INITIAL.
DATA: tv_data TYPE REF TO CL_HTMLB_EVENT_TABLEVIEW.
tv_data = tv->data.
refresh itab2.
refresh itab3.
<b>call method tv_data->GET_ROWS_SELECTED
receiving selected_rows = itab2.</b>
endif.
data : ind type SELECTEDROW,
row_s type row.
if itab2 is not initial.
data :rw LIKE LINE OF itab.
loop at itab2 into ind.
READ TABLE itab INDEX ind-index into
rw.
if rw is not initial.
row_s = rw.
append row_s to itab3.
clear row_s.
endif.
endloop.
endif.
Endif.
Where
TYPES
types : tab type table of <table_name>.
types : row type <table_name>.
PAGE ATTRIBUTEs :
Irow type row
Itab type tab.
Itab3 type tab.
Itab2 type selectedrows.
Rowselected type string.
And in layout
<htmlb:tableView id="tab1"
table="<%= itab %>"
="true" >
visibleRowCount="8"
design="ALTERNATING"
footerVisible="TRUE"
selectionMode="multiSelect"
keepSelectedRow
</htmlb:tableView>
<htmlb:button id = "but1"
onClick="test"/>
HOpe this helps,
Regards,
Siddhartha -
Getting filtered values from TableView
Hi,
We have a TableView whose columns can be sorted. Iwant to select a few rows and make the selected rows editable in another page.
If it is a unsorted/unfiltered TableView, am able to do it as the ABAP Internal Table and the TableView are the same in terms of record index positions. But am facing problem after i sort/filter the TableView because now the index of the TableView are different from the index of the ABAP Internal Table present in server.
Anybody who has dealt with this problem earlier and can guide us.
Thanks,
Chathia.Welcome to SDN.
Search the forum before you post a question, generally in mose cases you would find a answer, if not you can post a new thread.
here is a list of threads where your question was discussed. (as others mentioned its about using keyColumn attribute of htmlb:tableview)
check out these threads, its got code samples as well.
Re: HTMLB Tableview: questions..;
Re: pic actual data from a table view
Re: Error when using Filter and Sort together on a tableview
Re: Change rendering of the title column...
Have a great time in SDN.
Regards
Raja -
How to change the default KeyBinding of the TableView ?
how to change the default key binding of the TableView ?
When press Enter key on a editable TableView, the default action is to make the selceted cell to a editing state. I want to know if there is any way to make it select the right cell and wouldn't change the editing state of the selected cell when i press Enter key.
here is something i've done.
table.setOnKeyPressed(new EventHandler<KeyEvent>() {
@Override
public void handle(KeyEvent e) {;
table.requestFocus();
KeyCode code =e.getCode();
if(code == KeyCode.ENTER){
try {
new Robot().keyPress(java.awt.event.KeyEvent.VK_RIGHT);//XXX
} catch (Exception e1) {
Thanks,
ahiwoo
Edited by: 911579 on 2012-2-1 上午3:15
Edited by: 911579 on 2012-2-1 上午6:26
Edited by: 911579 on 2012-2-1 上午6:41thanks jsmith. now it works well.
table.addEventFilter(KeyEvent.KEY_PRESSED, new EventHandler<KeyEvent>() {
@Override
public void handle(KeyEvent e) {
table.requestFocus();
KeyCode code =e.getCode();
if(code == KeyCode.ENTER){
try {
new Robot().keyPress(key);//XXX javafx has no robot for key type...
} catch (Exception e1) {
e.consume();
});
Maybe you are looking for
-
Fix (set in concrete) Bridge Workspace
How do I set a Bridge Workspace so that future alterations don't get saved by default? Thanks, Drew
-
I am trying to move my library and playlists to a new computer by burning to CD's. However, I followed the directions by going to File and then Library - then they said to go to burn CD(s) - I DO NOT have that option for some reason. How do I do this
-
Can I have my iTunes Library on two different computers? One pc and one mac
I have my iTunes library on my office pc. I just bought a MacBook Air and want to have my library on there as well. I have an iphone that I have synced to both, but it will only let me keep my songs on my work pc. Is there a way I can have it on both
-
2.1GHz versus 2.4GHz
Ok, so to put it plainly, I had my heart set on the 2.4GHz white Macbook but managed to stop myself from buying and convinced myself to wait for the new ones to come out. Now, obviously, the model which I was going to get is no longer available, only
-
Download failure - how do I report a fault?
I bought a couple of albums this morning. The first downloaded without any problems. The second (Pure by Hayley Westenra) kept crashing iTUNES. It would download three tracks then would crash at the processing stage. I reloaded and repeated the downl