Display image into Data Grid
Hello,
I have to display into a data grid, in Flex 2, 2 columns:
first column ( "Images") must contain a picture with an object and
second column (" quantity") must contain the amount of that object
that I want to buy. The problem is that I must take the name of the
image from an .xml file, specified like this:
<mx:DataGrid id="obj" dataProvider="{ObjList}" > where
ObjList is the .xml file with <name/>
<picture_address/> etc.
The second column must contain a textbox so I can input a
number of items for each picture ( can be also a combobox where
from I can select some value, from 1 to 20 for example).
I've searched the Internet and I haven't found a solution
yet. Please give me a link or a solution for this problem.
Tudor
use itemrenderes.... the example below shows how to add an
image.... you can do the same thing with a text box or combo box
<mx:DataGridColumn width="10" headerText="Image">
<mx:itemRenderer>
<mx:Component>
<mx:Canvas width="100%" height="100%">
<mx:Image verticalCenter="0" horizontalCenter="0"
source="{data.picture_adress}""/>
</mx:Canvas>
</mx:Component>
</mx:itemRenderer>
Similar Messages
-
How to display image and data in module pool screen?
Hi,
I want to display image and relevant data besides the image in module pool screen, I am using docking container to display the image.
Actually I am able to display image or data any one but not both.
one more thing I want to display multiple images and their data.
Please suggest some one if you have any idea.
Regards,
Dileep.You can try below way, I have used in report.
DATA: gc_docking TYPE REF TO cl_gui_docking_container, "#EC NEEDED "Docking Container
gc_split TYPE REF TO cl_gui_easy_splitter_container, "#EC NEEDED "Splitter
gc_top_container TYPE REF TO cl_gui_container, "#EC NEEDED "Top Container
gc_bottom_container TYPE REF TO cl_gui_container, "#EC NEEDED "Bottom Container
gc_document TYPE REF TO cl_dd_document, "#EC NEEDED "Document
gc_events TYPE REF TO lcl_event_class, "#EC NEEDED " Local Event Class
gc_grid TYPE REF TO cl_gui_alv_grid, "#EC NEEDED " ALV Class
" Creating Docking
CREATE OBJECT gc_docking
EXPORTING
ratio = c_95.
IF sy-subrc EQ 0.
* Splitting the Docking container
CREATE OBJECT gc_split
EXPORTING
parent = gc_docking
sash_position = c_10 "Position of Splitter Bar (in Percent)
with_border = c_1. "With Border = 1 Without Border = 0
ENDIF.
* Placing the containers in the splitter
gc_top_container = gc_split->top_left_container .
gc_bottom_container = gc_split->bottom_right_container .
* Creating Grid
CREATE OBJECT gc_grid
EXPORTING
i_parent = gc_bottom_container.
ELSE.
* Background job handling
CREATE OBJECT gc_grid
EXPORTING
i_parent = gc_docking.
ENDIF.
* Creating the document
CREATE OBJECT gc_document
EXPORTING
style = 'ALV_GRID'.
Regards,
Sameer -
08/29/2008 08:58:48 AM
Reply | Quote | Top | Bottom | Edit
hi all,
i have two classes.
class User
public String name;
public int age;
public Address address;
class Address
public String city;
I'm passing a List<Users> to the data provider of a
data grid . I can display the values of properties of Users i.e,
name and age.. My issue is how do i display the value of city which
is a propertyt of Address class in the datagrid column..
thanx in advance
Mark this message as the answer.
Print this message
Report this to a ModeratorHi,
Try labelFunction property of the DataGridColumn.
labelFunction allow you to specify a function name, which will be
invoked when that data is rendered. You will get the Object (User
id your case) corresponding the row being rendered will be passed
as argument to the function. You can use the object and return the
value you want to be displayed.
Please find more details on labelFunction at the URL below
http://livedocs.adobe.com/flex/3/langref/mx/controls/dataGridClasses/DataGridColumn.html#l abelFunction
You can also try custom item renderer.
Hope this helps. -
How to divide an image into 100+ grids
Hi
I have a problem here;
I need to divide an image into 100 or more grids on client side and I need to get the id of a clicked grid on server side. I found some mapping ways but it seemed too hard to achieve. I achieved to get coordinates of mouse click but this time if user uses control button + mouse scroll, all coordinates of the image changes. Can anyone offer me a solution.ı am working on adf faces they wanted me to do that on server side. But I am very new at this and I am really confused right now. How can I map 100+ sub images like one big image. I saw some examples on web but they include just two or three mappings but how to do this mapping with many?? I tried to do this by taking coordinates of click and calculating which grid is clicked but everything fails if user resizes the window.
If there is a way to do that I was thinking of storing path of every grid on a list at server side and putting an image on the screen for every element of that list and by this way I could easly get which grid is clicked by just taking the id of clicked image. Can anyone help me to do this.??? -
Dividing an image into Hexagonal Grid
Hi Guys,
I have an image of a human body which needs to divided into Hexagonal Grid pattern and the hexagons should be highlighted on mouse rollover and also clicks. It will be time consuming if I make these hexagons manually coz they will around 1000 in numbers.
Also, I need to zoom the hexagons on clicks. Could you suggest me a way to do this?
Thank you.you'll need to use the bitmapdata class if you don't want the part of the grid that's outside the body to be visible.
the best place to check for tutorials is via google. i'm not sure you'll find anything specific to your current task. you might need to learn about the bitmapdata class and take it from there. -
To Display Image in Alv Grid....
Hello Gurus,
I want to display an image/icon ( custom icon ) in the ALV grid.
I know to display standard icons in ALV. But i dont know how to store custom icons in the system.
I want to display an icon or image depending upon certain conditions. i need to display these images/icons for each row of the ALV grid.
Please let me know if i can show images or icons ( not standard ) for each row in ALV grid.
<REMOVED BY MODERATOR>
Edited by: Alvaro Tejada Galindo on Feb 25, 2008 10:20 AMcheck out CL_GUI_PICTURE and the demo programs
SAP_PICTURE_DEMO
SAP_PICTURE_DEMO_ICON
RSDEMO_PICTURE_CONTROL
you can fit the picture in to the control with the following modes.
DISPLAY_MODE_FIT
other options
DISPLAY_MODE_NORMAL
DISPLAY_MODE_STRETCH
DISPLAY_MODE_NORMAL_CENTER
DISPLAY_MODE_FIT_CENTER
Regards
Raja -
How to Read Xml File and view into Data Grid View?
hi all
my Data into Xml file are:
<Voucher>
<Header>
<txtHeaderId>259803</txtHeaderId>
<txtDate>2015/02/01</txtDate>
<txtDocNo>20</txtDocNo>
<txtMemo>This is a Test .</txtMemo>
</Header>
<Item>
<txtItemId>8562803</txtItemId>
<txtHeaderRef>259803</txtHeaderRef>
<txtDesc>This is Number 1</txtDesc>
<txtDebit>350000</txtDebit>
<txtCredit>0</txtCredit>
<txtItemId>8562804</txtItemId>
<txtHeaderRef>259803</txtHeaderRef>
<txtDesc>This is Number 2</txtDesc>
<txtDebit>0</txtDebit>
<txtCredit>350000</txtCredit>
</Item>
</Voucher>
now i have two DataGridViews
i want that data from xml file show into the DataGridViews by this codes:
Private Sub btnReadXmlFile_Click(sender As Object, e As EventArgs) Handles btnReadXmlFile.Click
Dim Document As XmlReader = New XmlTextReader(txtPath.Text)
Dim ds As New DataSet
ds.ReadXml(Document)
DataGridView1.DataSource = ds.Tables(0)
End Sub
but i see this result:
why i do not see any result into DataGridView2(Item)
how to solve it ?
please help me .
thanks all
Name of Allah, Most Gracious, Most Merciful and He created the humannow how to correct it?
Name of Allah, Most Gracious, Most Merciful and He created the human
Please be explicit - I'm the only other one in this thread so I assume it's to me, but usually I just ignore the posts when the user isn't specific.
I don't know what there is to correct. Create a NEW dataset in code, add the two tables, and use the methods that I suggested.
I'm not a database guy so I can't get real specific. I create my own stuff in classes and use that but, if you're using SQL then there are lots of pro's here that can help you with specifics. I'm sure they'll need to know a lot more about your data, the
connection, and all that, but the concept should be fairly simple to implement.
Still lost in code, just at a little higher level. -
How to put an image in a data grid in Flex Builder 2
Hi All,
I need to populate a data grid with some text data received
from a web service and, in a particular column of the datagrid, I
have to put an image depending of a specific data returned me by
the web service.
It seems that there is the possibility to add an image in
data grid column with the cellRenderer properties, but this
property is available only for ActionScript 3.
I'm developing an application in Flex Builder 2 that run
ActionScript 2 and cellRenderer properties is not available. Is it
right?
If no, I will can use this cellRenderer properties in my
application. Please, can you show me an example?
If yes, there is a way to insert an image in datagridcolumn
with ActionScript 2?
Thank you very much
RegardsFlex Builder 2 uses Actionscript 3.
You will need to write a renderer for for this column.
There are a lot of examples of datagrids with images in them.
here is one from the livedocs
http://livedocs.adobe.com/flex/201/html/wwhelp/wwhimpl/common/html/wwhelp.htm?context=Live Docs_Book_Parts&file=cellrenderer_072_28.html -
Hi All,
Account calculations are not displaying on the data grid. But the values are being picked up with a smart view report.
I tried running a force calculate and a consolidate all, but that did not work.
Please suggest in this regards.
Thanks in advance....I tried to use your algorithm to modify my code but i am not able to do that. For this example i am not using any httpservice i am using data services. I created a PHP file i just need to import it into data services planel and drag that services onto data grid it will automatically bring all the data into that data grid. Can you tell me what i need to modify to achive my goal. am using following code
protected function dataGrid_creationCompleteHandler(event:FlexEvent):void
getHorizontalCommentResult.token = horizontalCommentsService.getHorizontalComment();
<mx:DataGrid x="159" y="123" id="dataGrid" creationComplete="dataGrid_creationCompleteHandler(event)" dataProvider="{getHorizontalCommentResult.lastResult}" height="223" width="245">
<mx:columns>
<mx:DataGridColumn headerText="Comments" dataField="Comments"/>
</mx:columns>
PP file
<?php
class HorizontalCommentsService{
public function getHorizontalComment() {
$connection = mysqli_connect("localhost", "root", "root", "my_db", 8889) or die(mysqli_connect_error());
$sql = "SELECT * FROM photo_comments ORDER BY Image_ID DESC";
$result = mysqli_query($connection, $sql) or die('Query Failed: ' . mysql_error($connection));
$rows = array();
while($row = mysqli_fetch_object($result)) {
$rows[ ] = $row;
return $rows;
?> -
Need help with data grid...
I have setup a profile card which displays information about individuals by pulling data from an XML database.
I have multiple text fields and couple movie clips that display images but i need a datagrid to display stats for each individual.
The stat information is set as attributes on a array of XML nodes each node is a year.
Example XML
<hockey>
<profile>
<name>Wayne Gretzky</name>
<image>pic1</image>
<dob>Jan 26, 1961</dob>
<position>Centre</position>
<height>6'0"</height>
<weight>185lbs</weight>
<history>"important information"</history>
<medal_record>
<medal standing ="Silver" Event =" 1981 Canada Cup" sport="Ice Hockey"/>
<medal standing ="Gold" Event =" 1984 Canada Cup" sport="Ice Hockey"/>
<medal standing ="Gold" Event =" 1987 Canada Cup" sport="Ice Hockey"/>
<medal standing ="Gold" Event =" 1991 Canada Cup" sport="Ice Hockey"/>
<medal standing ="Silver" Event =" 1996 World Cup of Hockey" sport="Ice Hockey"/>
</medal_record>
</profile>
<profile>
<name>Wayne Gretzky2</name>
<image>pic2</image>
<dob>Jan 26, 1962</dob>
<position>Right Wing</position>
<height>6'1"</height>
<weight>205lbs</weight>
<history>"important information"</history>
<medal_record>
<medal standing ="Gold" Event =" 1981 Canada Cup" sport="Ice Hockey"/>
<medal standing ="Bronze" Event =" 1984 Canada Cup" sport="Ice Hockey"/>
<medal standing ="Silver" Event =" 1987 Canada Cup" sport="Ice Hockey"/>
<medal standing ="Silver" Event =" 1991 Canada Cup" sport="Ice Hockey"/>
<medal standing ="Gold" Event =" 1996 World Cup of Hockey" sport="Ice Hockey"/>
</medal_record>
</profile>
</hockey>
The red information is what i need to get displayed by the Data Grid for each profile.
Standing
Event
Sport
Gold
1981 Canada Cup
Ice Hockey
Bronze
1984 Canada Cup
Ice Hockey
The swf has buttons to cycle through the profiles which loads the new information from the XML.
If you have a good understanding of how the dataGRIDs work please let me know if you can help as this is the last problem holding me from finishing this.
Thanks in advance.Update... I got the data pulling in but it doesnt change as the profile changes with the rest of the data.
-
after I load a object into data grid created from a web
service it will always seem to create a new blank row. When I get a
error after clicking on it, it always says "-1" for the rows count.
when I shrink the size of the datagrid it elminates some of the
extra row, but still there is a bit of it showing. how do I resize
the datagrid so it doesn't spit out a extra row, or a part of one.
http://www.ctrlzsc.com/other/pic.png
this is a pic showing the extra row, just look where my badly drawn
arrow is pointing to.hi, xyco45
you can set the dataGrid's height and the rowHeight. In my
experience, for example, first, you set the headerHeight="25" and
rowHeight="22", the height will be setted
(headerHeight+rowHeight*(rowNumbers)+1) or
(headerHeight+rowHeight*(rowNumbers)+2), I thought this question
will be solved. -
SQL Dev 1.5.3 Data Grid showing incorrect data
After upgrading to SQL Dev 1.5.3, I have seen instances of incorrect data displayed in the data grid (when displaying many records at a time), both in the Table Browser and in SQL Worksheet.
For example, in the grid, it shows a value 1234 for a column. Now when I query just that row, the correct results are shown.
Has anyone noticed this?
Thanks,
ManishAny updates on this? I am hitting this bug and it makes life very uncomfortable as I cannot trust the results.
SQL Developer 1.5.3 + JDK 1.6.11 on Windows XP. -
Displaying SQL result in data grid
I'm trying to access a local DB file using an Air app. I can
successfully create the connection and connect; what I'm really
stuck on is displaying the data from my request in a Data Grid.
Using this code I can see my records in the console, but how
do I get it into a data grid? It doesn't seem to want to go into an
ArrayColleciton.
quote:
function selectResult(event:SQLEvent):void
var result:SQLResult = selectStmt.getResult();
resultData = result;
var numRows:int = result.data.length;
for (var i:int = 0; i < numRows; i++)
var output:String = "";
for (var columnName:String in result.data
output += columnName + ": " + result.data[columnName] +
trace("row[" + i.toString() + "]\t", output);"arthurlockman" <[email protected]> wrote in
message
news:g7lfrq$qi$[email protected]..
>I want to have an image component that gets it's source
from the item that
>is
> currently selected selected in a data grid (like a
master detail region).
> I
> also want to do the same with a text box and a text
area. How do i do it?
yourDataGrid.selectedItem will contain the data from the
selected item. -
Display image from external resource into interactive form
Hi experts!
How can I display an image from a external url, for example "http://www.adobe.com/imageshome/pdfgift_home.gif" ??
I tried to do that:
1. Insert a "Image field"
2. Bind None
3. Embed image data: unselected
4. URL: $record.url
In "url" it's a context's variable. It's type is string. I save in url: http://www.adobe.com/imageshome/pdfgift_home.gif
4. Show: initialize
Script: this.value.image.href = xfa.resolveNode(this.value.image.href).value;
Language: JavaScript
Run at: Client
I can't save image into mimes' folder. It's a bussiness rule in my company.
Thanks
Gustavo Rodriguezhave you tried directly linking it to the image this way? instead of passing through the context to make sure you can access the image?
I just inserted an image on my form.
Bind none
Embed unchecked
URL http://www.adobe.com/imageshome/pdfgift_home.gif
Edited by: robert phelan on Jun 25, 2009 8:07 PM -
Hi !
I have received a set of datas via rs232 and it contains picture messages. I have to decode the datas first and then display them on a canvas.
I have known several functions that may be used . Such as
int SetBitmapData (int bitmapID, int bytesPerRow, int pixelDepth, int colorTable[], unsigned char bits[], unsigned char mask[]);
int CanvasDrawBitmap (int panelHandle, int controlID, int bitmapID, Rect sourceRectangle, Rect destinationRectangle);
However,I don't know how to set the following parameters according to the actual pixel values and color values.
int bytesPerRow, int pixelDepth, int colorTable[], unsigned char bits[], unsigned char mask[]
What's more,I have no idea how to decode the datas.
The attachment is a incomplete project. I will be very appreciated if anyone could help me .
Best regards.
xiepei
I wouldn't care success or failure,for I will only struggle ahead as long as I have been destined to the distance.
Attachments:
Decode and display image.zip 212 KBWell, things are getting a bit clearer now.
1. Your image is actually 240x240 pixel (not 320x240 as you told before). The size of image data is 57600 bytes which corresponds to that frmat (I was puzzled by such a data size compared with larger image dimensions!)
2. The image is a 8-bits-per-pixel one; this means that you must provide a color palette to create the bitmap
3. You cannot simply copy image data into bitmap fields in CVI: CreateBitmap always produce an image with pixeldepth matched with display colour depth (normally 24 or 32 bpp)
All that means that you must:
1. Create the appropriate color palette with 256 colors: it may be a grayscale or color palette depending on camera characteristics. Grayscale palette can be found in my sample project, while sample colour palettes can be found here (here the description of a "standard" 8-bpp color palette)
2. Create the bits array correctly dimensioned for the color depth of your monitor
3. Get each pixel value from the camera, lookup in the color palette for the appropriate colour and create the RGB informations into the bits array in memory
4. Display the bitmap on the canvas
As a first step, I would configure my system for 256-color display setting, create a bitmap and simply copy image data into it: you should be able to get the correct image back to your screen.
Proud to use LW/CVI from 3.1 on.
My contributions to the Developer Zone Community
If I have helped you, why not giving me a kudos?
Maybe you are looking for
-
Can print to shared Canon iP4300 via Bonjour - but not with Canon driver
I've searched the forums and therefore know roughly what the problem is, but still need some concrete info please... Have finally managed to share my Canon iP4300 connected to iMac (10.5.2) via USB and print to it from XP, using Bonjour for Windows.
-
How do i put classes in package in NetBean Environment
Hello, I install NetBean IDE for developing website using JSP and Servlet. I am using Internal Tomcat provided by this IDE. Problem is this i put java classes in the Class folder of Web-INF folder, but i am not able to access these classes from JSp p
-
I recently downloaded iTunes 10.6.1 on my windows laptop now when I open up iTunes it works fine untill I try to play a song then iTunes freezes no matter what song I play or how many times I restart my computer it just freezes when I try to play a s
-
Sync date and time with NTP??
Hi all, I'm looking to figure out how my Solaris 10 sync is date/time. I've looked in /etc/inet/ntp.conf and the file doesn't exist. I've looked at the "svc -l ntp" and here's what I got fmri svc:/network/ntp:default name Network Time
-
I cannot get my Itunes application to launch on Windows 7 64 bit - When I double click on the Itunes icon I get the iTunes Software license agreement pop up and when I click on Agree the pop up goes away and nothing happens after that. I have uninst