Add a Button in a table header Webdynpro
Hi all,
how can'i add a button in a table header ? and how/where schould be implemented?
thank you all
Hi,
If you want to create Some custom buttons in ALV, you need to write some coding.
Please go through this...
ALV with user-defined buttons on toolbar in wd abap
Re: Adding custom button in standard toolbar in ALV
If you want to create button is table toolbar. steps :
1. create TABLE UI Element in view - go to ROOT UI ELEMENT CONTAINER( right side here you find inserted Table ) - Right click on that ->you fined one option INSERT TOOLBAR, click this-> it will insert Toolbar again right click on this tool bar-> You wil find insert
toolbar element->select Toolbar button. It will insert toolbar and buttons.
Cheers,
Kris.
Similar Messages
-
How to add One Button to the Table Header.
Hi,
I would like to have few Table Header columns as Button and Other Table Header Columns as String. And each Button should have separate action. Please let me know, how can i implement this one.
Thanks
Mohando not cross post, this is a bad habit. now do you know about www.google.com. well this is a search engine, learn how to use it before you post. i got this link with this keyword search.
http://www.exampledepot.com/egs/javax.swing.table/pkg.html
http://forum.java.sun.com/thread.jspa?threadID=560605&tstart=15
hope this helps you
regards
Aniruddha -
How to add a Button to the Table header
Hi,
I would like to have few Table Header columns as Button and Other Table Header Columns as String. And each Button should have separate action. Please let me know, how can i implement this one.
Thanks
Mohancross post
http://forum.java.sun.com/thread.jspa?threadID=5195296 -
Add a button on the Table view screen
Hi ,
i need to add a button to da table view screen for which i have created a transaction also.How do i go about it?
please help.
Thanx and Regards,
Srestha<div><button
style="float:left;">LEFT</button><button
style="float:right;">RIGHT</button></div>
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com
- Template Triage!
http://www.projectseven.com/go
- DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs,
Tutorials & Resources
http://www.macromedia.com/support/search/
- Macromedia (MM) Technotes
==================
"-Michael--" <[email protected]> wrote in
message
news:edf6hm$aea$[email protected]..
> How do i add a button at the top left side of the
screen, then in the same
> row
> add a button to the right side of the screen. (I want
the buttons to stay
> left
> and right nomatter how big the users computer screen is)
> -
Problem with buttons in repeated table header
I have a bunch of tables that expand/contract at the click of a button in their respective header rows.
The problem I'm having is when a table breaks to another page the button doesn't work properly in the repeated header - the scripted value isn't making it to the repeated button (I've also tried checkboxes).
Is there any way to make this happen? Should I try using variables to store a flag or something like that?
https://acrobat.com/#d=m7zuQYiUoFrtz5isD7rErQThis issue is that the second header is an instance of the first, so all unmanaged relative code breaks. I would hazzard a guess to say that your add code looks like "$.parent.row1.instanceManager.addInstance(1)." This will break, as the "second" header row no longer sees the 'table' element as it's parent.
Changing to code to a static reference will fix it... i.e. xfa.form.form1.table1.row1.instanceManager.addInstance(1).
This should solve it for you... if not, let me know.
- Scott -
Page loss at the click of add new button in advanced table
Have created an advanced table and when I click on the add row button for the first time it results in page loss issue. But if I query and then click on the button it works fine.
AM code:
public void initialize()
OAViewObject vo = (OAViewObject)getXxutlDomainsVO();
if (vo.getFetchedRowCount() == 0)
vo.setMaxFetchSize(0);
public void createDomainSetupData()
OAViewObject vo = (OAViewObject)getXxutlDomainsVO();
if (vo.getFetchedRowCount() == 0)
vo.setMaxFetchSize(0);
Row row = vo.createRow(); vo.insertRow(row);
row.setNewRowState(Row.STATUS_INITIALIZED);
CO:
public void processRequest(OAPageContext pageContext, OAWebBean webBean)
super.processRequest(pageContext, webBean);
OAApplicationModule domainSetupAM = pageContext.getRootApplicationModule();
domainSetupAM.invokeMethod("initialize", null);
public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
super.processFormRequest(pageContext, webBean);
OAApplicationModule domainSetupAM = pageContext.getRootApplicationModule();
if ("DomainsAdv".equals(pageContext.getParameter(SOURCE_PARAM))
&& ADD_ROWS_EVENT.equals(pageContext.getParameter(EVENT_PARAM)))
domainSetupAM.invokeMethod("createDomainSetupData", null);
Please helpHi,
There are two ways to do it.
1. Use create method of entity object, create method fires whenever you creates new row.
2. Handle the event raised by addanotherrow button and write logic there to initialize contactid as you are getting contactid from pageContext so I will suggest you to use this method.
if (tableBean.getName().equals(pageContext.getParameter(SOURCE_PARAM)))
&& ADD_ROWS_EVENT.equals(pageContext.getParameter(EVENT_PARAM)))
//write your logic here to default the contact id
Hope this will help.
Regards,
Reetesh Sharma -
How to add the buttons on the Table maintains genrator
Hello Experts,
I have a table maintains generator, I have to add the sort ascending and sort descending button on the screen. and when user select any one column of that generator and then click on sort ascending or sort descending button, then it has to sort accordingly.
Can anyone please guide me in this issue.
Thanks
Chetan.Hi,
Go to the function group that is generated for your table maintanence and edit it and add buttons to the screen layout and handle then in PAI of that screen.
based on selection sort and display the data.
hope this solves your question.
regards,
Jayaram.M -
Hello dear All
My requirement is to add an image in jTable header( *.png or *.gif image in the tabel header.) I.e if there are 5 columns i have to add 5 images in the table header.
Please help me to overcome this issue.
ThanksSorry, it looks like the tutorial has recently been updated. Sorting is now supported in JDK6. Prior to this you needed to write your own code for sorting and the tutorial include sample classes to help you out.
Anyway, I found some old code lying around that should get you started:
import java.awt.*;
import javax.swing.*;
import javax.swing.table.*;
public class TableHeader extends JFrame
public TableHeader()
Object[] columnNames =
"Some Text",
new ImageIcon("copy16.gif"),
new ImageIcon("add16.gif")
// Columns headings are cast to a String when created automatically.
// We want Icons, so use a special renderer and create the columns manually
DefaultTableModel model = new DefaultTableModel(columnNames, 5);
JTable table = new JTable();
table.setAutoCreateColumnsFromModel( false );
table.setModel( model );
table.getTableHeader().setDefaultRenderer( new HeaderRenderer() );
for (int i = 0; i < columnNames.length; i++)
TableColumn newColumn = new TableColumn(i);
newColumn.setHeaderValue( columnNames[i] );
table.addColumn(newColumn);
table.setPreferredScrollableViewportSize(table.getPreferredSize());
JScrollPane scrollPane = new JScrollPane( table );
getContentPane().add( scrollPane );
class HeaderRenderer extends DefaultTableCellRenderer
public Component getTableCellRendererComponent(
JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int col)
setBorder(UIManager.getBorder("TableHeader.cellBorder"));
setHorizontalAlignment(CENTER);
// display text or icon
System.out.println(value.getClass());
if (value instanceof Icon)
setIcon( (Icon)value );
setText( "" );
setBackground( Color.green );
else
setIcon( null );
setText((value == null) ? "" : value.toString());
setBackground( Color.yellow );
return this;
public static void main(String[] args)
TableHeader frame = new TableHeader();
frame.setDefaultCloseOperation( EXIT_ON_CLOSE );
frame.pack();
frame.setLocationRelativeTo( null );
frame.setVisible(true);
} -
Advance Table: Problem on add another button
Hello All,
I have designed page that contains advance table and add another button. The table displays maximum 10 records in a page.
First I click the button and enter the records. After that again I click the button for multiple records insert. Than the previous record goes to another page. In this case users are unable to see the previous record. In my question how can we prevent that one?
Please help me…
Thanks in advance…
-- SubhasIt is a Standard behaviour that table will show the records which are set in the max number of records displayed property.
However if you want that records shudn't get shifted each time you press the add another row button you can set the max number of records programatically and increment 1 to it.
This way the number of records displayed will be now 11.
like each time you press add another row redirect the page, grab the table bean and then
bean.setmaxnumberofrecords()
increment the original value by 1 and then set.
Thanks,
Gaurav Sharma -
How to insert a button on the column header of a table in webdynpro java
Hi
Can anyone tell me how to insert a button on the column header of a table in webdynpro java?
regards
sunitHi sunit,
Instead of adding button in the column header , in the column
add a fixed top cell.
right click on the column
Insert FixedTopCell
Right click on the fixedTopCell
insert Editor.
select button.
then button will be only in the top most row.
Hope it will satisfy ur requirement
Regards
Smitha -
Add customer button on header level for BUS2201(PO) - SRM 7.0
Hi,
I want to define a customer button (with action) within PO on header level.
Web Dynpro FPM_OIF_COMPONENT
Configuration /SAPSRM/WDCC_FPM_OIF_PO_PURCH
Task:
Add a customer button besides standard Export button.
I assume-afterwards I have to enhance the method onactionbutton_pressed to create my event when customer button is pressed, right?
Could anyone please guide me how to solve this issue?
Thanks and best reagrds
AndreasHi,
Here are the steps to add the button, I wrote it in other thread. In my case for PO is not displayed, try to follow the steps and if you are able to show the button tell me how please.
Add custom button in PO
And yes ,you need to create an enhancement point in the view CNR_VIEW of the component FPM_OIF_COMPONENT, you need to create a post-exit in the method BUTTON_PRESSED, here you have a sample code:
DATA: lv_id TYPE string,
lv_event_id TYPE fpm_event_id.
DATA: lo_nd_oif_application TYPE REF TO if_wd_context_node,
lo_nd_variant TYPE REF TO if_wd_context_node,
lo_nd_toolbar TYPE REF TO if_wd_context_node,
lo_nd_button TYPE REF TO if_wd_context_node,
lo_el_button TYPE REF TO if_wd_context_element,
lo_nd_other_functions TYPE REF TO if_wd_context_node.
DATA: lv_substring TYPE string,
lv_substring_i TYPE i,
lv_node_name TYPE string,
lv_position TYPE string,
lv_length TYPE i,
lv_seq TYPE i.
DATA:lt_keys TYPE STANDARD TABLE OF string,
lv_key LIKE LINE OF lt_keys.
TYPES:BEGIN OF y_parameters,
name TYPE string,
value TYPE string,
END OF y_parameters.
DATA: lt_parameters TYPE STANDARD TABLE OF y_parameters,
ls_parameter LIKE LINE OF lt_parameters.
DATA: lv_boid TYPE bbp_guid,
lv_botype TYPE string,
lv_objkey TYPE swo_typeid,
lv_objtype TYPE swo_objtyp,
lv_object_id TYPE crmt_object_id_db,
lv_process_type TYPE crmt_process_type_db,
lv_object_type TYPE crmt_subobject_category_db,
lv_rfc TYPE zgrs_co_logsys-rfc,
DATA: lo_fpm TYPE REF TO if_fpm.
lo_fpm = cl_fpm_factory=>get_instance( ).
lo_fpm->raise_event_by_id( lv_event_id ).
lt_keys = lo_fpm->mo_app_parameter->get_keys( ).
LOOP AT lt_keys INTO lv_key.
ls_parameter-name = lv_key.
lo_fpm->mo_app_parameter->get_value(
EXPORTING iv_key = lv_key
IMPORTING ev_value = ls_parameter-value ).
INSERT ls_parameter INTO TABLE lt_parameters.
ENDLOOP.
lv_id = wdevent->get_string( 'ID' ).
lo_nd_oif_application = wd_context->get_child_node( name = wd_this->wdctx_oif_application ).
lo_nd_variant = lo_nd_oif_application->get_child_node( name = wd_this->wdctx_variant ).
lo_nd_toolbar = lo_nd_variant->get_child_node( name = wd_this->wdctx_toolbar ).
lo_nd_other_functions = lo_nd_toolbar->get_child_node( name = wd_this->wdctx_other_functions ).
lv_substring = lv_id.
lv_length = STRLEN( lv_id ).
lv_seq = lv_length - 3.
IF lv_id+lv_seq = '_CP'.
lv_substring = lv_substring(lv_seq).
lv_id = lv_substring.
ENDIF.
WHILE lv_substring CS '_'.
lv_position = sy-fdpos + 1.
lv_substring = lv_substring+lv_position.
ENDWHILE.
IF lv_substring CO '1234567890'.
lv_substring_i = lv_substring.
ENDIF.
* Item level action;
IF lv_id CS '_item'.
* Or header level action;
ELSE.
IF lv_id CA '0123456789'.
lv_position = sy-fdpos - 1.
lv_node_name = lv_id(lv_position).
IF lv_id CS 'OTHER_FUNCTIONS'.
lo_nd_button = lo_nd_other_functions->get_child_node( name = wd_this->wdctx_button ).
lo_nd_button->set_lead_selection_index( index = lv_substring_i ).
lo_el_button = lo_nd_button->get_element( ).
TRY.
lo_el_button->get_attribute(
EXPORTING
name = `EVENT_ID`
IMPORTING
value = lv_event_id ).
CATCH cx_wd_context.
ENDTRY.
READ TABLE lt_parameters INTO ls_parameter WITH KEY name = 'SAPSRM_BOTYPE'.
lv_botype = ls_parameter-value.
READ TABLE lt_parameters INTO ls_parameter WITH KEY name = 'SAPSRM_BOID'.
lv_boid = ls_parameter-value.
* Obtain the object_id;
SELECT SINGLE object_id INTO lv_object_id
FROM crmd_orderadm_h
WHERE guid EQ lv_boid.
* If not Z button, exits;
IF lv_event_id(1) NE 'Z'. EXIT. ENDIF.
* Actions;
CASE lv_event_id.
WHEN 'ZBUTTON'.
WHEN 'ZBUTTON2'.
ENDCASE.
ENDIF.
ENDIF.
ENDIF. -
Advance Table - Add Row button and coloumn issue
Hi all,
I have created Advanced Table wth four coloumns.
for two columns item style as messagtextinput and the rest are same as DATE.
But when the page is rendering the table columns shows as messagestyletext , which means messagetextinput style item is not appearing.
Kindly help me if am missed anything wrong.
and also can u help me to create add row button featurs in advance table
Thanks in advance.
SenthurSenthur,
I hv done this using row status initialised.I couldnt get the above lines.
I have another doubt also. In Advanced table there is coloumn header, is there any Row header.There is nothing as such RowHeader. Let me know ur exact requirement.
Name age salary
empid1 xxx 21 100
empid2 yyy 22 200Create a VO which return the above attributes and attach the same to the Adavanced Table Bean.
Regards,
Gyan -
How to add the Row count(number of rows in table) in the table header?
Hi,
I'm having a table. This table is viewed when i click on a search button.
<b>On the table header it should dynamically display the number of rows in the table, i.e., the row count.</b>
How to do this? could any one explain me with the detailed procedure to achieve this.
Thanks & Regards,
SureshIf you want to show a localized text in the table header, you should use the <b>Message Pool</b> to create a (parameterized) message "tableHeaderText" like "There are table entries".
Next, create a context attribute "tableHeaderText" of type "string" and bind the "text" property of the table header Caption UI element to this attribute.
Whenever the table data has changed (e.g. at the end of the supply function for the table's data source node), update the header text:
int numRows = wdContext.node<TableDataSourceNode>().size();
String text = wdComponentAPI.getTextAccessor().getText
IMessage<ComponentName>.TABLE_HEADER_TEXT,
new Object[] { String.valueOf(numRows) }
wdContext.currentContextElement().setTableHeaderText(text);
Maybe you want to provide a separate message for the case that there are no entries.
Alternatively, you can make the attribute calculated and return the header text in the attribute getter.
Armin -
Button not working in a table header
I have a custom view that implements table header. I have buttons in that view. The buttons used to work fine in SDK prior to 5. I moved directly to SDK 7, and the buttons stopped working. The action is not called anymore.
Any help will be appreciated.
ThanksWell, you have me stumped. I just replicated your code and it works fine for me:
- (void)doStuff:(id)sender
NSLog(@"Logo Touched!");
- (void)viewDidLoad {
// loadingView is a UIView that becomes the tableHeaderView
self.tableView.tableHeaderView = loadingView;
[loadingActivity startAnimating];
// setup a sample button (declared in header)
logoButton = [[UIButton alloc] initWithFrame:CGRectZero];
[logoButton setImage:[UIImage imageNamed:@"logo_webclip.png"] forState:UIControlStateNormal];
[logoButton addTarget:self action:@selector(doStuff:) forControlEvents:UIControlEventTouchUpInside];
logoButton.tag = 100;
[loadingView addSubview:logoButton];
- (void)viewDidAppear:(BOOL)animated {
[super viewDidAppear:animated];
logoButton.frame = CGRectMake(50., 50., 64., 64.);
That calls my target everytime it's touched... are you remembering to call the superclass for each of your overrided methods in your custom UIView? The only difference between my quick test and yours is that I didn't subclass UIView -- I just used the UIView class directly. -
How can i add a table header using DefaultTableModel?
Im having problems finding examples of creating a table header using the DefaultTableModel. Can anyone point me in the right direction?
so far i am able to create a table and add rows, but i need the first row to be the header with title and i am not able to do that with this model.
Below is an excerpt of what i have thus far...
JTableHeader header = new JTableHeader();
checkOutTable.setModel(tableModel);
checkOutTable.setRowSelectionAllowed(true);
private DefaultTableModel tableModel = new DefaultTableModel(
new Object [][] {
{"Item ID", "Title", "Type", "Serial ID", "Status", "Response", "Print"},
new String [] {
"TITLE 1", "TITLE 2", "TITLE 3", "TITLE 4", "TITLE 5", "TITLE 6", "TITLE 7"
){Class[] types = new Class[] { java.lang.Object.class,
java.lang.Object.class, java.lang.Object.class,
java.lang.Object.class, java.lang.Object.class,
java.lang.Object.class, java.lang.Object.class };
public Class getColumnClass(int columnIndex) {
return types[columnIndex];
}};Use the constructor that takes a Vector of column names and a row count.
http://java.sun.com/j2se/1.4.2/docs/api/javax/swing/table/DefaultTableModel.html#DefaultTableModel(java.util.Vector,%20int)
Maybe you are looking for
-
HT4637 Hi, does it support Arabic language; text and numerals?
I have just purchased a macbook pro, first time to switch from a PC. I am really impressed wirh the overall experience of my new powerhouse with one MAJOR drawback; the Arabic Text and numeral support within the microsoft office package of applicatIo
-
Anyone who can help it would be appreciated It is is like Adobe has abandoned what they sold me in 2012
-
Reqd.Table Names for FI,PS Module
Could anybody suggest the Table Names with combination of fileds: cost elements; Actual data, Plan data, cost centers, cost element, rate year (10/1/05-9/30/06), current year 12 months (11/01/04-10/30/05). Thanks in Advance.
-
GUI_UPLOAD in Background
Hello, I am trying to upload data from the Presentation Server to the SAP System using the FM 'GUI_UPLOAD'. But the program that calls this is to run in the background, so it fails in this case, therefore could you kindly suggest me an alternative fo
-
I'm not sure where I should go to ask, but my iPod video is being odd. One speaker/headphone (whatever it is played out of) goes in and out, and I have to jiggle the cable of whatever is plugged in to get it to play out of both speakers/headphones. I