Display images in rows & columns using dataTable in JSF 2.0, netbeans 6.9.1

Hi,
I have to display only images on a web page in JSF2.0 in Netbeans. I am using datatable and column to do so. But there is one problem.
All images are display only in single column(i.e. vertically). I want to display in rows and columns not only column.
e.g. One row will have atleast 3 images and more rows like this.
Which attribute should i use of datatable? or should i use some other tag?
My code is:
<h:dataTable var="images"
value="#{jsfMBean.allImages}"
rules="none"
cellpadding="20"
border="0" >
<h:column>
<h:graphicImage value="faces/WEB-INF/upload/#{images.picid}" width="300px" height="100px" />
</h:column>
</h:dataTable>
Thanks.
NetBeans 6.9.1
JSF 2.0 with facelets
glassfish 3.0
Enterprise java beans
PrimeFaces 3.0

I believe you are looking for the panelgrid, not the datatable.
Note that there are a few useful websites online that list the available JSF tags plus their properties, such as these:
http://www.horstmann.com/corejsf/jsf-tags.html
http://www.exadel.com/web/portal/jsftags-guide

Similar Messages

  • Not able to display data in different columns using Unicode encoding

    Hi,
    Iam using Unicode encoding in my Java appln to support Japanese characters while downloading CSV report. But using the Unicode encoding displays all data in the first column of Excel sheet.
    Please let me know how to display data in different columns using Unicode encoding in Excel sheet.

    Hi Venkat,
    After extracting data into DSO check the request whether active or not.
    Check data in DSO in contents.
    If is there any restrictions on info providers in Queries.
    Let us know status clearly.......
    Reg
    Pra

  • Not able to display data in separate columns using Unicode encoding

    Hi,
    Iam using Unicode encoding in my Java appln to support Japanese characters while downloading CSV report. But using the Unicode encoding displays all data in the first column of Excel sheet.
    Please let me know how to display data in different columns using Unicode encoding in Excel sheet.
    This is an urgent need. Please help me out.

    Hi,
    I have no problem with item :P15_EV_LCL this is having a value my probem here is i am using java script to display the value in different color based on the condtion case
    eg:
    select
    case
    TRUNC((
    ( (NVL(Z."AEWP",0) - NVL(Z."BEWP_Final",0) ) / DECODE(Z."BEWP_Final",0,NULL,Z."BEWP_Final") ) * 100
    ),2)
    = :P15_EV_LCL
    then
    span style="background-color:lightgreen"
    || TRUNC((
    ( (NVL(Z."AEWP",0) - NVL(Z."BEWP_Final",0) ) / DECODE(Z."BEWP_Final",0,NULL,Z."BEWP_Final") ) * 100
    ),2) || '%' || /span
    else
    span style="background-color:yellow"
    || TRUNC(
    ( (NVL(Z."AEWP",0) - NVL(Z."BEWP_Final",0) ) / DECODE(Z."BEWP_Final",0,NULL,Z."BEWP_Final") ) * 100
    ),2) || '%' || /span
    end "Effort"
    from actuals Z
    If i dont use this <Span style="Background-color:color"> i am able to generate data in excel sheet if i use this color coding i am not able to get data in spread sheet.
    Please suggest
    Thanks
    Sudhir
    Edited by: Sudhir_N on Mar 23, 2009 10:00 PM

  • How to display images from BLOB column via APEX 4.0

    Hello,
    I did the following in order to display images of two Oracle records on the APEX page. I am using APEX Version : 4.0.1.00.03 , Oracle DB Version : 10.2.0.4.0.
    1. Created An oracle table TEST_FORM
    with 3 columns
    ( ID number, MIME_TYPE varchar2(255) , Image BLOB )
    2. Inserted two records
    10001, image/gif, ( actual image1)
    10002, image/gif, ( actual image2)
    3. created an Oracle procedure
    CREATE OR REPLACE PROCEDURE show_my_form ( p_image_id IN test_form.id%type) AS
    l_mime test_form.mime_type%type;
    l_length NUMBER;
    l_file_name VARCHAR2 (2000);
    lob_loc test_form.IMAGE%type;
    BEGIN
    SELECT mime_type, IMAGE
    , DBMS_LOB.getlength (IMAGE)
    INTO l_mime, lob_loc, l_length
    FROM test_form
    WHERE id = p_image_id;
    owa_util.mime_header(l_mime, false);
    htp.p ('Content-length: ' || l_length);
    owa_util.http_header_close;
    wpg_docload.download_file (lob_loc);
    END show_my_form ;
    4. In Apex 4.0
    step1. Created an interactive report on a new APEX page
    step2. Specified the following in the Region Source
    select id, mime_type, '<img src="#OWNER#.show_my_form ?p_image_id=#ID#" />' photo
    from TEST_FORM
    The column result shows as <img src="CCS.show_my_form?p_image_id=#ID#" />
    I am unable to display the column image as a link to a proper image photo.
    Could you please advise me if I missed anything ?
    Thanks a lot.
    Regards
    Susanna
    Edited by: user10318332 on 13/12/2010 15:51
    Edited by: user10318332 on 13/12/2010 20:10

    Maybe the space you have before the ? is causing issues. there shouldn't be any space.
    Your procedure looks to be much the same of one that I have.
    Have you granted execute on your procedure?
    Also, what version DB are you running? This could be another issue: http://daust.blogspot.com/2006/04/xe-calling-stored-procedures.html
    But anyway, you don't need to create your own procedure these days. You could do the following:
    in your query, have a column: dbms_lob.getlength(blob) photo ; save, then in column attributes for that column, apply a format mask. There is usually a link below the text box for the format mask - BLOB Download Format Mask, which will help you build the format mask. But it is documented here: http://download.oracle.com/docs/cd/E17556_01/doc/user.40/e15517/advnc.htm#BCGGJHEF
    Ta,
    Trent

  • Apex 4.0 display image item :BLOB column returned by SQL statement

    Hello
    I'm creating an display image item in apex 4.0. The source is a BLOB column returned by SQL statement.
    When I'm issuing an sql statement like this:
       select lado.blob_content
       from   large_documents      lado
       ,        large_doc_headers    ladh
       where lado.ladh_nr = ladh.nr
       more criteriait works fine.
    When I create a function inside a package with the same query (in a cursor)
    function get_image(some parameters in) return blob
    Following in apex by:
    select get_image(some parameters) from dualI get a
    ORA-06502: PL/SQL: numeric or value error: character string buffer too smallAnybody any idea why this does not work?
    Regards Erik

    Hi Eric,
    the environment assumes varchar2-output by default, which will be limited to 32767 characters and may have problems with binary formats. You could define a blob-variable to select the value into.
    DECLARE
      l_blob BLOB;
    BEGIN
      SELECT get_image(some parameters)
        INTO l_blob
        FROM dual;
    END;
    /If you expect the BLOB-Content to be text (you should consider CLOB then), you may use UTL_RAW.CAST_TO_VARCHAR2 to convert the content. If your object is larger than the maximum varchar2 size, or you want to convert BLOB to CLOB, you might be interested in some converter like described here: {message:id=559749}
    Hope this is what you were searching for.
    -Udo

  • Displaying image from binary data using java

    hi there,
    i have created a swing applet displays me a url, what the url returns me is the image in binary format, and i want to show the complete image using that binary data
    so how do i do it.
    some thing like this :
    URL url = new URL("http://192.168.1.1:8086/file-storage/download/Zerg.jpg?version_id=35688");
    JEditorPane jep = new JEditorPane();
    jep.setPage(url);
    output is in binary on my applet window.

    Hey,
    This displays an image from a url, you could check if your url is and image or not using URL.getFileName() and see if it ends in gif jpeg etc. and then display it this way.
    hope it helps
    Nick Hanlon
    import java.awt.*;
    import java.awt.Image.*;
    import java.awt.Toolkit.*;
    import javax.swing.*;
    import java.awt.event.*;
    import java.net.*;
    import java.io.*;
    import javax.swing.text.html.*;
    public class SimpleApp extends JFrame {
    public static void main(String args[]) {
    SimpleApp aFrame = new SimpleApp();
    public SimpleApp() {
    super("Frame");
    /*JEditorPane jep = new JEditorPane();
    jep.*/
    try {
    HTMLEditorKit htmlKit = new HTMLEditorKit();
    JEditorPane ep = new JEditorPane();
    try {
    ep.setEditorKit(htmlKit);
    BufferedReader in = new BufferedReader(
    new StringReader(
    "<HTML><IMG SRC=\"http://developer.java.sun.com/images/chiclet.row.gif\"></HTML>"));
    htmlKit.read(in, ep.getDocument(),0);
    getContentPane().setLayout(new BorderLayout());
    setResizable(false);
    getContentPane().add(ep, "North");
    pack();
    show();
    } catch (javax.swing.text.BadLocationException e) {}
    } catch (IOException e) {}
    addWindowListener(new WindowAdapter() {
    public void windowClosing(WindowEvent e) { System.exit(0); }
    }

  • Display image in datagrid column

    I have a datagrid with a column that displays true or false
    if an item "has children" or not. How would I go about placing an
    image in the column depending on the value of the column. I want to
    have two different images one for false and one for true.

    make your item renderer a canvas, with 2 images.
    when your canvas loads, you have the 'data' of that cell. So
    lets say your column's datafield is "hasimage", you can do
    something like this:
    <mx:Canvas xmlns:mx="
    http://www.adobe.com/2006/mxml"
    creationComplete="created();">
    override public function set data(value:Object):void
    if(value != null)
    super.data = value;
    public function created():void
    if(data["hasimage"] == "true")
    trueImg.visible = true;
    else
    falseImg.visible = true;
    <mx:Image id="trueImg" src="image" visible="false" />
    <mx:Image id="falseImg" src="image" visible="false" />
    </mx:Canvas>

  • Update multiple rows & columns using a single statement

    I have the following table with tablename - emp
    first_name last_name age
    aaa bbb 31
    56
    78
    ggg hhh 36
    2nd & 3rd row contain null values (no data) in first_name & last_name column . I want to update those two rows with data using a single statement. How do I do it?
    I was thinking may be something like the following:-
    UPDATE emp
    SET first_name= , last_name=
    CASE
    WHEN age = 56 THEN 'ccc', 'ddd'
    WHEN age = 78 THEN 'eee', 'fff'
    ELSE first_name, last_name
    END
    -----------------------------------------------

    Can you give an example of a nested decode statement.
    test@ora>
    test@ora>
    test@ora> --
    test@ora> drop table t;
    Table dropped.
    test@ora> create table t as
      2  select rownum x, cast(null as varchar2(10)) y from all_objects
      3  where rownum <= 10;
    Table created.
    test@ora>
    test@ora> select x, y from t;
             X Y
             1
             2
             3
             4
             5
             6
             7
             8
             9
            10
    10 rows selected.
    test@ora>
    test@ora> -- You want to change the values of y to 'a' through 'j' for x = 1 through 10
    test@ora> -- and y = 'X' otherwise
    test@ora> --
    test@ora> -- Let's say the limit on the number of components were 12
    test@ora> -- Then your decode statement would've been:
    test@ora> --
    test@ora> update t
      2  set y = decode(x,
      3                 1, 'a',
      4                 2, 'b',
      5                 3, 'c',
      6                 4, 'd',
      7                 5, 'e',
      8                    'f');
    10 rows updated.
    test@ora>
    test@ora>
    test@ora> select x, y from t;
             X Y
             1 a
             2 b
             3 c
             4 d
             5 e
             6 f
             7 f
             8 f
             9 f
            10 f
    10 rows selected.
    test@ora>
    test@ora> -- As you can see you are unable to:
    test@ora> --
    test@ora> -- change y to 'g' if x = 7
    test@ora> -- change y to 'h' if x = 8
    test@ora> -- change y to 'i' if x = 9
    test@ora> -- change y to 'j' if x = 10
    test@ora> -- change y to 'X' otherwise
    test@ora> --
    test@ora>
    test@ora> -- What you would do then is -
    test@ora> -- (i)  Let the 11 components remain as they are and
    test@ora> -- (ii) Introduce a nested decode function *AS THE 12TH COMPONENT*
    test@ora> --
    test@ora>
    test@ora> rollback;
    Rollback complete.
    test@ora>
    test@ora> --
    test@ora> update t
      2  set y = decode(x,
      3                 1, 'a',
      4                 2, 'b',
      5                 3, 'c',
      6                 4, 'd',
      7                 5, 'e',
      8                 decode(x,
      9                        6,  'f',
    10                        7,  'g',
    11                        8,  'h',
    12                        9,  'i',
    13                        10, 'j',
    14                            'X')
    15                );
    10 rows updated.
    test@ora>
    test@ora> select x, y from t;
             X Y
             1 a
             2 b
             3 c
             4 d
             5 e
             6 f
             7 g
             8 h
             9 i
            10 j
    10 rows selected.
    test@ora>
    test@ora>HTH
    isotope
    Extrapolate that to 255 components and you get 254 + 255 = 509 components. And so on...
    Message was edited by:
    isotope

  • Insert Image in SharePoint List & Display Image from SharePoint List using C# Pragmatically

    hi 
    i have a share point custom list with the following columns and its types.
    Title--------------->Single line of test 
    FirstName--------------->Single line of test
    LastName--------------->Single line of test
    Description--------------->multiple line of test
    Link--------------->Hyperlink or Picture
    Image--------------->Hyperlink or Picture
    I've to create a visual web part with the following input fields and which can insert following items in the above list columns
     Title                  asp textbox
    First Name         asp textbox
    Last Name        asp textbox
    Description        asp textbox
    Link                  asp textbox
    Image              file upload control
    Submit             asp button
    when i click browse button for image control in above web part it browses image .jpg,jpeg or .png file from my computer into image input field above and when i click submit button it must be submitted in the Image column in the above list.
    i want to know how can i do that in c# pragmatically. 
    i've another visual web part which should read the image from the list in Image column and display it in image control on the web part.
    like this
    <img id="imgdisplay" runat="server" src="" />
    how can i read image from image column through c# pragmatically.

    Hello,
    You can't directly add picture into "Hyperlink or Picture" column because this column takes URL value and image is binary etc. You can first upload that picture into picture library (create new picture or document library) then add that image link
    into that column.
    To add/edit "Hyperlink or Picture" column, SP provided special class called "SPFieldUrl". Wheer you need to pass URL and description as parameter.
    Refer this link for you ref:
    http://stackoverflow.com/questions/23829576/how-to-decide-sharepoint-url-field-is-set-as-hyperlink-or-picture
    Hope it could help
    Hemendra:Yesterday is just a memory,Tomorrow we may never see
    Please remember to mark the replies as answers if they help and unmark them if they provide no help

  • Displaying image, stored in KM, using HTMLB image UI Element...

    Hello all,
    I want to display the images in HTMLB UI Element which are stored under KM folder.
    Image element requires src field to be filled with URL. So do I need to provide the full path to images including server's host name and port (e.g. http://<server>:<port>/irj/servlet/../KMDocs/..)? or is there any work around for this.....
    Thanks in advance.
    Amol.

    Hi Amol,
    Yes there is.
    Actually two ways:
    1. Use request.getServletRequest.getServerName() and  request.getServletRequest.getServerPort()
    2. Use the url from "/irj" and forth (then the server and port of the opening window will be used).
    Hope that helps,
    Yoav.

  • Can text be displayed in a formula column using mathematical functions?

    I am working with Financial Reports version 11.1.1.3 and I'm trying to accomplish the following scenario:
    Column D is a data column
    Column E is a text column containing the value "TEXT"
    Column F is a formula column with the following formula: IfThen([D]=0,[E],[D])
    What I want to see happen is if the value in column D is 0 then I want the value "TEXT" to appear in column F, otherwise; I want to show the data value that is in column D. Is it possible to display text in a formula column and if so, what is the syntax for that? Or does anyone have another way to accomplish this? Any help would be appreciated.
    Thanks!

    Short answer: No.
    For your particular issue, I would suggest putting your TEXT value in the #zero and #missing overrides in Report Studio.
    In general, Hyeprion Reporting does not do any real text validations or functions like you could use in Excel.

  • How to display images on labview interface using matrox meteor card acquisition

    how to acquire images on lab view interface.

    Hi,
    you have to use National Instruments IMAQVision library and Meteor drivers
    for this library. For drivers look at www.matrox.com, thirth party software.
    For doing image processing algorithms you need the IMAQVision library but
    when you only need acquiring and displaying in LV6.1 I think some basic acq.
    vi's are included.
    Good luck,
    Marc
    "abdel_73fr" wrote in message
    news:[email protected]..
    > how to acquire images on lab view interface.

  • Command Link as a row of a datatable in JSF

    Hi All,
    I am new to JSF. I have a Datatable with n number of rows.
    I would like to have a command Link in each of the rows, so that when i click the command link i should get the data of the entire row in my edit page.
    Can anyone suggest how can i achieve this.
    Regards
    SN

    Hi,
    Do following:
    1- add a datatable in your page and fill it with data comes from database(Assume u have no problem with datatable)
    2- add a column as commandLink in data table. e.g.
    <h:column>
    <f:facet name="header">
    <h:outputText value="name" />
    </f:facet>
    <t:commandLink action="editObject" immediate="true" >
    <h:outputText value="#{theobject.name}" />
    <t:updateActionListener property="#{objectForm.id}" value="#{objectDto.id}" />
    </t:commandLink>
    </h:column>
    in this code:
    "name" is header of column,
    "editObject" is defined in navigation rule to navigate to edit page, lets say object form.
    "theobject.name" the value that mouse gets finger over it!
    "objectForm.id" the pointer to an "id setter" of a managed bean (named objectForm) defined in faces-config.xml. In this setter you can load corresponding data from database
    "objectDto.id" the pointer to an "id getter" of a managed bean (named objectDto) defined in faces-config.xml. this getter return the id of the entity row you clicked on.
    3- Clearly, you need to defined all managed beans, and dont forget to have a customized setter for id of objectForm (setId) to load the entity from database and fill all editable properties(as you like) in this function (setId).
    4- you need a JSF page to redirect to it for editing properties and feed by objectForm
    5- Thats it :)

  • Displaying images in many rows

    Hello everyone. I have images in my database that I want to
    display on my home page. The issue I'm having is that I want to
    display 7 images per row and have 2 rows. After the first 7 images
    are displayed, I want to start a new row automatically with an
    additional 7 images and don't know how to do that. Can someone
    please help?

    I still cannot get the code to work. Right now it's
    displaying images as one column down the left side of the page.
    <cfset counter = 0>
    <!--- Grab the most recent profiles --->
    <cfquery name="latest_joiners" datasource="db"
    maxrows="14">
    SELECT * FROM db ORDER BY id DESC
    </cfquery>
    <table border="0" cellspacing="0" cellpadding="2"
    width="100%">
    <tr>
    <cfloop query="latest_joiners">
    <td>
    <img src="images/pictures/#pic_path#" height="70"
    width="98" border="1">
    </td>
    <cfif (counter MOD 7) IS 0>
    </tr>
    </cfif>
    </table>
    </cfloop>

  • Displaying image from Database with php

    Hello everybody,
    I'm working on a website that displays videos courses and tutorials as my final project
    and I'm working with "Flash builder 4" the database with mySQL and the application server with php
    Basically, the goal is to display a datagrid that shows the manager of the website in column all the information stored on the "Course" table
    the structure of the table is :
    Course (id,img,src,title,description)
    -id : primary key
    -img : path to a photo of course {for example picture of JAVA}
    -src : path to the playlist file {xml file}
    -title : String
    -description : String too
    I already succeeded to display all these contents on a DataGrid, but not with the image, I couldn't display an imageon its column using the path stored on the database, I used a DataRenderer to do that, and here is my code for Renderer and the DataGrid.mxml
    CourseGrid.mxml
    <?xml version="1.0" encoding="utf-8"?>
    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
       xmlns:s="library://ns.adobe.com/flex/spark"
       xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600" xmlns:courseservice="services.courseservice.*">
    <fx:Script>
    <![CDATA[
    import Renderers.CourseDeleteRenderer;
    import Renderers.CourseImageRenderer;
    import mx.controls.Alert;
    import mx.events.FlexEvent;
    protected function dataGrid_creationCompleteHandler(event:FlexEvent):void
    getAllCourseResult.token = courseService.getAllCourse();
    ]]>
    </fx:Script>
    <fx:Declarations>
    <s:CallResponder id="getAllCourseResult"/>
    <courseservice:CourseService id="courseService" fault="Alert.show(event.fault.faultString + '\n' + event.fault.faultDetail)" showBusyCursor="true"/>
    <!-- Place non-visual elements (e.g., services, value objects) here -->
    </fx:Declarations>
    <mx:DataGrid x="10" y="10" id="dataGrid"
    creationComplete="dataGrid_creationCompleteHandler(event)"
    dataProvider="{getAllCourseResult.lastResult}"
    width="100%">
    <mx:columns>
    <mx:DataGridColumn headerText="" dataField="img" sortable="false" itemRenderer="Renderers.CourseImageRenderer"/>
    <mx:DataGridColumn headerText="id" dataField="id"/>
    <mx:DataGridColumn headerText="src" dataField="src"/>
    <mx:DataGridColumn headerText="title" dataField="title"/>
    <mx:DataGridColumn headerText="description" dataField="description"/>
    <mx:DataGridColumn headerText="Delete" itemRenderer="Renderers.CourseDeleteRenderer"/>
    <mx:DataGridColumn headerText="Update" itemRenderer="Renderers.CourseUpdateRenderer"/>
    </mx:columns>
    </mx:DataGrid>
    </s:Application>
    CourseImageRenderer.mxml
    <?xml version="1.0" encoding="utf-8"?>
    <s:MXDataGridItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009"
      xmlns:s="library://ns.adobe.com/flex/spark"
      xmlns:mx="library://ns.adobe.com/flex/mx"
      focusEnabled="true">
    <mx:Image source="{data}" width="60" height="60"/>
    </s:MXDataGridItemRenderer>
    Result :
    Problem :
    How can I access to the path of the image, I tried to write "data.img" instead of "data" as img is the name of the column in the database that stores the path but it wasn't successful.
    I know that it not complete statement "data" because "data" is a reference to what the DataGrid provides of information that gets from the (CreationComplete) event.
    Question :
    - Can you please help me with this so I can complete displaying images by accessing to what is on the column in tha DB so I can manipulate my datas that is stored there ?
    ==> I still have some questions about the buttons to update and delete datas fomr the DataGrid, but, until now I need to access successfully to the photo and display it
    Thank you,

    Anyone that can help me with this ?
    Please, try this with me, I'm asking Flex developpers this might be easy for you !
    It's just question of how to access the string stored in the variable "data", when I used XML I just type the path to the repeated element like this :
    XML file :
    XML File
    <parent>
    <child>
    <repeated_child></repeated_child>
    <repeated_child></repeated_child>
    <repeated_child></repeated_child>
    </child>
    </parent>
    I used a Model as a reference to the xml file
    and an arrayList as a container of the repeated child
    I just write in the code "data.parent.repeated_child" to access the text in the "repeated_child"
    and here is the code, that I implemented to generate videos from xml file to display a video play list
    Video Playlist code(extract from XML file "data.xml")
    <fx:Declarations>
    <fx:Model id="model" source="assets/data.xml"/>
    <s:ArrayList id="products" source="{model.video}"/>
    </fx:Declarations>
    <mx:List  dataProvider="{products}" labelField="title"
      change="list1_changeHandler(event,List(event.currentTarget).selectedItem)" x="103" y="77" height="350" width="198"/>
    That was my goal to do that with the database.
    Please help me
    If you have other solution I still need it.
    Thank you,

Maybe you are looking for