How to change Table Cell Field Type Dynamically?

Hi All,
I am fetching some news data from backend DB and displaying them in a WD Table. Now one News Item may or may not have a URL behind it. If I find the URL as null then I want to display the news as simple TextView otherwise as LinkToUrl. How can I change this input type dynamically for each row in the runtime?
If I use LinkToUrl all the time then the items which has URL as null gets displayed as normal text, but they are of very faint color and I can not change the text design. Whether if I user TextView I can set some text design like Header2, Header 3 etc.
Can anybody please help with some code block? My main requirement is how to change the table cell input type dynamically.
Thanks in Advance.
Shubhadip

Hi Shubhadip,
This is the sample code for creating and adding a table cell editor table dynamically.
public static void wdDoModifyView
(IPrivateDynamicTableCreationView wdThis, IPrivateDynamicTableCreationView.IContextNode wdContext, com.sap.tc.webdynpro.progmodel.api.IWDView view, boolean firstTime)
//@@begin wdDoModifyView
/*** 1.Create Table **/
IWDTable table =
(IWDTable) view.createElement(IWDTable.class, "table1");
table.setWidth("100%");
table.setVisibleRowCount(data.length);
/*** 2.Create nameColumn **/
IWDTableColumn nameColumn =
(IWDTableColumn) view.createElement(IWDTableColumn.class, "Name");
IWDCaption colHeader =
(IWDCaption) view.createElement(IWDCaption.class, "NameHeader");
colHeader.setText("–¼‘O");
nameColumn.setHeader(colHeader);
IWDTextView nameViewer =
(IWDTextView) view.createElement(IWDTextView.class, "NameViewer");
nameViewer.bindText(nameAtt);
IWDTableCellEditor editor = (IWDTableCellEditor) nameViewer;
nameColumn.setTableCellEditor(editor);
table.addColumn(nameColumn);
IWDTableColumn nationalityColumn =
(IWDTableColumn) view.createElement(
IWDTableColumn.class,
"Nationality");
IWDTableCellEditor nationalityEditor =
(IWDTableCellEditor) nationalityViewer;
nationalityColumn.setTableCellEditor(nationalityEditor);
table.addColumn(nationalityColumn);
/** 3. Bind context to table **/
table.bindDataSource(nodeInfo);
//@@end
Bala
Kindly reward appropriate points.

