Item renderer for specific rows
I need to have a checkbox item renderer for a spark datagrid column. I am using the following to get an item renderer into column:
var checkBoxRenderer:ClassFactory = new ClassFactory(GridCheckBoxItemRenderer);
column.itemRenderer = checkBoxRenderer;
My question is if I need to show a checkbox for specific rows can I do that without going into GridCheckBoxItemRenderer's source code?
Thanks
Hi Zolotoj ,
Please go through following links :
http://stackoverflow.com/questions/1952940/show-itemrenderer-in-specific-datagrid-rows-oth ers-empty
http://www.flexer.info/2009/01/09/different-rows-in-datagrid-programmatically-added-itemre nderers-classfactory-and-ifactory/
It will provide you some idea to how to proceed further for this problem.
Thanks and Regards,
Vibhuti Gosavi | [email protected] | www.infocepts.com
Similar Messages
-
Two item renderer for one datagrid column?
hi
i have one doubt
can we use two item renderer for one datagrid column
any possibilities
why i am asking this because
during drag and drop i need one itemrenderer and during application initialization i need another itemrenderer
any possibilities
karthik.kHi,
I think your requirement can be completed by using ViewStack you can pass selected index to it according to requirement.
See:
<itemRenederer ...
<viewstack selectedIndex = 0 ...>
<vBox id="vBox1" >
Your 1st itemrenderer will come here....
</vBox>
<vBox id="vBox2" >
Your 2nd itemrenderer will come here....
</vBox>
</viewStack>
</itemRenederer>
You have to just toggle selectedIndex.
Thanks -
I have a button component as a Item renderer in the column of
the datagrid .
I am not able to access the Itemrenderer component(which I
declared in other mxml file in the datagrid)
This is the data grid where I have the Itemrenderer:
<mx:DataGrid id="dgCondition1"
variableRowHeight="true" width="100%" height="150"
verticalScrollPolicy="auto" editable="true"
dataProvider="{initDataGrid_Create}" >
<mx:columns>
<mx:DataGridColumn headerText="" dataField="conditi"
/>
<mx:DataGridColumn headerText="Condition"
dataField="syntax" width="300" />
<mx:DataGridColumn headerText="1" dataField="value"
width="80" editable="false" itemRenderer="buttonRenderer"/>
<mx:DataGridColumn dataField="value" headerText="2"
itemRenderer="buttonRenderer" />
I created a new mxml component for this button component
.(buttonRenderer.mxml)
<?xml version="1.0" encoding="utf-8"?>
<mx:VBox xmlns:mx="
http://www.adobe.com/2006/mxml"
width="400" height="300">
<mx:Script source="..TableDataGridBtn.as" />
<mx:Button id="col1" label="" width="75"
click="getDetail(event,col1)" />
</mx:VBox>
The Problem is I am not able to access the buttonRenderer in
the datagrid itemRenderer tag .
It says "Access of Undefined Property buttonRenderer"."nash99" <[email protected]> wrote in
message
news:g7alc5$nkd$[email protected]..
> So
> Is it that I can Use this ItemRenderer tag in the
Application Tags only
> Is there any other way I can use them in mxml components
because I am
> using
> the same button in 16 datagrid columns , I dont wan't to
make the code
> look
> redundant.
http://www.adobe.com/livedocs/flex/3/html/help.html?content=intro_3.html -
Setting Table Cell Renderer for a row or cell
I need to make a JTable that has the following formats:
Row 1 = number with no decimals and columns
Row 2 = number with no decimals and columns
Row 3 = percent with 4 decimals
I can use a table cell renderer to set each COLUMN as one or the other formats like this:
NumDispRenderer ndr = new NumDispRenderer();
for(int i = 1;i<dates.size();i++) {
table.getColumnModel().getColumn(i).setCellRenderer(ndr);
Where NumDispRenderer is a class as follows:
public class NumDispRenderer extends DefaultTableCellRenderer {
public Component getTableCellRendererComponent (JTable table, Object value,boolean isSelected, boolean isFocused, int row, int column) {
Component component = super.getTableCellRendererComponent (table,value,isSelected,isFocused,row,column);
if (value != null && value instanceof Double) {
DecimalFormat df = new DecimalFormat("###,###");
String output = df.format(value);
((JLabel)component).setText(output);
((JLabel)component).setHorizontalAlignment(JLabel.RIGHT);
} else {
((JLabel)component).setText(value == null ? "" : value.toString());
return component;
This is fine for the first two rows, but the third row (which is also an instance of Double) I would like to format differently.
The tutorial and other postings have not given a solution to this problem. Any suggestions would be very appreciated.Hi,
the method getTableCellRendererComponent() of your renderer gets the row as a parameter. So just create the label depending on that value. For 0<=row<=1 you create the label as is, and for row=2 you create another label with the Double formatted as you wish.
Andre -
Mass delete of PO item texts for specific PO and SA
Hi All,
I have thousands open PO's and SA's coming in during conversion in SAP system. For many of them we have material specifications and drawing number coming in from legacy and we populate them using standard BAPI create function module.
On the other hand we also have a BADI activated ME_PROCESS_PO_CUST which populates the PO item text 'spec details' from material master CLASSIFICATION and drawing number from BASIC DATA2.
We have a logic implemented saying if legacy file has a value in Material Specification it will not trigger the BADI, if the value is NULL it will trigger the BADI and fetch the data from Material Master.
But now we want to have the material specifications coming in from legacy as it is. If it has a value it will populate, if it is blank it will leave it blank.
My question is without a change around the BADI and PO create function module what are the ways to delete the item texts from the PO's and SA's for which legacy value is NULL. The deletion will be only for specific PO's, say out of 10000 PO line items posted in the system I want to delete Material Spec for 6000 of them. Appreciate your help in advance.
Edited by: biswajit guha on Mar 15, 2011 1:10 AMyou have to write your selection logic in a small ABAP and then call the funcion module DELETE_TEXT
-
Generic item renderer for Adv DG Columns?
Hello,
I'm trying to create a generic ItemRenderer for my Adv DG so that so that I can put a toolTip on the cells.
The Adv DG Column object doesn't have a toolTip property so I'm creating my own renderer...
As far as I'm aware I have to create an ItemRenderer that knows the fieldName that it is rendering so I can use {data.myFieldName}. I was hoping there was a property so that I can reference the value generically such as {data.text} but this obvisouly doesn't work...
Is there anyway around this? Can I pass a paramater to the itemRenderer? I'm doing it like this...
advancedDataGridColumn.itemRenderer = new ClassFactory(renderers.ToolTipFieldRenderer);
Alsok, there is a toolTip property of the AdvDG but the columns, what is the AdvDG.toolTip used for? Just a general toolTip? The reason why I need a toolTip is our client has asked to be able to mouse-over the cell to see the full value where the field value is chopped because it's too long for the column...
Hope that makes sense and hope you can help...
Cheers,
NickThe AdvancedDataGridColumn class has dataTipField and dataTipFunction
properties and these are supported by the default item renderer
(AdvancedDataGridItemRenderer), which is also generic. Here's an example:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application
xmlns:mx="http://www.adobe.com/2006/mxml"
layout="absolute">
<mx:Script>
<![CDATA[
import mx.collections.ArrayCollection;
private var dpADG:ArrayCollection = new ArrayCollection([
]]>
</mx:Script>
<mx:AdvancedDataGrid
height="400"
width="300"
sortExpertMode="true"
dataProvider="">
<mx:columns>
<mx:AdvancedDataGridColumn
dataField="Artist"
dataTipField="Artist"
showDataTips="true" />
<mx:AdvancedDataGridColumn
dataField="Album"
dataTipField="Album"
showDataTips="true" />
<mx:AdvancedDataGridColumn
dataField="Price"
dataTipField="Price"
showDataTips="true" />
</mx:columns>
</mx:AdvancedDataGrid>
</mx:Application -
Info on cell editors for specific rows
Hi all,
Could anyone tell me how to return different components to be the editors for different rows in a table.
I have certain rows that will use a checkbox editor and certain rows that will use a formatted textfield editor. I have coded an outline to my custom editor which extends Component and implements TableCellEditor. Any help would be greatly appreciated.
Regards
AlanOverride getCellEditor() for the JTable
public TableCellEditor getCellEditor(int row, int column) {
if(row==rowOfmyChoice) //Or whatever Logic You want
return new MyCellEditor()
return super.getCellEditor(row,column);
} -
Multi-Use Item Renderer for DataGrid Column
I have a dataGrid where the first column of the grid displays
an icon for the 'type' of item in the row. I created a custom
itemRenderer component which I reference in its own namespace, and
everything works great. Since this is a pretty common concept, I'd
thought that I'd be able to re-use that itemRenderer throughout the
application, but everytime I try to call the itemRenderer in
another dataGrid, I get 2 errors saying "the inlineComponent could
not be found" and then because of that "Access of undefined
property".
It doesn't make sense for an itemRenderer to be only good for
one use, so I'm obviously missing some fundamental issue. Can
someone enlighten me?Hah, found it. It is an mxml example, and implements
IDropInListItemRenderer. It for an image renderer, but you will be
able to see what to do.
Tracy
<?xml version="1.0" encoding="utf-8"?>
<mx:VBox xmlns:mx="
http://www.adobe.com/2006/mxml"
horizontalAlign="center" verticalAlign="middle"
width="16" height="16"
implements="mx.controls.listClasses.IDropInListItemRenderer"
>
<mx:Script><![CDATA[
import mx.controls.listClasses.IDropInListItemRenderer;
import mx.controls.listClasses.BaseListData;
import mx.controls.dataGridClasses.DataGridListData;
import mx.controls.DataGrid;
[Bindable]
private var source:String;
private var _listData:BaseListData;
public function get listData():BaseListData
return _listData;
public function set listData(value:BaseListData):void
_listData = value;
invalidateProperties();
override protected function commitProperties():void
super.commitProperties();
if (_listData is DataGridListData)
var dgld:DataGridListData = _listData as DataGridListData;
source =
data[DataGrid(dgld.owner).columns[dgld.columnIndex].dataField];
]]></mx:Script>
<mx:Image source="{source}"/>
</mx:VBox> -
Cfinclude query: return result for specific row
I've been trying to crack this all day and I feel like if I
just had a nudge in the right direction I might be successful.
I have a query that returns the records for some textbooks
that are at a specific school. I've normalized the textbook
database so that the primary, secondary and tertiary subject
categories are represented by the primary key of that category in
its own table. As the query loops through the records, I want it to
return the (varchar) subject category that goes with that
(numerical) key in the table.
Since Coldfusion won't allow nested cfoutput, I've tried
using cfinclude to grab the specific name for the subject category
that goes with the current textbook - but what I've got so far
returns all the subjects for the school id in each row - they're
the right subjects! but I don't want all of them, just the right
one with the right book/record. Can anyone suggest what I need to
do? I'm attaching the code for the main page and for one of the
cfincludes (they're identical except for "primary", "secondary" and
"tertiary").
I realize I must be leaving something out but I can't figure
out what. Thanks much in advance.Marianne,
Glad I could help. To meet your requirement it seems like you
would add one field to my schema in the Subjects table:
parentSubjectId number (FK)
That would simply be a recursive reference to another
subject's ID to which it falls under. Maybe that doesn't make sense
so here's some example data:
subjectId, subjectName, parentSubjectId
1, "Language Arts", null
2, "Reading", 1
3, "Phonics", 2
4, "Other Subject with no parent", null
So you can see we have built ourselves a nice hierarchy,
where subjects which fall under other subjects can reference them.
When you go to allow subjects to be chosen you can then query after
each drop-down selection by refreshing the page (or via AJAX) to
get its subjects. In this case we could also possibly do away with
the "Ranking" field in our linking table since our hierarchy is
captured in the relationships we now have, but for the sake of
making our lives easy, let's keep it.
Like let's say we select "Language arts" with a subjectId of
1, we can get its child subjects like:
<cfquery name="getChildSubjects"
datasource="#Request.dsn#">
SELECT s.subjectId, s.subjectName
FROM subjects s
WHERE s.parentSubjectId = <cfqueryparam
cfsqltype="cf_sql_integer" value="#URL.subjectId#" />
ORDER BY s.subjectName
</cfquery>
Obviously, modifications would need to be made to fit your
schema, variable names, etc. but that's the general principles.
As for how to associate textbooks to subjects you will
actually be inserting one record into the linking table for each
subject selected. So let's say you have a book "XSS for dummies."
To insert the book you would add a single record in your
textbook table, maybe something like:
INSERT INTO textbook (
textbookId,
textbookName,
<!--- Other fields go here, etc... --->
) VALUES (
1,
'XSS for dummies',
<!--- Other fields go here, etc... --->
Now, the user has selected three subjects: Computer Science
(ID: 5), Internet and Web Topics (ID: 11), and Security (ID:98). We
will thus insert three records into our linking table like:
INSERT INTO textbookSubjects (
textbookId,
subjectId,
ranking
) VALUES (
1,
5,
'Primary'
INSERT INTO textbookSubjects (
textbookId,
subjectId,
ranking
) VALUES (
1,
11,
'Secondary'
INSERT INTO textbookSubjects (
textbookId,
subjectId,
ranking
) VALUES (
1,
98,
'Tertiary'
So now when we query to get all our textbooks and related
subjects, we have something like this:
SELECT t.textbookId, t.textbookName, s.subjectId,
s.subjectName, ts.ranking
FROM textbook t
LEFT JOIN textbookSubjects ts
ON t.textbookId = ts.textbookId
LEFT JOIN subject s
ON t.subjectId = s.subjectId
ORDER BY t.textbookName
An example dataset might look like:
textbookId, textbookName, subjectId, subjectName, ranking
1, "XSS for Dummies", 5, "Computer Science", "Primary"
1, "XSS for Dummies", 11, "Internet and Web Topics",
"Secondary"
1, "XSS for Dummies", 98, "Security", "Tertiary"
2, "Some Other Book With No Subjects", null, null, null
Now if we iterate over this dataset, you will end up
outputting the textbook 3 times, which is probably not what you
wanted. So to control this we can do something like:
<cfoutput query="myBooks" group="textbookId">
<tr>
<td>#myBooks.textbookName#</td>
<!--- Show all the subjects --->
<td>
<!--- These cfoutput tags with no group will give you all
the values for the current group --->
<cfoutput>
#myBooks.subjectName#<br />
</cfoutput>
</td>
</tr>
</cfoutput>
These examples are obviously brief but I hope they get the
point across and help you accomplish what you're trying to
do. -
Designing the consolidated and line item report for specific material
Hi
i have a R/3-report and it run only for 7-materials.That means we need to only those 7-materials in the selection screen of report.
Then we will get each material corresponding line item details(material no, profit center, variable cost, quanity, price, financial loss(this is calculated based on quantity) , Utility Consumption(calculated based on price, variablecost) ) in one report.
Another report will give same for consolidated values of financial loss, utiliy consumption.
<b>so how can i design the consolidated and lineitem details report for each material.</b> pls let me know
kumar0VENDOR_ATTR - Vendor Master Data Attributes
0FI_AP_51 - Check Register Line Items
0FI_AP_4 - Accounts Payable Line Items
It should be noted, however, that this won't get you everything that you need, so you may have to create enhance one or more of these DataSources and create User Exit ABAP code to get the required data. Also, the 0FI_AP_51 DataSource isn't available if your source system isn't ECC6 EHP3 or higher. If your source system is less than that, you're going to have to create a generic DataSource for the data from the PAYR table. -
Encountering problems getting the median value for specific rows alone.
Consider the following columns:
Call Value
0.49
0.65
1.22
1.29
1.34
1.64
1.8
2.25
3.86
4.32
5.12
Median 1.64
Quartile 1
0.49
0.65
1.22
1.29
1.34
Expected Median 1.22
BO Returns
The first column in the table contains call values. The median of all the call values is 1.64. BO displays this value as is (correctly). In case of obtaining the median for Quartile 1, BO returns a null value instead of 1.22.
Can anyone please tell me what needs to be done in BO to achieve this value 1.22?Hi Rajiv,
Following is the syntax of the formula for median values.
The Syntax is as follows:
number Median([measure]), where measure is any measure object.
Example
Median([Revenue]) returns 971000 if [Revenue] has the values 736431, 971000, and 5476652
Please note that the Median function in BusinessObjects works differently from the Median function in Microsoft Excel.
For odd number of rows in the report, the Median will take the middle value and for even number of rows in the report, the Median will take the two middle values and calculate the Average of them.
Regards,
Sarbhjeet Kaur -
Item Renderer for Advance DataGrid
On AdvancedDataGrid, can we display one of the column as Text and when the user clicks on the text it should turns into a combo box.
When the user clicks on any where else it should turn into text back.
Please help me to implement this.Off the top of my head it's probably something like:
<mx:DataGrid id="dg1" width="100%" height="100%">
<mx:columns>
<mx:DataGridColumn dataField="Example">
<mx:itemEditor>
<mx:Component>
<mx:ComboBox>
<mx:String>1</mx:String>
<mx:String>2</mx:String>
<mx:String>3</mx:String>
</mx:ComboBox>
</mx:Component>
</mx:itemEditor>
</mx:DataGridColumn>
</mx:columns>
</mx:DataGrid>
edit:
Just checked, Subeesh's example: http://blog.flexmonkeypatches.com/2008/02/18/simple-datagrid-combobox-as-item-editor-examp le/ has got a very good example on it. Pretty much exactly what you asked -
Hi,
I have a table (on a custom page) that includes MessageStyledText columns and a MessageCheckBox column, I would like to set the MessageCheckBox to Read Only if the value of the MessageStyledText column on the row is ‘XYZ’, could someone give me some pointers on how this can be achieved?
Oracle EBS: 12.1.3
JDEV: 10.1.3.3.0.3
Kind Regards
CarlSorted it using SPEL (as per https://forums.oracle.com/message/1815932#1815932).
-
DataGrid Using an item renderer that spans an entire row
Anyone know how can I do this using DataGrid?
I dont understand how Can I do it. Below I have a source code that I'm working with this case. I have 2 columns and I would like when i click in combobox my item renderer fill all rows.
Look I have this code (Main Application and Renderer):
<?xml version="1.0" encoding="utf-8"?>
<mx:Canvas xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/halo">
<mx:transitions>
<mx:Transition fromState="*" toState="*">
<mx:Resize target="{this}"/>
</mx:Transition>
</mx:transitions>
<mx:states>
<mx:State name="normal"/>
<mx:State name="expanded"/>
</mx:states>
<fx:Script>
<![CDATA[
import mx.collections.ArrayCollection;
[Bindable]
public var ac:ArrayCollection;
private function changeState(event:Event) : void {
if( event.target.selected )
currentState = "expanded";
else
currentState = "normal";
override public function set data(value:Object) : void {
super.data = value;
ac = new ArrayCollection(value.models);
]]>
</fx:Script>
<mx:CheckBox label="{data.title}" click="changeState(event)"/>
<mx:List dataProvider="{ac}" y="20" width="100%" includeIn="expanded"/>
</mx:Canvas>
<s:Application
xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:mx="library://ns.adobe.com/flex/halo"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:ct="*"
height="100%" width="100%">
<fx:Script>
<![CDATA[
import mx.collections.ArrayCollection;
[Bindable]
public var dp:ArrayCollection = new ArrayCollection([
{title:"Ford", style: 'Modern', models:["Fusion","Taurus","Mustang"]},
{title:"Volkswagen", style: 'Normal', models:["Passat","Jetta","Beetle", "Golf", "GTI"]},
{title:"Infiniti", style: 'Modern', models:["FX35","GX35","Q45","M35"]},
{title:"Audi", style: 'Esport', models:["A3","A4","A6"]}
]]>
</fx:Script>
<mx:DataGrid dataProvider="{dp}" variableRowHeight="true" height="100%" width="100%">
<mx:columns>
<mx:DataGridColumn dataField="title" headerText="title" itemRenderer="DetailItem"/>
<mx:DataGridColumn dataField="style" headerText="style" />
</mx:columns>
</mx:DataGrid>
</s:Application> -
Using a canvas for item renderer
I have an array collection of objects. The class has a
function getDisplayObject which returns a canvas with all of the
components I need in it. I'd like to use that canvas directly as a
custom renderer for a combo box. How can I set the returned canvas
as the item renderer? I've made custom renderers, but not with a
canvas itself. I think I need to call getDisplayObject inside of
the item renderer for each object, but am not sure how. Thanks.
(Below is what I've tried, but this only adds the first one out of
an array of 5... hmm...)Hi Usernnnnnn,
I know an applciation that's using such kind of tree.
It's published in the Oracle magazine, may 2006. And is named: Build a menu framework. You can dowload the application:
http://oracle.com/technology/oramag/oracle/06-may/o36apex.zip
The menu looks like you have described.
Leo
Maybe you are looking for
-
Adobe Media Encoder CS4 Encoding Error
I got an error when Adobe Media Encoder CS4 encoding which is the crash of ImporterProcessServer. It crashes the halfway of the encoding process. I restarted my comp and tried several times before but the results still the same. Sometimes ImporterPro
-
Organizing music in itunes and ipod touch
My ipod touch's music in "my top rated playlist" is not alphabetically organized even though in itunes the music in this playlist is alphabetically organize. How can I organize my music in ipod touch alphabetically just like in itunes?
-
SSL Network Extender Service is Down and could not be started
I'm trying to use a VPN access from work, which worked fine in XP but with vista the SSL service won't start. Any ideas?
-
Error restarting oid on infra for 10g AS
Hi, I was restarting the infra and midtier on my Oracle 10g AS. For starting the oid, i typed : oidctl server=oidldapd configset=1 instance=1 startAfter waiting for some time, I typed dcmctl start -cl but this line gives me a javax.Naming.CCommunicat
-
Need help changing wife's phone ID to use family sharing
My wife and I both have iPhones. I have a 6 and she a 5. Originally, both were signed in under my apple id. We just sync as two different devices to have different content. My kids now also have phones/ipods and I've taken advantage of family sha