Skip row in datagrid
Is it possible to skip a row in a datagrid that uses an
ArrayCollection as dataprovider ?
I want to check if an arraycollection item contains X and if
so then don't draw it.
I use the same arraycollection in multiple datagrids and its
only one of them I don't want to draw the specific item.
"geiryt" <[email protected]> wrote in
message
news:g7v61v$q8h$[email protected]..
> Is it possible to skip a row in a datagrid that uses an
ArrayCollection as
> dataprovider ?
> I want to check if an arraycollection item contains X
and if so then don't
> draw it.
> I use the same arraycollection in multiple datagrids and
its only one of
> them
> I don't want to draw the specific item.
Use a different ArrayCollection and the same source but a
different
filterFunction
Similar Messages
-
For-each skip rows based on test null condition
I thought this would be simple, but I can't seem to find a satisfactory answer in the XML Publisher manuals. For various reasons, I have a pre formatted Oracle Report in EBS which doesn't group the XML tags as I want them. I have some groupings with tags of NULL data. I simply want to test for a NULL tag and just skip the ROW completely. I don't want to test each individual row on the line of about 10 tags.
Here is an example, I just want to skip rows with blank XML data.
<G_CUSTOMER_NUMBER>
<CUSTOMER_NUMBER>10001</CUSTOMER_NUMBER>
<BILLING_NO></BILLING_NO>
<LIST_G_HEADER>
<G_HEADER>
<HEADER>2HEADER</HEADER>
<BILL_TO_ADDRESS1></BILL_TO_ADDRESS1>
<BILL_TO_ADDRESS2></BILL_TO_ADDRESS2>
<BILL_TO_ADDRESS3></BILL_TO_ADDRESS3>
<BILL_TO_ADDRESS4></BILL_TO_ADDRESS4>
<CS_TERM_NAME></CS_TERM_NAME>
<TRX_TYPE_NAME></TRX_TYPE_NAME>
<DUE_DATE></DUE_DATE>
<LIST_G_DETAILS>
<G_DETAILS>
<REPORT_ALL_AMOUNT></REPORT_ALL_AMOUNT>
<LINE_QTY_INVOICED></LINE_QTY_INVOICED>
<LINE_UNIT_SELLING_PRICE></LINE_UNIT_SELLING_PRICE>
<LINE_EXTENDED_AMOUNT></LINE_EXTENDED_AMOUNT>
<LINE_DESCRIPTION></LINE_DESCRIPTION>
<TRX_NUMBER></TRX_NUMBER>
<INTERNAL_NOTES></INTERNAL_NOTES>
<CS_TERM_ALL_AMOUNT></CS_TERM_ALL_AMOUNT>
</G_DETAILS>
</LIST_G_DETAILS>
</G_HEADER>
<G_HEADER>
<HEADER>4DETAIL</HEADER>
<BILL_TO_ADDRESS1></BILL_TO_ADDRESS1>
<BILL_TO_ADDRESS2></BILL_TO_ADDRESS2>
<BILL_TO_ADDRESS3></BILL_TO_ADDRESS3>
<BILL_TO_ADDRESS4></BILL_TO_ADDRESS4>
<CS_TERM_NAME></CS_TERM_NAME>
<TRX_TYPE_NAME>Invoice</TRX_TYPE_NAME>
<DUE_DATE></DUE_DATE>
<LIST_G_DETAILS>
<G_DETAILS>
<REPORT_ALL_AMOUNT></REPORT_ALL_AMOUNT>
<LINE_QTY_INVOICED>1</LINE_QTY_INVOICED>
<LINE_UNIT_SELLING_PRICE>61.7</LINE_UNIT_SELLING_PRICE>
<LINE_EXTENDED_AMOUNT>61.7</LINE_EXTENDED_AMOUNT>
<LINE_DESCRIPTION>Facility fees for NOV-2006</LINE_DESCRIPTION>
<TRX_NUMBER>10300492</TRX_NUMBER>
<INTERNAL_NOTES></INTERNAL_NOTES>
<CS_TERM_ALL_AMOUNT></CS_TERM_ALL_AMOUNT>
</G_DETAILS>
</LIST_G_DETAILS>
</G_HEADER>
<G_HEADER>
<HEADER>6DETAIL</HEADER>
<BILL_TO_ADDRESS1></BILL_TO_ADDRESS1>
<BILL_TO_ADDRESS2></BILL_TO_ADDRESS2>
<BILL_TO_ADDRESS3></BILL_TO_ADDRESS3>
<BILL_TO_ADDRESS4></BILL_TO_ADDRESS4>
<CS_TERM_NAME></CS_TERM_NAME>
<TRX_TYPE_NAME></TRX_TYPE_NAME>
<DUE_DATE></DUE_DATE>
<LIST_G_DETAILS>
How do I do this?I found the answer on page 2-63 of the manual, however you need to make sure a test like this <if:LINE_QTY_INVOICE>0> is not used as it caused on error. Rather use this test <if:LINE_QTY_INVOICE!=''>
-
OWB mappings to skip rows that are in error and continue processing
OWB mappings to skip rows that are in error and continue processing.
1) Enter a record into an error log
2) Skip rows that are in error
3) and continue processing
Type of information could be needed in the error log:
SY_LOG_ERROR_KEY
ERROR_TIMESTAMP
MAP_NAME
SOURCE_RECORD
ERROR_CODE
ERROR_MESSAGE
ERROR_NOTES
Example:
If the source table has five records, in that 3 records has some error.
When I run the OWB mapping to load the source data to target table, OWB should skip the 3 record and load all the remaining record. This is our requirement.
Another think I want to store the error record details in a error log table.
Can u plz tell me whether it is possible in OWB. If not means please give some suggestion to do this.Hi,
thanks for ur help, As is OWB version is 10.2.0 so for set based it is not working. with your idea i create a POST PROCESSING MAPPING. it is now working fine.
Step 1:
Create a table MAP_ERROR_LOG.
Script:
CREATE TABLE MAP_ERROR_LOG
ERROR_SEQ NUMBER,
MAPPING_NAME VARCHAR2(32 BYTE),
TARGET_TABLE VARCHAR2(35 BYTE),
TARGET_COLUMN VARCHAR2(35 BYTE),
TARGET_VALUE VARCHAR2(100 BYTE),
PRIMARY_TABLE VARCHAR2(100 BYTE),
ERROR_ROWKEY NUMBER,
ERROR_CODE VARCHAR2(12 BYTE),
ERROR_MESSAGE VARCHAR2(2000 BYTE),
ERROR_TIMESTAMP DATE
TABLESPACE ODS_D1_AA
PCTUSED 0
PCTFREE 10
INITRANS 1
MAXTRANS 255
STORAGE (
INITIAL 80K
MINEXTENTS 1
MAXEXTENTS 2147483645
PCTINCREASE 0
BUFFER_POOL DEFAULT
LOGGING
NOCOMPRESS
NOCACHE
NOPARALLEL
MONITORING;
Step 2:
Create a sequence MAP_ERROR_LOG_SEQ
CREATE SEQUENCE MAP_ERROR_LOG_SEQ START WITH 1 INCREMENT BY 1
Step 3:
Create a procedure PROC_MAP_ERROR_LOG through OWB.
In this i have used 3 cursor, first cursor is used to check the count of error messages for the corresponding table(WB_RT_ERROR_SOURCES).
The second cursor is used to get the oracle error and the primary key values.
The third cursor is used for get the ORACLE DBA errors such as "UNABLE TO EXTEND THE TABLESPACE" for this type errors.
CREATE OR REPLACE PROCEDURE PROC_MAP_ERROR_LOG(MAP_ID VARCHAR2) IS
--initialize variables here
CURSOR C1 IS
SELECT COUNT(RTA_IID) FROM OWBREPO.WB_RT_ERROR_SOURCES
WHERE RTA_IID =( SELECT MAX(RTA_IID) FROM OWBREPO.WB_RT_AUDIT WHERE RTA_PRIMARY_TARGET ='"'||MAP_ID||'"');
V_COUNT NUMBER;
CURSOR C2 IS
SELECT A.RTE_ROWKEY ERR_ROWKEY,SUBSTR(A.RTE_SQLERRM,1,INSTR(A.RTE_SQLERRM,':')-1) ERROR_CODE,
SUBSTR(A.RTE_SQLERRM,INSTR(A.RTE_SQLERRM,':')+1) ERROR_MESSAGE,
C.RTA_LOB_NAME MAPPING_NAME,SUBSTR(B.RTS_SOURCE_COLUMN,(INSTR(B.RTS_SOURCE_COLUMN,'.')+1)) TARGET_COLUMN,
B.RTS_VALUE TARGET_VALUE,C.RTA_PRIMARY_SOURCE PRIMARY_SOURCE,C.RTA_PRIMARY_TARGET TARGET_TABLE,
C.RTA_DATE ERROR_TIMESTAMP
FROM OWBREPO.WB_RT_ERRORS A,OWBREPO.WB_RT_ERROR_SOURCES B, OWBREPO.WB_RT_AUDIT C
WHERE C.RTA_IID = A.RTA_IID
AND C.RTA_IID = B.RTA_IID
AND A.RTA_IID = B.RTA_IID
AND A.RTE_ROWKEY =B.RTE_ROWKEY
--AND RTS_SEQ =1
AND B.RTS_SEQ IN (SELECT POSITION FROM ALL_CONS_COLUMNS A,ALL_CONSTRAINTS B
WHERE A.TABLE_NAME = B.TABLE_NAME
AND A.CONSTRAINT_NAME = B.CONSTRAINT_NAME
AND A.TABLE_NAME =MAP_ID
AND CONSTRAINT_TYPE ='P')
AND A.RTA_IID =(
SELECT MAX(RTA_IID) FROM OWBREPO.WB_RT_AUDIT WHERE RTA_PRIMARY_TARGET ='"'||MAP_ID||'"');
CURSOR C3 IS
SELECT A.RTE_ROWKEY ERR_ROWKEY,SUBSTR(A.RTE_SQLERRM,1,INSTR(A.RTE_SQLERRM,':')-1) ERROR_CODE,
SUBSTR(A.RTE_SQLERRM,INSTR(A.RTE_SQLERRM,':')+1) ERROR_MESSAGE,
C.RTA_LOB_NAME MAPPING_NAME,SUBSTR(B.RTS_SOURCE_COLUMN,(INSTR(B.RTS_SOURCE_COLUMN,'.')+1)) TARGET_COLUMN,
B.RTS_VALUE TARGET_VALUE,C.RTA_PRIMARY_SOURCE PRIMARY_SOURCE,C.RTA_PRIMARY_TARGET TARGET_TABLE,
C.RTA_DATE ERROR_TIMESTAMP
FROM OWBREPO.WB_RT_ERRORS A,OWBREPO.WB_RT_ERROR_SOURCES B, OWBREPO.WB_RT_AUDIT C
WHERE C.RTA_IID = A.RTA_IID
AND A.RTA_IID = B.RTA_IID (+)
AND A.RTE_ROWKEY =B.RTE_ROWKEY (+)
AND A.RTA_IID =(
SELECT MAX(RTA_IID) FROM OWBREPO.WB_RT_AUDIT WHERE RTA_PRIMARY_TARGET ='"'||MAP_ID||'"');
-- main body
BEGIN
DELETE ED_ODS.MAP_ERROR_LOG WHERE TARGET_TABLE ='"'||MAP_ID||'"';
COMMIT;
OPEN C1;
FETCH C1 INTO V_COUNT;
IF V_COUNT >0 THEN
FOR REC IN C2
LOOP
INSERT INTO ED_ODS.MAP_ERROR_LOG
(Error_seq ,
Mapping_name,
Target_table,
Target_column ,
Target_value ,
Primary_table ,
Error_rowkey ,
Error_code ,
Error_message ,
Error_timestamp)
VALUES(
ED_ODS.MAP_ERROR_LOG_SEQ.NEXTVAL,
REC.MAPPING_NAME,
REC.TARGET_TABLE,
REC.TARGET_COLUMN,
REC.TARGET_VALUE,
REC.PRIMARY_SOURCE,
REC.ERR_ROWKEY,
REC.ERROR_CODE,
REC.ERROR_MESSAGE,
REC.ERROR_TIMESTAMP);
END LOOP;
ELSE
FOR REC IN C3
LOOP
INSERT INTO ED_ODS.MAP_ERROR_LOG
(Error_seq ,
Mapping_name,
Target_table,
Target_column ,
Target_value ,
Primary_table ,
Error_rowkey ,
Error_code ,
Error_message ,
Error_timestamp)
VALUES(
ED_ODS.MAP_ERROR_LOG_SEQ.NEXTVAL,
REC.MAPPING_NAME,
REC.TARGET_TABLE,
REC.TARGET_COLUMN,
REC.TARGET_VALUE,
REC.PRIMARY_SOURCE,
REC.ERR_ROWKEY,
REC.ERROR_CODE,
REC.ERROR_MESSAGE,
REC.ERROR_TIMESTAMP);
END LOOP;
END IF;
CLOSE C1;
COMMIT;
-- NULL; -- allow compilation
EXCEPTION
WHEN OTHERS THEN
NULL; -- enter any exception code here
END; -
How to set boundry value in dynamic rows in datagrid
hi friends,
I am new to flex.i want to add dynamic rows to datagrid that means.once i enter the first record i want to press tab button then it will automatically go to the second row.and update the record continuously.once it reach the maximum value means the next row will not be edit.
mxkimum value =10000
from value to value percentage
0.01 2000 10
2000 8000 20
8000 10000 30
after it reach 10000 next row will not edit,this is i want how i do this please help.
If any suggession tel
thanks
B.venkatesanHi,
As Armin said use the following:
wdContext.nodeXXX().currentXXXElement().setAttributeValue("attributeName", value)
Here you give the value as value of simpleType and not its description.
thanks & regards,
Manoj -
Textinput in all the colums of the first row of datagrid
Hi
i need Textinput in all the colums of the first row of
datagrid.
can ayone tell me the solution..
Thx in advance.This will not be easy. i see two possible solutions.
You could use a custom itemRenderer. This will require that
you find some way to identify the dataProvider collection index
from within the renderer, and set the renderer to editable when
that index is 0.
Or you could create a composite component using two
dataGrids, one with a single row for the editable columns. There
are examples available on combining two DGs this way.
Again, this will be difficult, so be sure that it is
absolutely required and consider some other UI approach if posible.
Tracy -
How to select a row in datagrid by checking the check box in that row
how to select a row in datagrid by checking the check box in that row.
Im using <html:checkbox> tag, and also a VO which is in request scope. i wanna display the values in the VO in a row and corresponding to this i want a checkbox..
Thanx in advance
Message was edited by: me
Hemanth@SA
Message was edited by:
Hemanth@SAHello,
I got the solution:
final int pRow = row;
final int pCol = column;
final JTable myTable = mytable;
SwingUtilities.invokeLater(new Runnable() {
public void run() {
myTable.requestFocusInWindow();
myTable.changeSelection(pRow, pCol, true, true); -
Add new rows in datagrid flex 4?
need to insert some values of sliders, positions to datagrid in flex 4. Then i'll save those values in MySql.
All the values are overwriting on the first row of datagrid, how to insert new rows? I tried addItemAt() but did not work.
databaseData.addItem({distortion:"X " + a, originalimage:"4 * 4", w2simage: "4 * " + a, brainimage: "4 *"+ a, transformw2s: " ",transformbrainimage:""});Check weather you add the new items with the same collection binding with your datagrid. Or else check the collection has been re-initialized before you add new item in that collection.
-
PDF Script to skip row in table
Hello.
I need script to scip row in table by some parametrs.
Does somebody know how do this to?I didnot get what you mean by Skip row. Can you be more specific.
Thanks,
Aravind -
How make a button enable property "true" while i am clicking a row from datagrid in mxml flex4 app
hi friends,
i am new to flex, i am doing flex4 web application with mxml tags.
i have struck in this place,please give some idea.
i have one data grid with 5 rows and 4columns,and also i am having one button (property enable is false).
while i am click a particular row from datagrid that time the button property enbale should be change to true.
where i have to write code.
any suggession or snippet code,
Thanks in advance.
B.venkatesan.Hi,
You can take help of following code :
<?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">
<fx:Declarations>
<!-- Place non-visual elements (e.g., services, value objects) here -->
</fx:Declarations>
<fx:Script>
<![CDATA[
import mx.collections.ArrayCollection;
[Bindable]
public var Arr:ArrayCollection = new ArrayCollection([{a:"AAA",b:"BBB"} , {a:"111" , b:"222"}]);
public function enable():void{
Btn.enabled=true;
]]>
</fx:Script>
<mx:DataGrid x="91" y="36" dataProvider="{Arr}" click="enable()">
<mx:columns>
<mx:DataGridColumn headerText="Column 1" dataField="a"/>
<mx:DataGridColumn headerText="Column 2" dataField="b"/>
</mx:columns>
</mx:DataGrid>
<s:Button x="210" y="237" id="Btn" label="Button" enabled="false"/>
</s:Application>
Thanks and Regards,
Vibhuti Gosavi | [email protected] | www.infocepts.com -
Flex Spark DataGrid BUG skipping rows on refresh
I have a small one file example that demonstrates this Flex DataGrid bug.
I tried to report it to Flex bugs and the page timed out.
I am filling a column in a spark datagrid with checkboxes to select that row.
In the header of that column is a checkbox to select ALL the rows.
However, the middle row is not getting refreshed so the display is wrong.
The checkbox looks empty when the backing value is correct.
I have added a print to the code that sets the values in the data and it is setting everyone.
But when I print the isSelected code it is NOT being called on ONE (the middle) visible row.
If I move away or scroll up and down the check box shows the check mark.
So My only conclusion is that refresh has a bug.
Here is the example that demonstrates the problem.
Simply select the header checkbox and the 3rd checkbox does not get updated on refresh.
<?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">
<fx:Script>
<![CDATA[
import mx.collections.ArrayCollection;
private static var values:Array = [
{selected: false, position: 1},
{selected: false, position: 2},
{selected: false, position: 3},
{selected: false, position: 4},
{selected: false, position: 5}
[Bindable]
public static var datalist:ArrayCollection = new ArrayCollection( values );
public static function updateDataList( value:Boolean ):void
for each( var item:Object in datalist ) {
trace( "updated: " + item.position );
item.selected = value;
datalist.refresh();
]]>
</fx:Script>
<s:DataGrid dataProvider="{datalist}">
<s:columns>
<s:ArrayList>
<s:GridColumn dataField="position" width="200"/>
<s:GridColumn width="34" >
<s:itemRenderer>
<fx:Component>
<s:GridItemRenderer textAlign="center">
<fx:Script>
<![CDATA[
private function changeSelection( data:Object, event:MouseEvent ):void
data.selected = ! data.selected;
private function isSelected( data:Object ):Boolean
trace( "isSelected: " + data.position );
return data.selected;
]]>
</fx:Script>
<s:layout>
<s:HorizontalLayout horizontalAlign="center" verticalAlign="middle"/>
</s:layout>
<s:CheckBox id="selbox" label="" selected="{isSelected(data)}"
click="changeSelection(data, event)"/>
</s:GridItemRenderer>
</fx:Component>
</s:itemRenderer>
<s:headerRenderer>
<fx:Component>
<s:GridItemRenderer height="30">
<fx:Script>
<![CDATA[
[Bindable]
private static var selectAll:Boolean = false;
private function changeAllSelection( event:MouseEvent ):void
selectAll = ! selectAll;
Main.updateDataList( selectAll );
]]>
</fx:Script>
<s:layout>
<s:VerticalLayout horizontalAlign="center" verticalAlign="middle"/>
</s:layout>
<s:CheckBox label="" selected="{selectAll}"
click="changeAllSelection(event)"/ >
</s:GridItemRenderer>
</fx:Component>
</s:headerRenderer>
</s:GridColumn>
</s:ArrayList>
</s:columns>
</s:DataGrid>
</s:Application>
Here is an image of the failed result... after selecting the top checkbox.
Below is an image of the output produced by the two traces.
Notice that the refresh has not called isSelected on the 3rd element.I have a small one file example that demonstrates this Flex DataGrid bug.
I tried to report it to Flex bugs and the page timed out.
I am filling a column in a spark datagrid with checkboxes to select that row.
In the header of that column is a checkbox to select ALL the rows.
However, the middle row is not getting refreshed so the display is wrong.
The checkbox looks empty when the backing value is correct.
I have added a print to the code that sets the values in the data and it is setting everyone.
But when I print the isSelected code it is NOT being called on ONE (the middle) visible row.
If I move away or scroll up and down the check box shows the check mark.
So My only conclusion is that refresh has a bug.
Here is the example that demonstrates the problem.
Simply select the header checkbox and the 3rd checkbox does not get updated on refresh.
<?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">
<fx:Script>
<![CDATA[
import mx.collections.ArrayCollection;
private static var values:Array = [
{selected: false, position: 1},
{selected: false, position: 2},
{selected: false, position: 3},
{selected: false, position: 4},
{selected: false, position: 5}
[Bindable]
public static var datalist:ArrayCollection = new ArrayCollection( values );
public static function updateDataList( value:Boolean ):void
for each( var item:Object in datalist ) {
trace( "updated: " + item.position );
item.selected = value;
datalist.refresh();
]]>
</fx:Script>
<s:DataGrid dataProvider="{datalist}">
<s:columns>
<s:ArrayList>
<s:GridColumn dataField="position" width="200"/>
<s:GridColumn width="34" >
<s:itemRenderer>
<fx:Component>
<s:GridItemRenderer textAlign="center">
<fx:Script>
<![CDATA[
private function changeSelection( data:Object, event:MouseEvent ):void
data.selected = ! data.selected;
private function isSelected( data:Object ):Boolean
trace( "isSelected: " + data.position );
return data.selected;
]]>
</fx:Script>
<s:layout>
<s:HorizontalLayout horizontalAlign="center" verticalAlign="middle"/>
</s:layout>
<s:CheckBox id="selbox" label="" selected="{isSelected(data)}"
click="changeSelection(data, event)"/>
</s:GridItemRenderer>
</fx:Component>
</s:itemRenderer>
<s:headerRenderer>
<fx:Component>
<s:GridItemRenderer height="30">
<fx:Script>
<![CDATA[
[Bindable]
private static var selectAll:Boolean = false;
private function changeAllSelection( event:MouseEvent ):void
selectAll = ! selectAll;
Main.updateDataList( selectAll );
]]>
</fx:Script>
<s:layout>
<s:VerticalLayout horizontalAlign="center" verticalAlign="middle"/>
</s:layout>
<s:CheckBox label="" selected="{selectAll}"
click="changeAllSelection(event)"/ >
</s:GridItemRenderer>
</fx:Component>
</s:headerRenderer>
</s:GridColumn>
</s:ArrayList>
</s:columns>
</s:DataGrid>
</s:Application>
Here is an image of the failed result... after selecting the top checkbox.
Below is an image of the output produced by the two traces.
Notice that the refresh has not called isSelected on the 3rd element. -
Hai
I have pasted the mxml below, because i am unable to attach the mxml, pl copy this below file into flex and run the application.
1. Run the application.
2. Enter values in the textbox and click add, values will be added to the datagrid.
3. now click AND or OR and then change the values in the second and thrid combobox and again click add.
4.Like wise change the combobox values and add five rows to the datagrid.
5.now if u delete the last row u can see the curent last row in the combobox, so that the AND or Or can be added to it
6. now if u delete a row in between, the deleted row's value oly maintains in the combobox,so i am unable to add AND or Or to the grid
7.I need the last row data in the datagrid to be in the second and third combobox, which ever row is deleted.
Can anyone help me....
Thanks in advance.
This is the mxml for sample
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
<mx:Script>
<![CDATA[
// ActionScript file
import mx.rpc.events.FaultEvent;
import mx.controls.Alert;
import mx.managers.CursorManager;
import mx.collections.ArrayCollection;
[Bindable]
public var adhoc:ArrayCollection = new ArrayCollection();
[Bindable]
public var serverString = "" ;
private function initImage(event:MouseEvent):void {
if(adhoc.length > 0){
CursorManager.setBusyCursor();
private function onChange():void{
if(comboBox.selectedIndex == 0){
}else{
private function onChange1():void{
if(combo2.selectedItem == "DATEDEPLOYED" || combo2.selectedItem == "DATEUPLOADED"){
datepick.visible = true
txt.visible = false
}else{
txt.visible = true
datepick.visible = false
private function add():void{
var str:String = txt.text;
if(str.length == 0 && txt.visible == true){
Alert.show("Value Can Not Be Empty");
return;
if(combo2.selectedItem != "DATEDEPLOYED" || combo2.selectedItem != "DATEUPLOADED"){
if(txt.visible == true){
var temp:Object = new Object();
temp.fname = combo2.selectedItem;
temp.opera = combo1.selectedItem;
temp.val = "'"+txt.text+"'";
adhoc.addItem(temp);
txt.text = "";
var str1:String = datepick.text;
if(comboBox.selectedIndex == 1){
if(combo2.selectedItem == "DATEDEPLOYED" || combo2.selectedItem == "DATEUPLOADED"){
if(str1.length == 0 && datepick.visible == true){
Alert.show("Date Cannot Be Empty");
}else{
var temp:Object = new Object();
temp.fname = combo2.selectedItem;
temp.opera = combo1.selectedItem;
temp.val = datepick.text;
adhoc.addItem(temp);
datepick.text = "";
addbutton.enabled = false;
addopenbracket.enabled = false;
combo2.enabled = false;
combo1.enabled = false;
private function querydelete():void{
if (AdHoc.selectedIndex > 0) {
if(AdHoc.selectedIndex == (adhoc.length-1)){
adhoc[AdHoc.selectedIndex-1].cond = "";
addopenbracket.enabled = false;
addclosebracket.enabled = false;
addbutton.enabled = false;
combo2.enabled = false;
combo1.enabled = false;
combo2.selectedItem = adhoc[adhoc.length-2].fname
combo1.selectedItem = adhoc[adhoc.length-2].opera
adhoc.removeItemAt(AdHoc.selectedIndex);
// adhocdetailgridcompilance.dataProvider = null ;
// adhocdetailgrid.dataProvider = null ;
}else if (adhoc.length == 1) {
adhoc.removeItemAt(AdHoc.selectedIndex);
// adhocdetailgridcompilance.dataProvider = null ;
// adhocdetailgrid.dataProvider = null ;
addopenbracket.enabled = true;
addclosebracket.enabled = true;
addbutton.enabled = true;
combo2.enabled = true;
combo1.enabled = true;
}else{
Alert.show("Select The Rows To Delete");
private function andSubmit():void{
for each(var obj:Object in adhoc){
if(obj.fname == combo2.selectedItem && obj.opera == combo1.selectedItem){
if(combo2.selectedItem != "DATEDEPLOYED" || combo2.selectedItem != "DATEUPLOADED"){
if(txt.visible == true){
trace("2 equals");
var temp:Object = new Object();
obj.cond = and.label
adhoc.setItemAt(obj,adhoc.getItemIndex(obj));
}else{
trace(obj.fname + ":" + combo2.selectedItem);
trace(obj.opera + ":" + combo1.selectedItem);
trace(obj.val + ":" + "'"+txt.text+"'");
}else if(obj.fname == addclosebracket.label){
if(combo2.selectedItem != "DATEDEPLOYED" || combo2.selectedItem != "DATEUPLOADED"){
if(txt.visible == true){
trace("2 equals");
var temp:Object = new Object();
obj.cond = and.label
adhoc.setItemAt(obj,adhoc.getItemIndex(obj));
}else{
trace(obj.fname + ":" + combo2.selectedItem);
trace(obj.opera + ":" + combo1.selectedItem);
trace(obj.val + ":" + "'"+txt.text+"'");
if(obj.fname == combo2.selectedItem && obj.opera == combo1.selectedItem){
if(combo2.selectedItem == "DATEDEPLOYED" || combo2.selectedItem == "DATEUPLOADED"){
if(datepick.visible == true){
trace("2 equals");
var temp:Object = new Object();
obj.cond = and.label
adhoc.setItemAt(obj,adhoc.getItemIndex(obj));
}else{
trace(obj.fname + ":" + combo2.selectedItem);
trace(obj.opera + ":" + combo1.selectedItem);
trace(obj.val + ":" + datepick.text);
}else if(obj.fname == addclosebracket.label){
if(combo2.selectedItem == "DATEDEPLOYED" || combo2.selectedItem == "DATEUPLOADED"){
if(txt.visible == true){
trace("2 equals");
var temp:Object = new Object();
obj.cond = and.label
adhoc.setItemAt(obj,adhoc.getItemIndex(obj));
}else{
trace(obj.fname + ":" + combo2.selectedItem);
trace(obj.opera + ":" + combo1.selectedItem);
trace(obj.val + ":" + datepick.text);
addbutton.enabled = true;
addopenbracket.enabled = true;
combo2.enabled = true;
combo1.enabled = true;
private function orSubmit():void{
for each(var obj:Object in adhoc){
if(obj.fname == combo2.selectedItem && obj.opera == combo1.selectedItem){
if(combo2.selectedItem != "DATEDEPLOYED" || combo2.selectedItem != "DATEUPLOADED"){
if(txt.visible == true){
trace("2 equals");
var temp:Object = new Object();
obj.cond = or.label
adhoc.setItemAt(obj,adhoc.getItemIndex(obj));
}else{
trace(obj.fname + ":" + combo2.selectedItem);
trace(obj.opera + ":" + combo1.selectedItem);
trace(obj.val + ":" + "'"+txt.text+"'");
}else if(obj.fname == addclosebracket.label){
if(combo2.selectedItem != "DATEDEPLOYED" || combo2.selectedItem != "DATEUPLOADED"){
if(txt.visible == true){
trace("2 equals");
var temp:Object = new Object();
obj.cond = or.label
adhoc.setItemAt(obj,adhoc.getItemIndex(obj));
}else{
trace(obj.fname + ":" + combo2.selectedItem);
trace(obj.opera + ":" + combo1.selectedItem);
trace(obj.val + ":" + "'"+txt.text+"'");
if(obj.fname == combo2.selectedItem && obj.opera == combo1.selectedItem){
if(combo2.selectedItem == "DATEDEPLOYED" || combo2.selectedItem == "DATEUPLOADED"){
if(datepick.visible == true){
trace("2 equals");
var temp:Object = new Object();
obj.cond = or.label
adhoc.setItemAt(obj,adhoc.getItemIndex(obj));
}else{
trace(obj.fname + ":" + combo2.selectedItem);
trace(obj.opera + ":" + combo1.selectedItem);
trace(obj.val + ":" + datepick.text);
}else if(obj.fname == addclosebracket.label){
if(combo2.selectedItem == "DATEDEPLOYED" || combo2.selectedItem == "DATEUPLOADED"){
if(txt.visible == true){
trace("2 equals");
var temp:Object = new Object();
obj.cond = or.label
adhoc.setItemAt(obj,adhoc.getItemIndex(obj));
}else{
trace(obj.fname + ":" + combo2.selectedItem);
trace(obj.opera + ":" + combo1.selectedItem);
trace(obj.val + ":" + datepick.text);
addbutton.enabled = true;
addopenbracket.enabled = true;
combo2.enabled = true;
combo1.enabled = true;
public function addOpenBracket():void{
var temp:Object = new Object();
temp.fname = addopenbracket.label
adhoc.addItem(temp);
addopenbracket.enabled = false
addclosebracket.enabled = true
if(adhoc.length > 1 && addopenbracket.enabled == false){
addbutton.enabled = true
public function addCloseBracket():void{
var temp:Object = new Object();
if(adhoc.length > 1){
temp.fname = addclosebracket.label
adhoc.addItem(temp);
addopenbracket.enabled = true
addclosebracket.enabled = false
if(adhoc.length > 1 && addclosebracket.enabled == false){
addbutton.enabled = true
private function dateChange(date:Date):void{
if (date == null){
}else{
txt.text = date.getDate() + '/' + (date.getMonth()+1).toString() + '/' +
date.getFullYear().toString() ;
public function saveadhoc(event:Event):void {
var AdhocRows:String = "";
var i:int ;
var selectedType = comboBox.selectedItem;
if(adhoc.length == 0){
Alert.show("Enter The Query");
}else{
for(i = 0; i < adhoc.length;i++) {
if(adhoc[i].fname != null){
AdhocRows = AdhocRows +adhoc[i].fname+" ";
if(adhoc[i].opera != null){
AdhocRows = AdhocRows + adhoc[i].opera+" ";
if(adhoc[i].val != null){
AdhocRows = AdhocRows + adhoc[i].val+" ";
if(adhoc[i].cond != null){
AdhocRows = AdhocRows + adhoc[i].cond+" ";
var parameters:Object = {adhocquery:AdhocRows,FlexActionType:"ADHOCQUERYSUBMIT",adhocType:selectedType};
// adhocClick.send(parameters);
private function retrieve():void{
datepick.visible = false
txt.visible = true
]]>
</mx:Script>
<mx:Array id="comp">
<mx:String>TYPE</mx:String>
<mx:String>AUDITRESULT</mx:String>
<mx:String>CATEGORY</mx:String>
<mx:String>CHILDRULE</mx:String>
<mx:String>PARENTRULE</mx:String>
<mx:String>AUDITGROUP</mx:String>
<mx:String>LOCATION</mx:String>
<mx:String>VENDOR</mx:String>
<mx:String>DEVICECATEGORY</mx:String>
</mx:Array>
<mx:Array id="inven">
<mx:String>VENDOR</mx:String>
<mx:String>DEVICETYPE</mx:String>
<mx:String>SERIES</mx:String>
<mx:String>MODEL</mx:String>
<mx:String>SUP/CPU</mx:String>
<mx:String>CODEVERSION</mx:String>
<mx:String>IMAGENAME</mx:String>
<mx:String>DATEDEPLOYED</mx:String>
<mx:String>LOCATIONNAME</mx:String>
<mx:String>ADDRESS1</mx:String>
<mx:String>ADDRESS2</mx:String>
<mx:String>CITY</mx:String>
<mx:String>STATE</mx:String>
<mx:String>COUNTRY</mx:String>
<mx:String>FLOOR</mx:String>
<mx:String>CABINET</mx:String>
<mx:String>CATEGORYNAME</mx:String>
<mx:String>DEPARTMENT</mx:String>
<mx:String>CONTACTNAME</mx:String>
<mx:String>CONTACTNUMBER</mx:String>
<mx:String>VERSION</mx:String>
<mx:String>FILENAME</mx:String>
<mx:String>DATEUPLOADED</mx:String>
</mx:Array>
<mx:Accordion x="13" y="55" width="230" height="492">
<mx:Form label="AdHoc Query Analyzer" width="100%" creationComplete="retrieve()" height="100%" color="#F2F8F9" backgroundColor="#020202">
<mx:Canvas label="Query" width="204" height="440" backgroundColor="#020202">
<mx:ComboBox x="66" y="287" width="134" id="comboBox" dataProvider="[COMPLIANCE , INVENTORY]" change="onChange()" color="#050505">
</mx:ComboBox>
<mx:ComboBox x="5" y="344" width="109.25" id="combo1" dataProvider="[=,!=,>,>=,<,<=,LIKE]" color="#010101"></mx:ComboBox>
<mx:TextInput x="119.25" y="344" width="77.75" id="txt" color="#050505"/>
<mx:Button x="3" y="401" label="Add" width="59" click="add()" id="addbutton" color="#FFFEFE" fillAlphas="[0.6, 0.4, 0.75, 0.65]" fillColors="[#FFFFFF, #CCCCCC, #EEEEEE, #EEEEEE]" borderColor="#B7BABC" themeColor="#009DFF"/>
<mx:Button x="66" y="401" label="Delete" width="63.25" click="querydelete()" color="#FFFEFE" fillAlphas="[0.6, 0.4, 0.75, 0.65]" fillColors="[#FFFFFF, #CCCCCC, #EEEEEE, #EEEEEE]" borderColor="#B7BABC" themeColor="#009DFF"/>
<mx:Button x="2" y="373" label="(" id="addopenbracket" click="addOpenBracket()" width="45" color="#FFFEFE" fillAlphas="[0.6, 0.4, 0.75, 0.65]" fillColors="[#FFFFFF, #CCCCCC, #EEEEEE, #EEEEEE]" borderColor="#B7BABC" themeColor="#009DFF"/>
<mx:Button x="51" y="373" label=")" id="addclosebracket" click="addCloseBracket()" width="45" color="#FFFEFE" fillAlphas="[0.6, 0.4, 0.75, 0.65]" fillColors="[#FFFFFF, #CCCCCC, #EEEEEE, #EEEEEE]" borderColor="#B7BABC" themeColor="#009DFF"/>
<mx:Button x="134.25" y="401" label="Submit" click="saveadhoc(event);initImage(event)" color="#FFFEFE" fillAlphas="[1.0, 0.69, 0.75, 0.65]" fillColors="[#77B97A, #77B97A, #EEEEEE, #EEEEEE]" borderColor="#77B97A" themeColor="#009DFF"/>
<mx:ComboBox x="66" y="317" width="134" id="combo2" change="onChange1()" dataProvider="{comp}" color="#010101">
</mx:ComboBox>
<mx:DateField x="122.25" y="344" width="74.75" initialize="dateChange((event.target).selectedDate)" id="datepick" color="#050505"/>
<mx:DataGrid x="1" y="1" width="203" height="282" id="AdHoc" dataProvider="{adhoc}" allowMultipleSelection="true" color="#020202">
<mx:columns>
<mx:DataGridColumn headerText="Name" dataField="fname" id="fnam"/>
<mx:DataGridColumn headerText="Operator" dataField="opera" id="ope"/>
<mx:DataGridColumn headerText="Value" dataField="val" id="valu"/>
<mx:DataGridColumn headerText="Condition" dataField="cond" id="condt"/>
</mx:columns>
</mx:DataGrid>
<mx:Button x="99" y="373" label="AND" width="52" click="andSubmit()" id="and" color="#FFFEFE" fillAlphas="[0.6, 0.4, 0.75, 0.65]" fillColors="[#FFFFFF, #CCCCCC, #EEEEEE, #EEEEEE]" borderColor="#B7BABC" themeColor="#009DFF"/>
<mx:Button x="154" y="373" label="OR" width="49" click="orSubmit()" id="or" color="#FFFEFE" fillAlphas="[0.6, 0.4, 0.75, 0.65]" fillColors="[#FFFFFF, #CCCCCC, #EEEEEE, #EEEEEE]" borderColor="#B7BABC" themeColor="#009DFF"/>
<mx:Label x="7" y="291" text="TYPE" width="59" fontWeight="bold"/>
<mx:Label x="5" y="319" text="DISPLAY" width="59" fontWeight="bold"/>
</mx:Canvas>
</mx:Form>
</mx:Accordion>
</mx:Application>Ok... but I am a little confused (sorry to be a nuisance ),
my delete function within my webService requires an ID to be
passed from the Flex application, thus when a row is selected, the
ID of the selected row is taken, so when the Delete button is
pressed it sends this ID to the webService where it is taken and
used - and therefore deleting the row etc.....
Do you mean to define the result handler for the deleteOPG
operation in the main webService tag, i.e. :
<mx:WebService id="wsData" wsdl=http://...?wsdl>
<mx:operation name="getRes" result="handleWSR(event)"/>
<mx:operation name="deleteOPG"
result="handleWSR_deleteOPG(event)"/>
</mx:WebService>
and then call it in my delete function, passing the ID from
my delete function to my new result handler function ??? :
Thanks,
Jon. -
How to delete a selected row from datagrid and how to create a datagrid popup
hi friends,
I am new to flex.i am doing a flex4 application,i need help for this.
i am having a data grid with columns.i have two questions.
Ques 1: when i selected a partiuclar row from a datagrid and click delete button means that record will delete from the datagrid and DTO from the cloud tables also.
Ques 2: when i save the data grid values using save button means that data will store in respective cloud DTO which is related to the datagrid,
My requirement is i am using a search button when i click the search button it will show a datagrid that datagrid will contain the previous datagrid datas which is saved in the cloud.
REQUIREMENT example: first screen: i am using with data grid 3 columns (Student Roll number ,Student Name,Student pecentage)---->save--->data will store in cloud DTO.
Second screen: search button ----> it need show datagrid popup.it will have data which we saved in the first screen with same columns(Student Roll number ,Student Name,Student pecentage).
This is my requirement.
Any suggession welcome.
Thanks in advance.
B.VenkatesanLets break the problem statement in multiple steps
1. We need a way to know the selection on all rows.
2. We need the association of the checkBox with the data
The solution is to use a arrayCollection/array that holds all the instances created for checkbox.This collection should be a property of component containing the datagrid. We need to use a custom component implementation or inline ItemRenderer. The way you have used is called dropinItemRenderer. Preferaly use custom component implementation and add the instance to the arrayCollection at CreationComplete. Make sure you use addItemAt so that you add the instance in the same row as the data. To get rowIndex the custom Checkbox should implement IDropInListItemRenderer. You could iterate this collection to check all the instances that are checked.
Note: This is the approach considering your dataprovider doesnt have a selection field.
Nishant -
How to delete a Selected row from datagrid and how to create a datagrid popup with saved values
hi friends,
I am new to flex.i am doing a flex4 application,i need help for this.
i am having a data grid with columns.i have two questions.
Ques 1: when i selected a partiuclar row from a datagrid and click delete button means that record will delete from the datagrid and DTO from the cloud tables also.
Ques 2: when i save the data grid values using save button means that data will store in respective cloud DTO which is related to the datagrid,
My requirement is i am using a search button when i click the search button it will show a datagrid that datagrid will contain the previous datagrid datas which is saved in the cloud.
REQUIREMENT example: first screen: i am using with data grid 3 columns (Student Roll number ,Student Name,Student pecentage)---->save--->data will store in cloud DTO.
Second screen: search button ----> it need show datagrid popup.it will have data which we saved in the first screen with same columns(Student Roll number ,Student Name,Student pecentage).
This is my requirement.
Any suggession welcome.
Thanks in advance.
B.VenkatesanLets break the problem statement in multiple steps
1. We need a way to know the selection on all rows.
2. We need the association of the checkBox with the data
The solution is to use a arrayCollection/array that holds all the instances created for checkbox.This collection should be a property of component containing the datagrid. We need to use a custom component implementation or inline ItemRenderer. The way you have used is called dropinItemRenderer. Preferaly use custom component implementation and add the instance to the arrayCollection at CreationComplete. Make sure you use addItemAt so that you add the instance in the same row as the data. To get rowIndex the custom Checkbox should implement IDropInListItemRenderer. You could iterate this collection to check all the instances that are checked.
Note: This is the approach considering your dataprovider doesnt have a selection field.
Nishant -
How can I control the display of rows in datagrid without changing the dataprovider?
Hello,
I'm using advancedatagrid to render my table but I'm facing a problem to skip few rows which are unwanted or to hide. I should retain my original dataprovider without any modifications to achive this behaviour as I'm using it at many places.
Can you guys please send me a tip or the example code? I really appreciate for it.
Thanks,
Siva.Hello Gaurav,
Thank You..!!! I tried appling filterFunction on the ADG and got whatever I expected but filter changes the original dataprovider behaviour. SO which I dont want to do it.
I have created a local variable and binded whatever data wanted to display on that page. Infact it works as expexted and I still have original data provider as well.
I have one more problem, I'm using creationComplete to initialize my local data provider value. It works only once while creation of state. If I navigate my screens fore and back and come back to this screen, it doesn't display the modified values as creationComplete loads only while state creation.
Is there any mothid which does the samething while vising the page every time than creation?
Thanks,
Siva -
I've created external table, but how do I get the external table to skip the header and footer?
CREATE TABLE "KAS_EXT"
CUSTOMERID VARCHAR2(9),
CANVASSID VARCHAR2(9),
REPID VARCHAR2(9)
ORGANIZATION external
TYPE oracle_loader
DEFAULT DIRECTORY SYS_SQLLDR_XT_TMPDIR_00000
ACCESS PARAMETERS
RECORDS DELIMITED BY NEWLINE CHARACTERSET WE8MSWIN1252
BADFILE 'kaslist_ext_devt_water.bad'
LOGFILE 'kaslist_ext_devt_water.log_xt'
READSIZE 1048576
FIELDS TERMINATED BY "," LDRTRIM
MISSING FIELD VALUES ARE NULL
SKIP 1 <<<<<<<<<<<<<<< here???
REJECT ROWS WITH ALL NULL FIELDS
CUSTOMERID CHAR(255)
TERMINATED BY ",",
CANVASSID CHAR(255)
TERMINATED BY ",",
REPID CHAR(255)
TERMINATED BY ","
location
'kas.csv'
)REJECT LIMIT UNLIMITEDI don't know of any way to make it automatically skip footers. Hopefully, the footer doesn't match your data structure, so that it couldn't get loaded as a record, then it would just go to your bad file.
Maybe you are looking for
-
Not able to Control the Data Control
Hi, I have a bar chart which is bound to datacontrol through one iterator and one access iterator, and is placed on one splitter. Now on moving splitter and resizing the chart datacontrol re-fetches the data from the server. Why ? Cant it just re-siz
-
hello, i'm really tried with your itunes it really complicated to synced i try to do everything you wrote it in the website but i got the same msg
-
MuVo V200 - Need advice on how to play recorded files using Windows Media Pla
Hi I bought a V200. Transferred the recorded audios to my hard disk but can't get windows media player to play it. Error message of: codecs needed. It was recorded as a WAV file. Please advise. Thanks.
-
Can't open a Pages file with Pages
I have someone sending me a file from a new version of Pages than I have. The files won't open, is there a work around?
-
Hai friends i am a new of the script, i dont know the script output type of sales order, purchase order, and some script output types. thanks & Regards kumar