How to show different templates in one column

Hello friends,
I've a data like this one:
var aData = [
     {name: "Dente", company: "http://www.sap.com"},
     {name: "Friese",  company: "Google"},
     {name: "Mann", company: "http://www.sap.com"},
     {name: "Schutt", company: "SAP"}
and want to be showed in the table :
     if the 'company' begin with "http" , it should be a link,
     else, shows as a text
How to do this ?
Could you help me ?
Thank you
Here is a short demo can run in https://openui5.hana.ondemand.com/#test-resources/sap/ui/table/demokit/Table.html 
but is not completed.
Demo for test:
var aData = [ 
     {name: "Dente", company: "http://www.sap.com"},
     {name: "Friese",  company: "Google"},
     {name: "Mann", company: "http://www.sap.com"},
     {name: "Schutt", company: "SAP"}
//Create an instance of the table control
var oTable2 = new sap.ui.table.Table({
     title: "Table with fixed columns Example",
     visibleRowCount: 7,
     firstVisibleRow: 3,
     selectionMode: sap.ui.table.SelectionMode.Single,
     navigationMode: sap.ui.table.NavigationMode.Paginator,
     fixedColumnCount: 2
//Define the columns and the control templates to be used
oTable2.addColumn(new sap.ui.table.Column({
     label: new sap.ui.commons.Label({text: "Name"}),
     template: new sap.ui.commons.TextField().bindProperty("value", "name"),
     sortProperty: "name",
     filterProperty: "name",
     width: "200px"
oTable2.addColumn(new sap.ui.table.Column({
     label: new sap.ui.commons.Label({text: "Company"}),
     template: new sap.ui.commons.Link().bindProperty("text", "company").bindProperty("href", "company"),
     sortProperty: "linkText",
     filterProperty: "linkText",
     width: "400px"
//Create a model and bind the table rows to this model
var oModel2 = new sap.ui.model.json.JSONModel();
oModel2.setData({modelData: aData});
oTable2.setModel(oModel2);
oTable2.bindRows("/modelData");
//Initially sort the table
oTable2.sort(oTable2.getColumns()[0]);
//Bring the table onto the UI
oTable2.placeAt("sample2");

HI Sihao
will this work?
Example
Thanks
-D

Similar Messages

  • How to create multiple links in one column

    Hi,
    Could someone please help me with creating 2 different links in one column as below.
    I enclosed is the screen shot of my current application view... I would like to put the link one below the other in one column instead in two different columns.
    Table Name - SR_PROCESS
    Functions - get_open_project , get_open_be
    Columns - ''Initiate New Project'' , ''Initiate New Bug or Enhancement''
    Below is my coding.
    select
    ''Initiate New Project'' AS "Initiate New Project" ,
    get_open_project("SR_PROCESS"."PROCESS_ID") "Open Projects",
    ''Initiate New Bug or Enhancement'' AS "Initiate New Bug" ,
    get_open_be("SR_PROCESS"."PROCESS_ID") "Open Bugs"
    from SR_PROCESS
    Thanks, Sheetal

    976745 wrote:
    Hi,Welcome to the forum: please read the FAQ and forum sticky threads (if you haven't done so already), and update your profile with a real handle instead of "976745".
    When you have a problem you'll get a faster, more effective response by including as much relevant information as possible upfront. This should include:
    <li>Full APEX version
    <li>Full DB/version/edition/host OS
    <li>Web server architecture (EPG, OHS or APEX listener/host OS)
    <li>Browser(s) and version(s) used
    <li>Theme
    <li>Template(s)
    <li>Region/item type(s) (making particular distinction as to whether a "report" is a standard report, an interactive report, or in fact an "updateable report" (i.e. a tabular form)
    With APEX we're also fortunate to have a great resource in apex.oracle.com where we can reproduce and share problems. Reproducing things there is the best way to troubleshoot most issues, especially those relating to layout and visual formatting. If you expect a detailed answer then it's appropriate for you to take on a significant part of the effort by getting as far as possible with an example of the problem on apex.oracle.com before asking for assistance with specific issues, which we can then see at first hand.
    Could someone please help me with creating 2 different links in one column as below.
    I enclosed is the screen shot of my current application view...Where is the screenshot? Providing an example on apex.oracle.com is a much better way to share details of your application.
    I would like to put the link one below the other in one column instead in two different columns.
    Table Name - SR_PROCESS
    Functions - get_open_project , get_open_be
    Columns - ''Initiate New Project'' , ''Initiate New Bug or Enhancement''
    Below is my coding.
    select
    ''Initiate New Project'' AS "Initiate New Project" ,
    get_open_project("SR_PROCESS"."PROCESS_ID") "Open Projects",
    ''Initiate New Bug or Enhancement'' AS "Initiate New Bug" ,
    get_open_be("SR_PROCESS"."PROCESS_ID") "Open Bugs"
    from SR_PROCESSDepends on your APEX version and the type of report. Please provide the information detailed above.

  • How can I Move data from one column to another in my access table?

    I have two columns, one that stores current month’s data and one that stores last month’s data. Every month data from column 2 (this month’s data) needs to be moved to column 1 that holds last month’s data. I then null out column 2 so I can accumulates this month’s data.
    I understand how to drop a column or add a column, how do I transfer data from one column to another.
    Here is my trial code:
    <cfquery name="qQueryChangeColumnName" datasource="#dsn#">
      ALTER TABLE leaderboard
      UPDATE leaderboard SET  points2 = points3
    </cfquery>
    Unfortunately, I get the following error:
    Error Executing Database Query.
    [Macromedia][SequeLink JDBC Driver][ODBC Socket][Microsoft][ODBC Microsoft Access Driver] Syntax error in ALTER TABLE statement.
    How can I transfer my data with the alter table method?

    I looked up the Access SQL reference (which is probably a
    good place to start when having issues with Access SQL), and
    it suggests you probably need a WHERE clause in there.
    I agree the documentation is a good place to start. But you should not need a WHERE clause here.
    Too few parameters. Expected 1.
    If you run the SQL directly in Access, what are the results? At the very least, it should provide a more informative error message..

  • How to change font in just one column of JTable

    I have a table with 4 column.
    I want to have Courier font in column number 2, and Arial in columns number 1, 3 and 4.
    With:
    table.setFont(new Font("Courier New", Font.PLAIN, 12));
    I can set fonts in all columns but how to set font in just one column.
    Thanks
    Srdan

    Hi,
    there are 2 methods of JTable where every rendering resp. editing component "comes" through - prepareRenderer(...) and prepareEditor(....) - by overwriting this methods and calling its super method first you get the component and can manipulate it before you return it. This component is exactly that, what is used for rendering resp. editing afterwards.
    greetings Marsian

  • How to show different Look & Feel to different users?

    Hi,
    how to show different Look & Feel to different users?
    Thanks & Regards,
    Venu--

    If you want the user to select then LookAndFeel then Visitor Tools.
    If you want to use code and dynamically change it then http://download.oracle.com/docs/cd/E13155_01/wlp/docs103/javadoc/index.html?com/bea/netuix/laf/PortalLookAndFeel.html
    if you have only a few combinations then you could even create different desktops and direct the user to the appropriate url

  • How to boldface the header for ONE column

    hi,
    I want to know how to boldface the header for ONE column. The following will boldface the header for all the columns in the table
    table.getTableHeader().setFont(new java.awt.Font("Dialog", 1, 12));
    Thanks.
    Jrabi

    jtable.getColumnModel().getColumn( indexOfBoldColumn ).setHeaderRenderer( TableCellRenderer aRenderer )

  • HOw to I get thumbnails to show in more than one column in Finder?

    When viewing images in Finder - they only show up in one column when I am in the thumnail view - how can I get them to show in multiple columns?
    Thanks

    This is Column view. When you select any item in any column, another column comes up on the right until an icon - with no content - is displayed in the far right column.

  • How to set different renderers to same column

    I am trying to set different renderer to same column.
    table.getColumn("columnname").setCellRenderer(
                   FirstCellRenderer);
    table.getColumn("columnname").setCellRenderer(SecondCellRenderer);
    I want both to work at the same time.
    It is taking the second renderer but not first.
    Can anyone please help me, how can i achive it.

    In my situation i need first renderer for all the columns in the table.
    Second renderer only for one column.(which shows thw column value as tooltip)
    Can you please tell me how can i do it.
    when i tried to consolidate in one renderer , it is showing me the same value to all the columns.

  • Help with lists and Numbers - how can I separate data from one column?

    I have a series of data entries that have two or three pieces of information listed in one column (it was a list copied from the Internet). My data is in this form all in one column (ie Column A):
    XXXX -- YYYY, ZZZZ
    I want to be able to easily split that data into three columns (A, B, and C) without having to go through and manually separate all of the entries? I'd ideally like to have XXXX in one column, the '--' removed, YYYY in another column, and ZZZZ in a third column, like this:
    Column A Column B Column C
    ====== ====== ======
    XXXX YYYY ZZZZ
    Is this possible? Any help is appreciated.

    BlooGoo
    Open or paste your material in your favorite texteditor. TextEdit will suffice but there are better applications. Make sure your material is consistent, especially that there are no stray characters or extra spaces studded in the text. You can do this by using the clean up routine as described below.
    1. Copy the set of characters you want to replace. In this case " -- " Note that there are spaces on each side of the dashes and you want to get rid of those.
    2. Open the *Find and Replace* dialogue:
    +Menu > Edit > Find > Find…+ (or command f)
    Paste the " -- " into the Find: field, then type a comma in the Replace: field or
    Copy and paste a tab from the document or
    Click on the Advanced button and enter a tab using the Insert… button that appears.
    3. Click *Replace All.*
    Repeat as necessary. If it doesn't seem to work, copy and paste the bits that stick, usually there is something not visibly different but different as far as the computer iust concerned.
    When you are finished save the results as a comma or tab delimited delimited .txt file and reopen it in Numbers.
    Peter

  • How do I add more than one column to a table using SQL?

    Hi
    I need to add 3 columns to a table using SQL
    the syntax
    "ALTER TABLE TEST ADD COLUMN newcol1 float";
    works fine - for adding one coumn only.
    For multiple columns I tried various permutations along the lines of
    "ALTER TABLE TEST ADD (COLUMN newcol01 float, COLUMN new2 float,COLUMN new3 float)";
    "ALTER TABLE TIPSTEST ADD COLUMN new1 float"
    "ALTER TABLE TIPSTEST ADD COLUMN new2 float"
    "ALTER TABLE TIPSTEST ADD COLUMN new3 float"
    etc., but this doesn't work.
    From a web search it sounds like SQL can only add one column at a time.
    I have a workaround : create intermediate temporary tables , copying data and adding
    one column at each stage. It seems a fairly awkward way of programming though.
    Am I missing something simple : is there a way to add multiple columns in one go?
    Thanks

    OK : solved an underlying problem with this one myself
    for the code
    String createString;
    createString =  "select COFFEES.* INTO NEWCOFFEES FROM COFFEES"; // example
              Statement stmt;
              try {
                   stmt = a_Globals.database1Connection.createStatement();
                          stmt.executeUpdate(createString);
                   stmt.close();
                   a_Globals.database1Connection.close();
              } catch(SQLException ex) {
                   System.err.println("SQLException: " + ex.getMessage());
              }                    commenting out the line:
    a_Globals.database1Connection.close();
    Allowed the subsequent SQL statement(s) to work OK. Looks like this was the cause of several
    difficulties, preventing me doing several SQL instructions in turn.
    Thanks for the responses.
    Mike2z

  • How to disable drill option for one column in the WebI Report

    Hi,
    How to disable drill option in a column in WebI?
    When the Drill option is enabled by default all the column in the report will have that enabled,
    I ahve added Hierarchy in the Custom hierarhcy list in Universe.
    I am using BOXI3.1 WebI Reports.
    But I wanted only the hierarchy column to have that drill option enabled, rest all column should display text data.
    PLease let me know if you have any idea.
    Thanks in advance.
    Regards

    Cretae the variable at the report level (may be with the same definiton) and then use that variable in the table
    to disable the drill. It will be displayed as normal text object.
    Drill functionality is enabled only on the objetcs coming from the universe.
    Regards,
    Rohit
    Edited by: rohit12 on Mar 11, 2010 10:12 AM

  • How to Show Different set of  Blob images in every page

    Hi i am using Crystal Report Server XI RAS Embedded Edition to built Dynamic Reports.
    Now i  have two datasets
    1. Main query with imageid field
    2. list of image blobs.
    this two datasets are linked with imageid  field and binded to ReportClientDocument.
    i have to show different image fields in every page of the report.  this images are differ in width and heights.
    i am able to show a single constant image field object from blob database field.
    but i could not able to find the solution to show different set of multiple images in different pages of the report.
    is there any formulas can be written or kindy give me a solution to achieve this.
    Regards,
    Padmanaban V
    Edited by: Padmanaban Viswanathan on Mar 15, 2010 11:59 AM

    See RAS samples [here|https://wiki.sdn.sap.com/wiki/display/BOBJ/NETRASSDK+Samples]. Look for "NET-CS2003_RAS-Managed_BE115_Add_Image" or "NET-VB2003_RAS-Managed_BE115_Add_Image-From-File".
    Ludek

  • How to get Maximum value in one Column

    Here example
    I have table with one column named as "Title" i want the result as which data length in "Title" is more than 2.
    Title
    AAA
    A
    AAAAA
    AA
    i want result as :
    AAAAA
    AAA
    Thankx in Advance

    select title from <tab> where length(title) > 2;
    You could also use dump(title) to get the internal representation and length.
    Message was edited by:
    Stellios

  • How to show different size of custom fonts on different mobiles

    I am currently working on a J2ME project on which we are using low level API. We want to display custom fonts on mobiles and we want to show different size of fonts according tot he resolution and screen density of mobile screen resolution is provide by J2ME but screen density is not provided is there any way to calculate screen density using WURLF, Or any other third party api or JSR.

    See RAS samples [here|https://wiki.sdn.sap.com/wiki/display/BOBJ/NETRASSDK+Samples]. Look for "NET-CS2003_RAS-Managed_BE115_Add_Image" or "NET-VB2003_RAS-Managed_BE115_Add_Image-From-File".
    Ludek

  • How to do a count on one column with a group by on another column

    Hello there
    I have one report that I need to generate. On that report there are several measure columns. Column A is number of calls, column B is type of calls.. Now I need a new column which is column C, and C need to be a count (A) group by B..
    I know how to do that in OBIEE, but how would I be able to do that in BIP template builder? I can use calculation function "count" on column C, but how would i defined it is grouped by column B?
    Please help
    Thanks

    Let's say a given XML structure is as following
    *<?xml version="1.0" encoding="UTF-8" ?>*
    - <-Quote>
    - <service>
    *<account>ATAHU</account>*
    *<ContractedProductsOnlyFlag>N</ContractedProductsOnlyFlag>*
    *<accountId>BMP8</accountId>*
    *<accountType>Customer</accountType>*
    *</service>*
    - <service>
    *<account>ATAHU</account>*
    *<ContractedProductsOnlyFlag>Y</ContractedProductsOnlyFlag>*
    *<accountId>BMP8</accountId>*
    *<accountType>business</accountType>*
    - <service>
    *<account>Booot</account>*
    *<ContractedProductsOnlyFlag>Y</ContractedProductsOnlyFlag>*
    *<accountId>BMP8</accountId>*
    *<accountType>Customer</accountType>*
    *</service>*
    - <service>
    *<account>Booot</account>*
    *<ContractedProductsOnlyFlag>Y</ContractedProductsOnlyFlag>*
    *<accountId>BMP8</accountId>*
    *<accountType>Household</accountType>*
    *</service>*
    - <service>
    *<account>ATAHU</account>*
    *<ContractedProductsOnlyFlag>N</ContractedProductsOnlyFlag>*
    *<accountId>B-type</accountId>*
    *<accountType>Customer</accountType>*
    *</service>*
    *</service>*
    *</-Quote>*
    How would I be able to count "account" and group by "account" in a new column so for:
    Account Flag ACCOUNT ID Type
    ATAHU N BMP8 Customer
    ATAHU Y BMP8 BUSINESS
    BOOOT Y BMP8 CUSTOMER
    BOOOT Y BMP8 HOUSEHOLD
    ATAHU N B-TYPE CUSTOMER
    In the RTF template It will become:
    Account ACCOUNT count other columns
    ATAHU 3
    BOOOT 2
    Please advice
    Edited by: user7276913 on Sep 16, 2009 12:47 AM

Maybe you are looking for