DataGrid with multi-row headers
Hello!
How can I have a DataGrid with header and sub-headers so to speak.
Something like this:
[ Main Header ]
[ sub1] [sub2] [sub3]
Thanks!
There is a SplitDataGridColumn example on my blog
Alex Harui
Flex SDK Team
Adobe System, Inc.
http://blogs.adobe.com/aharui
Similar Messages
-
Issues in Table with Multi-Row Insert
I have created a master detail screens using jheadstart on 2 separate pages, Master in the Form layout and detail in the Table Layout with multi-row insert, update and delete flags ON. Have set the New Rows count = 2.
Issue 1
If I try to delete any existing rows, it gives error for new rows saying value is required for the mandatory fields. It should just ignore the new rows if I have not updated any values for any attributes in the those row(As it does for non Master-Detail Table layout). I guess this might be happening because the jheadstart code is setting the foreign key for new rows the detail, but not resetting the status of the rows back to INITIALIZED.
I also noticed that the create() of underlying EO is getting called for those blank rows when I click on 'Save' button, even if I have not changed any data in those rows.
Issue 2
When I try to select the new rows also for deletion, I am getting a '500 Internal Server Error' with following stack trace... This is also happening for normal (non Master-Detail) Table layout.
java.lang.IllegalStateException: AdfFacesContext was already released or had never been attached. at oracle.adf.view.faces.context.AdfFacesContext.release(AdfFacesContext.java:342) at oracle.adfinternal.view.faces.webapp.AdfFacesFilterImpl.doFilter(AdfFacesFilterImpl.java:253) at oracle.adf.view.faces.webapp.AdfFacesFilter.doFilter(AdfFacesFilter.java:87)
Issue 3
I have put some validation code in the validate() method in the MyEntityImpl.java class.
The validate method seems tobe getting called lots of times, in my case 20 times, where the new rows are just 2.
Environment:
Jdeveloper 10.1.3, JHeadStart 10.1.3 build 78, Windows XP
thanksThanks for the reply.
Issue 1:
What I have observed that in case of multi-row select enabled tables, the blank rows do not have any data. This is because the EO's create() method is called only when we post the data using 'Save' button. Thus the Foreign Keys are also not setup. This is a correct behavior since create() and FK setups etc should get done only if the user has inputted any value in the new rows and thus intend to insert new data into the table.
I am able to find the exact cause of this issue. It is happening because in the details table, I have a column which needs tobe shown as checkbox. Since we can only bind checkbox to an Boolean attribute in VO, I have created a transient attribute of type Boolean, which basically calls the getter/setter of actual attribute doing the String "Y"/"N" to true/false conversion. Here is code for the transient attribute getter/setter
public Boolean getDisplayOnWebBoolean() {
return "Y".equals(getDisplayOnWeb()) ? Boolean.TRUE : Boolean.FALSE;
public void setDisplayOnWebBoolean(Boolean value) {
if(Boolean.TRUE.equals(value))
setDisplayOnWeb("Y");
else
setDisplayOnWeb("N");
Now when I click on the "Save" button, the setter for the boolean field is getting called with the value = false and this is resulting into the row being maked as dirty and thus the validation for the required attributes is getting executed and failing.
Issue 2:
Confirmed that correct filter-mapping entries are present in the web.xml.
Now when I select the new blank rows for deletion and click save, following exception is thrown:
java.lang.ClassCastException: oracle.jheadstart.controller.jsf.bean.NewTableRowBean at oracle.jheadstart.controller.jsf.bean.JhsCollectionModel.getRowsToRemove(JhsCollectionModel.java:412) at oracle.jheadstart.controller.jsf.bean.JhsCollectionModel.doModelUpdate(JhsCollectionModel.java:604) at oracle.jheadstart.controller.jsf.lifecycle.JhsPageLifecycle.processModelUpdaters(JhsPageLifecycle.java:541) at oracle.jheadstart.controller.jsf.lifecycle.JhsPageLifecycle.validateModelUpdates(JhsPageLifecycle.java:571)
thanks - rutwik -
Hi, I'm new in apex and I tried to build master detail report on some view. Everything is cool but "delete checked" doesn't work.
"ORA-20001: Error in multi row delete operation: row= , ORA-06502: PL/SQL: numeric or value error: NULL index table key value,"
the problem is that I don't know what is wrong :), I have a special trigger "instead of delete on MY_VIEW", but in this error problem is not explained.
Anybody knows what can be wrong? It is probably a problem with trigger or multi row doesn't work with views? I couldn't find how MRD knows what kind of statement use to delete rows so I don't know if the statement that program used is correct. In debug it lokks that:
0.32: ...Do not run process "ApplyMRU", process point=AFTER_SUBMIT, condition type=REQUEST_IN_CONDITION, when button pressed=
0.32: ...Process "ApplyMRD": MULTI_ROW_DELETE (AFTER_SUBMIT) #OWNER#:MY_VIEW:ITEM1:ITEM2
0.33: Show ERROR page...
0.33: Performing rollback...
thanks for any help
//sorry for english mistakes
edit: it doesn't matter if I use in trigger delete from ... where item1=:OLD.item1 ; or if I use item1=:P4_item1 (which actually saves correct values)
Edited by: user5931224 on 2009-06-13 08:55I realised that this is not a problem with trigger, I changed trigger to "NULL;" and problem is the same. Maybe sb used master detail on view not only on tables and know what can be wrong in this situation?
-
Hi.
I`m using an AdvancedDatagrid to display users data.
I want to hide some of the datafields, and only show it on
user interaction. For example:
I have four columns: id, email, username, registration_time
Theese are displayed, but when the user clicks on a button in
one of the rows, the row expands and shows the other data like
password, registration ip, etc. (some of them have to be editable)
Any solution to this?
Thanks a lot.i do have the same requirements.. any updates
please!~~ -
How to convert a row into a column with the row headers displayed as column in javaFx?
How do in convert a row of data into column of data to display as shown below:
Column1|Column2|Column3|Column4
C1 | C2 | C3 | C4
C5 | C6 | C7 | C8
How to convert the above default behavior to as below
Column1| C1 | C5
Column2| C2 | C6
Column3| C3 | C7
Column4| C4 | C8.
-
SQL 2008 Trigger to handle multi rows scenario
I have created below trigger to start logging the company changes from the table1 into another audit table. It works fine with single row but crashing with identical change with multiple rows. Can you please help me to update the trigger to handle multi-row
scenario. Thanks.
GO
IF
NOT EXISTS
(SELECT
* FROM sys.objects
WHERE object_id
= OBJECT_ID(N'[dbo].[Company_AuditPeriod]')
AND type
in (N'U'))
CREATE
TABLE [dbo].[Company_AuditPeriod](
[Client] [varchar](25)
NOT NULL,
[Period] [varchar](25),
[Table_Name] [varchar](25),
[Field_Name] [varchar](25),
[Old_Value] [varchar](25),
[New_Value] [varchar](25),
[User_ID] [varchar](25)
[Last_Update] [datetime],
[agrtid] [bigint]
IDENTITY(1,1)
NOT NULL,
ON [PRIMARY]
GO
--create trigger
SET
QUOTED_IDENTIFIER ON
GO
CREATE
TRIGGER [dbo].[Table1_Update]
ON [dbo].[Table1]
FOR
UPDATE
NOT
FOR REPLICATION
AS
BEGIN
DECLARE
@status
varchar(3),
@user_id
varchar(25),
@period
varchar(25),
@client
varchar(25),
@last_update
datetime
DECLARE
@Old_status
varchar(3),
@Old_user_id
varchar(25),
@Old_period
varchar(25),
@Old_client
varchar(25)
SELECT
@status
= status,
@user_id
= user_id,
@period
= period,
@client
= client,
@last_update
= last_update
FROM Inserted
SELECT
@Old_status
= status,
@Old_user_id
= user_id,
@Old_period
= period,
@Old_client
= client
FROM Deleted
If @Old_status <> @status
INSERT INTO Company_AuditPeriod
VALUES ( @client, @period,
'Table1',
'period',@old_status, @status, @user_id, @last_update)
END
GOSorry for the confusion.
I just made sure the table name is same in sys.objects statement and create table statement (there was a typo)
IF
NOT EXISTS
(SELECT
* FROM sys.objects
WHERE object_id
= OBJECT_ID(N'[dbo].[Company_AuditPeriod]')
AND type
in (N'U'))
CREATE
TABLE [dbo].[ Company_AuditPeriod](
Earlier you created Trigger on Company_AuditPeriod but
We have to create trigger on Table1 please with multi row scenario. Thanks.
--Company_AuditPeriod DDL
GO
IF
NOT EXISTS
(SELECT
* FROM sys.objects
WHERE object_id
= OBJECT_ID(N'[dbo].[Company_AuditPeriod]')
AND type
in (N'U'))
CREATE
TABLE [dbo].[ Company_AuditPeriod](
[Client] [varchar](25)
NOT NULL,
[Period] [varchar](25),
[Table_Name] [varchar](25),
[Field_Name] [varchar](25),
[Old_Value] [varchar](25),
[New_Value] [varchar](25),
[User_ID] [varchar](25)
[Last_Update] [datetime],
[agrtid] [bigint]
IDENTITY(1,1)
NOT NULL,
ON [PRIMARY]
GO
--Table1 DDL
CREATE TABLE [dbo].[Table1](
[bflag] [int] NOT NULL,
[client] [varchar](25) NOT NULL,
[copies] [int] NOT NULL,
[cost_bio] [decimal](28, 8) NOT NULL,
[cost_cpu] [decimal](28, 8) NOT NULL,
[cost_dio] [decimal](28, 8) NOT NULL,
[date_ended] [datetime] NOT NULL,
[date_started] [datetime] NOT NULL,
[description] [varchar](255) NOT NULL,
[expire_days] [int] NOT NULL,
[func_arg] [varchar](255) NOT NULL,
[func_id] [int] NOT NULL,
[ing_status] [int] NOT NULL,
[invoke_time] [datetime] NOT NULL,
[last_update] [datetime] NOT NULL,
[mail_flag] [tinyint] NOT NULL,
[me_mail_flag] [tinyint] NOT NULL,
[module] [char](3) NOT NULL,
[order_date] [datetime] NOT NULL,
[orderno] [int] NOT NULL,
[output_id] [int] NOT NULL,
[poll_status] [char](1) NOT NULL,
[printer] [char](16) NOT NULL,
[priority] [char](1) NOT NULL,
[priority_no] [int] NOT NULL,
[process_id] [int] NOT NULL,
[report_cols] [int] NOT NULL,
[report_id] [varchar](255) NOT NULL,
[report_name] [varchar](25) NOT NULL,
[report_type] [char](1) NOT NULL,
[server_queue] [char](12) NOT NULL,
[status] [char](1) NOT NULL,
[step_id] [char](8) NOT NULL,
[system_name] [char](8) NOT NULL,
[used_bio] [int] NOT NULL,
[used_cpu] [int] NOT NULL,
[used_dio] [int] NOT NULL,
[user_id] [varchar](25) NOT NULL,
[variant] [int] NOT NULL,
[agrtid] [bigint] IDENTITY(1,1) NOT FOR REPLICATION NOT NULL,
CONSTRAINT [PK_acrrepord001] PRIMARY KEY NONCLUSTERED
[agrtid] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 90) ON [INDEX]
) ON [PRIMARY]
G0<o:p></o:p>
--create trigger
SET
QUOTED_IDENTIFIER ON
GO
CREATE
TRIGGER [dbo].[Table1_Update]
ON [dbo].[Table1]
FOR
UPDATE
NOT
FOR REPLICATION
AS
BEGIN
DECLARE
@status
varchar(3),
@user_id
varchar(25),
@period
varchar(25),
@client
varchar(25),
@last_update
datetime
DECLARE
@Old_status
varchar(3),
@Old_user_id
varchar(25),
@Old_period
varchar(25),
@Old_client
varchar(25)
SELECT
@status
= status,
@user_id
= user_id,
@period
= period,
@client
= client,
@last_update
= last_update
FROM Inserted
SELECT
@Old_status
= status,
@Old_user_id
= user_id,
@Old_period
= period,
@Old_client
= client
FROM Deleted
If @Old_status <> @status
INSERT INTO Company_AuditPeriod
VALUES ( @client, @period,
'Table1',
'period',@old_status, @status, @user_id, @last_update)
END
go -
Multi Row Delelte - Delete all rows
I have a multi row delete button with multi row checkboxes. When I tried to delete the selected rows, actually all rows are deleted. I have a multi row delete process.
Other information:
This tabular form displays all related users for one particular department. The department ID is the primary key in this reference table.
I am using APEX 2.2 and IE as browser. Any one else here know what settings I should set.After review previous thread, I created the following PL/SQL expression for the multi row delete process in the condition field:
FOR I IN 1..APEX_APPLICATION.G_F01.COUNT LOOP
DELETE FROM tbl
WHERE colNM = APEX_APPLICATION.G_F02(APEX_APPLICATION.G_F01(I))
END LOOP;
END;
I also tried htmldb_application.g_f01.count to reference the selected rows. Both of them are not working. Someone, please help, where should I put this PL/SQL expression. I am pretty to APEX.
Thanks. -
How do I get the Layout Guides (A,B,C column headers and 1,2,3 Row Headers) to print on my spreadsheet? They are invaluable for discussing the data with my clients over the phone.
They appear while I am editing, but don't print with the spreadsheet. I know how to do it in Excel, but I am transitioning to Numbers. I can't imagine I have to type them into their own columns and rows. It must be a difference in vernacular that I can't find the solution in the User Guide. Can anyone help?Hi ktjobauer,
Numbers is not Excel and Excel is not Numbers. Numbers is WYSIWYG (at least in File > Print and the actual printout).
I can't imagine I have to type them into their own columns and rows.
No, you don't. You can use the charm of Numbers to create cell references for your Excel clients.
In this Numbers Table, I have added some extra Columns that you can hide later.
Column B =COLUMN(A2)
Column C =HLOOKUP(B2,'Table 1-1' :: $1:$2,2,FALSE) [explanation later]
Column D =ROW(B2)
Column E =C2&D2
Add those formulas to the first Body Row (below the Header Row) and Fill Down.
Column C refers to another Table which you need only create once, to convert a Column number to a letter:
and so on from 1-26, A-Z.
You can move the second Table to another Sheet to hide it. Formulas will automatically adjust to keep the links between Sheets.
Now in the first Table, select and Hide Columns B,C,D. Formulas will continue to work with hidden cells:
Regards,
Ian. -
How to create a datatable with row headers and column headers
Hi,
I am trying to create a two dimensional datatable which has both column headers and row headers. using <h:datatable> i could create a datatable with only column headers.
Thanks in advanceAre you saying that you want a column with only th's? You could also just apply some CSS on that specific column that its rows look like headers.
-
Hi again, developers:
I'm in a search of a datagrid with certain characteristics:
- variableRowHeight = "true"
- only one column
- each row must have a custom item renderer with possibly different heights, and a fixed width
- the datagrid must show always every item in the data provider with no vertical scroll bars, what means that the datagrid height must have always the exact height sum of all the item renderers it is displaying.
- and no extra empty rows must appear in the last positions of the datagrid
The last two requirements are something difficult to achieve... for some reason, empty rows appear at the last positions of the datagrid. I post what i've managed to get:
<mx:Script>
<![CDATA[
private function resize():void
if (dg.dataProvider)
var h:Number = dg.measureHeightOfItems( -1, dg.dataProvider.length);
dg.height = h;
]]>
</mx:Script>
<mx:DataGrid id="dg" width="530" horizontalCenter="0" verticalScrollPolicy="off"
dataProvider="{dp}"
wordWrap="true" variableRowHeight="true" showHeaders="false" dataChange="resize()" height="{dg.measureHeightOfItems(-1,dg.dataProvider.length)}" click="Alert.show(dg.rowCount.toString());">
<mx:columns>
<mx:DataGridColumn headerText="ID" width="50">
<mx:itemRenderer>
<mx:Component>
<mx:TextArea height="{Math.random()*100}" wordWrap="true" backgroundColor="{Math.random() * 16777216}" paddingTop="0" paddingBottom="0"/>
</mx:Component>
</mx:itemRenderer>
</mx:DataGridColumn>
</mx:columns>
</mx:DataGrid>Thanks Harui, but it doesn't help. If the border is set it will help, but the very big problem is the empty rows that appear at the end of the datagrid... I can't find a way of measuring correctly the height of the itemRenderers!
I'll update this thread if I manage to do it. -
I am using the fancy new printing capablities in java 1.5 to print my JTable and wow is it ever slick!
PrintRequestAttributeSet set = new HashPrintRequestAttributeSet();
set.add(OrientationRequested.LANDSCAPE);
this.matrixJTable.print(JTable.PrintMode.NORMAL, null, null, true, set, false);Its just that easy. Way to go sun!
The one problem that I am encountering is that my row headers don't print. The problem is that JTables don't support row headers, you have to use a JScrollPane for that.
I need a way to print my JTable so that the row headers show up in the printout... and hopefully still use the warm and fuzzy new printing capabilities of JTable printing in java 1.5.
(ps/ Isn't it time to add row header support to JTables?)The problem is that JTables don't support row headers, you have to use a JScrollPane for that.Well technically JTable's don't really support column headers either. It is a seperate component (JTableHeader). A JTable will automatically add its table header to the table header area of a JScrollPane. (but you don't have to use a jscrollpane to see the column headers, it is just the quickest and easiest way).
Really shouldn't be hard to implement a row header and manually add it to the scroll panes row header area or use a BorderLayout and put your row header in the WEST and put your table in the CENTER if you don't want a scroll pane.
Of course this won't help you with your printing issue. -
Hello!
How can I have a DataGrid with header and sub-headers so to speak.
Something like this:
[ Main Header ]
[ sub1] [sub2] [sub3]
Thanks!There is a SplitDataGridColumn example on my blog
Alex Harui
Flex SDK Team
Adobe System, Inc.
http://blogs.adobe.com/aharui -
Multi-Row panorama with Photomerge ...
Hi,
does somebody has experiences with stitching multi-row panoramas with CS4's photomerge?
I always ended up with a very strange viewpoint somewhere into the sky instead of a straight horizont. It's somehow understandable - where should Photomerge know the horizont and the desired viewpoint from.
So, are there any tutorials or hints how to create multi row panoramas with Photomerge - I searched a lot but didn't find any usable. Or do I have to use another tool like PTGui?
Thanks a lot
KonradYes, the first row are image in the orthognal plane around the vertical axis. Stitching them together result in a normal horizontal 360 pano.
But I've a second row above the first one from the upper parts of the sourrounding. And using Photomerge they are not merged together in a way that places the first row in front of the horizont is still the same as for the first row - what's clear, because PS does known nothing about those semantics. -
Multi-row uipdate with an insert into another table [I think]
Folks,
I'm trying to get a multi row region with a checkbox against each row. When a user checks a box I want to insert a corresponding row into another table. So I've tried to simplify the questions and distill the problem down using the EMP table.
So, here goes:
I have table EMPS, which looks like this:
EMPNO Number
FIRSTNAME Varchar2(9)
LASTNAME Varchar2(10)
HIREDATE Date
I have table EMP_CANDIDATES, which looks like this:
EMPNO Number
SELECTION_DATE Date
NOTES Varchar2(53)
- I want to create a multi-row region based on EMPS, with a checkbox on each employee row.
- The user should be able to select any number of employees in the region and then press submit.
- on-submit there needs to be a process, which inserts a record into EMP_CANDIDATES for each checked employee.
I've tried pre-populating a collection with the EMPS records and using apex_item.checkbox to produce a checkbox, using this code:
=============
if apex_collection.collection_exists(p_collection_name=>'EMPS') then
apex_collection.delete_collection(p_collection_name=>'EMPS');
end if;
apex_collection.create_collection_from_query(
p_collection_name=>'EMPS',
p_query=>'select
p.empno,
p.hiredate,
p.firstname,
p.lastname,
null selection
from emps p');
=========
I can create a report region on this using tthe following SQL:
select c001 empno
, c002 hiredate
, c003 firstname
, c004 lastname
,apex_item.checkbox(1,c005) selection
from apex_collections
where collection_name ='EMPS'
======
So how do I now get a MRU that will insert a row into EMP_CANDIDATES for each checked row in my region? Or have I gone about this the wrong way?
TFH
DerekHi Derek,
Firstly, your checkbox should be on the c001 field as this is the one that contains your empno.
Then, you need a page process that can be triggered by a button. The process should be set to run "On submit (After computations and validations)" and the PL/SQL code would be something like:
DECLARE
v_empno NUMBER;
BEGIN
IF HTMLDB_APPLICATION.G_F01.COUNT = 0 THEN
raise_application_error(-20001, 'Please select at least one employee!');
END IF;
FOR i IN 1.. HTMLDB_APPLICATION.G_F01.COUNT LOOP
v_empno := TO_NUMBER(HTMLDB_APPLICATION.G_F01(i));
INSERT INTO EMP_CANDIDATES VALUES (v_empno, whateverdate, whatevernotes);
END LOOP;
END;
This will firstly count the items that have been ticked - if there aren't any, the user gets an error message. If there is at least one item ticked, the code will loop through these, get the empno relating to the ticked box and insert a record into the emp_candidates table. Please note that no account is taken here of any validation on this second table - if you need to ensure, for example, uniqueness of records in this table, you will have to update the above to perform this validation.
Regards
Andy -
Multi-row block with many image-java-beans
Hi, I want to create a multi-row block based on a table, e.g. emp with 5 records.
Then I want to add 5 java-bean images in the same block. Now I want to read from the db-table emp the blob-column with the image of the corresponding empno. Is this possible? How can I do this? Can someone give me a sample for this?
Thanx BeaHi John, by running the scipts this message occurs:
[sql] Executing file: C:\Programme\Oracle\JDev11g\samples\Infrastructure\DBSchema\Scripts\DataScripts\DISCOUNTS_BASE.sql
[sql] Executing file: C:\Programme\Oracle\JDev11g\samples\Infrastructure\DBSchema\Scripts\DataScripts\MEMBERSHIPS_BASE.sql
[sql] Executing file: C:\Programme\Oracle\JDev11g\samples\Infrastructure\DBSchema\Scripts\DataScripts\SHIPPING_OPTIONS_BASE.sql
[sql] Failed to execute: INSERT INTO SHIPPING_OPTIONS_BASE VALUES (1, 'US', '3.15', '11.98', '27.50', 'Y', '0', SYSDATE, '0', SYSDATE, 0)
BUILD FAILED
C:\Programme\Oracle\JDev11g\samples\Infrastructure\Ant\build.xml:16: The following error occurred while executing this line:
C:\Programme\Oracle\JDev11g\samples\Infrastructure\DBSchema\build.xml:146: java.sql.SQLException: ORA-01722: invalid number
What shall I do?
Bea
Maybe you are looking for
-
A lease agreement attached to an e-mail opened fine in Pages with Mountain Lion this morning. I upgraded to Mavericks this afternoon and neither a revised offer nor the old one can be opened. A screen comes up saying I can't open Microsoft Word as Po
-
HP LaserJet Pro CM1415fnw problem
I can't use printer at all. When I turn it on, white screen appears on display and i can't use any printer function. What should I do to solve this problem?
-
How to use in submit with variant
Dear Freinds As per the my requirement from my program i want to send the data to spool and from tehre i want to download as PDF . for the standard program i have a variant . I want to use the variant which has been set for the standard program
-
Is it safe to charge an iPhone 5S with an iPad 12 W Apple Charger ?
Hello, I want to purchase an extra DC Charger to charge both my Ipad 4th gen and my iPhone 5S. Is it safe to use a 12W Apple Charger for both device ? Thanks.
-
Converting video to Flash with controls
I want to take video from a DVD and turn it into a Flash movie so I can use it on a web page. I would like it to have the controls for playing and pausing. What would be the easiest way to do this? Is there certain software I should be looking for? T