Similar Messages

  • How to Change the Value Field Type of a Value Field

    Hi,
    How can I change the value field type from Currency to Quantity of a value field? I have tried to do it in KEA6. I can change the value field and its description, but not the value field type from currency to qty. If I change this config, is there any other changes that I need to make so there is no side issue of this change?

    Hi Prem,
    Once you created value field as quantity or currency, you can not change this nature of value field. Based on this, system creates lots of data and tables. For this reason system will not allow any changes in quantity or currency.
    Alternative way is to remove the old value field and  create a new value field assign to operating concern and put all your seetings.
    Please let me know if you require any clarifications.
    Thank you,
    Regards,
    Santosh
    Reward points if helpful.

  • How to change tables in from  clause dynamically

    Hi,
    I have to add some join conditions in where clause and tables in from clause based on some input parameters and data in other tables.
    How can i achieve this ? I must use procedure/function or dynamic query preparation or any more alternatives?
    Regards,
    Krishna

    Yes, you can use dynamic sql for that.
    But be aware that you'll be needing to concatenate the table names in your FROM-clause, you cannot bind them...
    So you'll be trashing the shared pool.
    Maybe alternative approaches are possible, but you provide too little input for my crystal ball here...

  • How to change the text of label dynamically

    Hi all,
    I have done a dynpro program.It requires to implement the dynamically display the label text, for example: there is a label, sometimes, we want to display "Purchase Order" and sometimes we want to display "Sales Order". Can anyone tell me how to change the text of label according to my requirements? thanks in advance!

    Hi Wei,
    AS of now you will not be able to change the Text Field ( Label ) dynamically or at runtime. This is a limitation.Refer to this link:
    http://help.sap.com/saphelp_nw04/helpdata/en/e4/2adbef449911d1949c0000e8353423/frameset.htm
    But, there is a way around.
    You can make a text field Visible / Invisible based on your program logic. So, based on what you want, you can process a module which will take care of that.
    Have a look at these DEMO Code. You can have a good idea to implement the logic.
    DEMO_DYNPRO_MODIFY_SCREEN - Demonstration of Dynamic Screen Modifications
    Thanks,
    Samantak.

  • How to change table of content font in captivate 6

    Hi There,
    Can somebody please suggest me how to change table of Content Text font English to Arabic in Captivate 6 and which font supports Arabic language.
    Please refer below image, highlighted text font should be changed.
    Looking forward for help.
    Thanks,
    Srikanth

    The weird sliding navigation is Apples pride and joy!
    That TOC allows you to slide between chapters, sections and pages.
    iBooks Authjor was designed to do what it does and what Apple wanted it to do.
    Some things can be changed during the books production,  but the " weird navigation"  is not something you can change to do what you want.
    iBooks Author is does not produce ePubs.. at least not as "ePub" is known from Pages, inDesign etc,.
    If you want what is available in ePubs.. then iBooks Author is not the application to produce it.
    You could drag a section page above chapter on and create an index type page using book marks for links - but whats the point? 
    People using iPads and familiar with iBooksAuthors special way of book presentation.. are quite happy its so easy to use.

  • How to change table content ...

    Hi All,
    Pl. give us soltution for the following :
    1. How to change table content of standard table ?
        (eg. mara content not from MM02.).
    2. How to add field in standard table ?
    waiting reply.
    Yusuf

    Hi  Yusuf,
    Modifying a standard table through a program using SQL statements is highly risky. However if u wish to do it programatically and not through MM02, you have the option of using BAPIs.
    Goto transaction BAPI and through the application hirarchy, goto Material Management section. There i am sure u will find some BAPIs to modify material master and they are the most stable mode of update programatically.
    Hope this helps.
    Regards,
    Aditya

  • How to modify a lookup field-type to use checkbox instead of radiobutton?

    How to modify a lookup field-type to use checkbox instead of radiobutton?
    I would like to modify the behavior for the lookup field.
    Normally you get a screen where it is possible to search through a lookup. The items resulted from the search are listed as radiobutton items. Therefore you can select only one at the time to be added.
    Is it possible to have the items to be listed as checkbox instead? So that you can check multiple items and therefore be able to add multiple items at the time?
    For example:
    To add the user to 10 different groups on MS-AD.
    It is desired to have the ability to check multiple groups to be added instead only one at the time.
    My client would like to use this feature in many other situations.

    Displaying will not be a big deal but with that you have to customize the action class and its working as well.

  • How to change the font and type in the front panel

    Can you tell me how to change the font and type in the front panel if i want to make it looks more beautiful.
    1110340040

    Hi there,
    You can change the font size and type as shown below:
    - Ee Lim -
    See that button on the left side of this post...
    If you feel my post is helpful, all you need is just (at most) 2 seconds to click that button, to show your appreciation. Thank you~~

  • How to change report region fields in read only mode?

    How to change report region fields in read only mode?
    skud.

    add the following javascript fuction to page header(or Javascript function and variables section)
    function disableItems(pRegionStaticId,pDisableFlag) {
      $('#'+pRegionStaticId).find('[name^=f]').each( function(){ /* matches fxx */
        if( $(this).attr('name').match(/f[0-9][0-9]/) ){
          return $(this);
      }).attr('disabled',pDisableFlag);
    pRegionStaticId is the region's static Id+
    Note that this code specifically disables only application arrays. Disabled items are not available after submission (and hence are different from readonly) . But any page javascript can modify disabled or readonly items(client side), so you must check at the server side to validate the data.
    You can disable items using
    disableItems('MY_REGION_ID' ,true);and enable them by passing false
    disableItems('MY_REGION_ID' ,false);

  • How to set table cell renderer in a specific cell?

    how to set table cell renderer in a specific cell?
    i want set a cell to be a button in renderer!
    how to do?
    any link or document can read>?
    thx!

    Take a look at :
    http://www2.gol.com/users/tame/swing/examples/SwingExamples.html
    It is very interesting, and I think your answer is here.
    Denis

  • How to change one cell's backColour in DataGird.

    how to change one cell's backColour in DataGird.who can tell
    me how to do?Thangks

    Hi,
    You may need to use custom skin for that.
    -Arun

  • How to create table with row type in smart forms

    How to create table with row type in smart forms with out line type
    please explain me the procedure

    HI,
    A table type describes the structure and functional attributes of an internal table in ABAP. In ABAP programs you can reference a table type TTYP defined in the ABAP Dictionary with the command DATA <inttab> TYPE TTYP. An internal table <inttab> is created in the program with the attributes defined for TTYP in the ABAP Dictionary.
    A table type is defined by:
    its line type, that defines the structure and data type attributes of a line of the internal table
    the options for managing and accessing the data ( access mode) in the internal table
    the key ( key definition and key category) of the internal table
    The row type is defined by directly entering the data type, length and number of decimal places or by referencing a data element, structured type ( structure, table or view) or other table type. Or the row type can be a reference type.
    <b>for more info :</b> http://help.sap.com/saphelp_nw2004s/helpdata/en/fc/eb366d358411d1829f0000e829fbfe/content.htm
    Internal table
    Regards
    Sudheer

  • Dynamic table with field type table

    Hi,
    I´m using "cl_alv_table_create=>create_dynamic_table" to create a dynamic table for ALV Grid.
    But...I need to use colors in ALV, then I need to declare a field type LVC_S_SCOL in dynamic table from "cl_alv_table_create=>create_dynamic_table".
    How can I declare this in fieldcat?
    The code:
    Creating dynamic table
    DATA: table_agrup TYPE REF TO data,
            line_agrup  TYPE REF TO data.
    CALL METHOD cl_alv_table_create=>create_dynamic_table
        EXPORTING
          it_fieldcatalog           = t_fieldcat
        IMPORTING
          ep_table                  = table_agrup
        EXCEPTIONS
          generate_subpool_dir_full = 1
          OTHERS                    = 2.
        ASSIGN table_agrup->* TO .
    Printing ALV
      CALL METHOD obj_grid->set_table_for_first_display
        EXPORTING
          is_variant                    = w_variant
          i_save                        = 'A'
          is_layout                     = w_layout
        CHANGING
          it_outtab                     =
          it_fieldcatalog               = t_fieldcat
          it_sort                       = t_sort
        EXCEPTIONS
          invalid_parameter_combination = 1
          program_error                 = 2
          too_many_lines                = 3
          OTHERS                        = 4.
    Thanks.

    It is not possible with the  METHOD cl_alv_table_create=>create_dynamic_table to include another table inside that newly generated table.
    I have tried to do it with the code and I got the dynamic table created after at the end of the program.
    In the code,
    <DYN_TABLE> has same effect as your <table> variable
    <DYN_WA> has same effect as your <HEADER>
    REPORT  ZTEST_NP_DYNAMIC.
    DATA: DY_TABLE TYPE REF TO DATA,
          DY_LINE  TYPE REF TO DATA.
    FIELD-SYMBOLS: <DYN_TABLE> TYPE STANDARD TABLE,
                   <DYN_WA>,
                   <DYN_FIELD>.
    FIELD-SYMBOLS: <FS> TYPE ANY.
    * To generate the Dyanmic table with the COLOR
    DATA: LS_SOURCE TYPE STRING.
    DATA: LT_SOURCE LIKE STANDARD TABLE OF LS_SOURCE WITH HEADER LINE.
    DATA: L_NAME LIKE SY-REPID.
    DATA: L_MESSAGE(240) TYPE C,
          L_LINE TYPE I,
          L_WORD(72) TYPE C.
    DATA: L_FORM(30) TYPE C VALUE 'TABLE_CREATE'.
    LT_SOURCE = 'REPORT ZTEST_SUBROUTINE_POOL.'.
    APPEND LT_SOURCE.
    LT_SOURCE = 'FORM  TABLE_CREATE USING I_FS TYPE ANY.'.
    APPEND LT_SOURCE.
    LT_SOURCE = 'DATA: BEGIN OF LT_GENTAB OCCURS 0.'.
    APPEND LT_SOURCE.
    LT_SOURCE = 'DATA: BUKRS TYPE BUKRS. '.
    APPEND LT_SOURCE.
    LT_SOURCE = 'DATA: BKTXT TYPE BKTXT. '.
    APPEND LT_SOURCE.
    * you can add your fields here.....
    LT_SOURCE = 'DATA: COLOR TYPE lvc_t_scol. '.
    APPEND LT_SOURCE.
    LT_SOURCE = 'DATA: END OF LT_GENTAB.'.
    APPEND LT_SOURCE.
    LT_SOURCE = 'DATA: POINTER TYPE REF TO DATA.'.
    APPEND LT_SOURCE.
    LT_SOURCE = 'CREATE DATA POINTER LIKE STANDARD TABLE OF LT_GENTAB.'.
    APPEND LT_SOURCE.
    LT_SOURCE = 'I_FS = POINTER.'.
    APPEND LT_SOURCE.
    LT_SOURCE = 'ENDFORM. '.
    APPEND LT_SOURCE.
    L_NAME = 'ZTEST_SUBROUTINE_POOL'.
    CATCH SYSTEM-EXCEPTIONS GENERATE_SUBPOOL_DIR_FULL = 9.
      GENERATE SUBROUTINE POOL LT_SOURCE NAME L_NAME
               MESSAGE L_MESSAGE LINE L_LINE WORD L_WORD.  "#EC CI_GENERATE
    ENDCATCH.
    IF NOT L_MESSAGE IS INITIAL.
      MESSAGE E000(0K) WITH L_MESSAGE L_LINE L_WORD.
    ENDIF.
    ASSIGN DY_TABLE TO <FS>.
    PERFORM (L_FORM) IN PROGRAM (L_NAME) USING <FS>.
    ASSIGN DY_TABLE->* TO <DYN_TABLE>.
    * Create dynamic work area and assign to FS
    CREATE DATA DY_LINE LIKE LINE OF <DYN_TABLE>.
    ASSIGN DY_LINE->* TO <DYN_WA>.
    Write: 'bye'.
    Regards,
    Naimesh Patel

  • How do with change table cells from staticText1 to button1 in run time?

    I have two question:
    first: I think change table's cells from staticText to button in run time?
    how do?
    second: I think change table column's order in run time?how do?
    ex:
    =============change before===========
    name age
    wtu 22
    =============chnage after=============
    age name
    22 wtu
    thanks

    Try something like this:
    1. Drop a Table. By default it has three columns.
    2. Drop a button inside the third column. Set its id property to buttonInColumn3, and set its rendered property to false.
    3. Drop another button, this time outside the table. Set its id property to buttonOutsideTable.
    4. Double-click the buttonOutsideTable and make the method look as follows:
    public String buttonOutsideTable_action() {
    //switch the first two columns
    List cols = tableRowGroup1.getChildren();
    Object col = cols.remove(0);
    cols.add(1, col);
    //toggle between showing staticText3 and buttonInColumn3 (in the third column)
    staticText3.setRendered(!staticText3.isRendered());
    buttonInColumn3.setRendered(!buttonInColumn3.isRendered());
    return null;
    5. Run the application and click the button outside the table several times.

  • I need a text field in a table cell to expand dynamically

    When I say expand I mean the whole cell has to grow as the content is entered into it, not just have a scroll bar present to contain the content, every new line should expand the table cell vertically. I've been looking all over and I can't seem to figure this one out, help?

    Turns out I just needed to search the forums better, here's a link to the thread with my solution:
    http://forums.adobe.com/thread/450522

Maybe you are looking for

  • ABAP Objects book

    Dear All, I am using the Horst Keller ABAP Objects: An intro to programming SAP applications book and am having a little trouble. for one, i cannot use the s_abap_book development class, and the book revolves around that... i know i cannot use the s_

  • Apache FOP config Question

    Hi all, I have APEX version 3.0.1 and I use F&R Services version 10.1.2.0.2. I wanted to use Apache Fop in order to have PDF Printing facilities. However in http://www.oracle.com/technology/products/database/application_express/html/configure_printin

  • Seeing iTunes library from MacPro with ethernet only

    I upgraded from an Apple TV 1st Generation so I could use Netflix.  I've managed to successfully set up home sharing with my MacBook Pro, but it is not seeing the content on my MacPro. This does not have a wi-fi card, but is connected to a wi-fi rout

  • What can be done when the Customer Relations Department fails to call? Disgusted and appalled.

    I have had a sony KDL-W590B (same as the W600B but from Costco) for less than one year.  The original television had a dark spot in the upper left hand quadrant.  I contacted Sony and was instructed to do a factory reset on the television and exchang

  • Instalar TomCat6 en MAC OS X 10.7.5 ?

    Buenas tardes a toda la comunidad: Ser'ian tan amables en informarme o especificarme los detalles siguientes: Quiero Instalar TomCat6 en una MacBook Negra, con Sistema operativo OS X version 10.7.5 1. Que version  de tomcat6 descargo? 2. Como instalo