TableView nested columns binding with nested objects
Let's suppose i have an object like this
class Person {
SimpleStringProperty name;
SimpleStringProperty surname;
SimpleObjectProperty<Address> address;
class Address {
SimpleStringProperty client;
SimpleStringProperty address;
SimpleIntegerProperty number;
}is there a way to bind a TableView<Person> in order to have a column and nested column for the object Address ?
/* First name column */
TableColumn firstNameCol = new TableColumn("First Name");
firstNameCol.setCellValueFactory(new PropertyValueFactory<Person, String>("name"));
/* Last name column */
TableColumn lastNameCol = new TableColumn("Last Name");
lastNameCol.setCellValueFactory(new PropertyValueFactory<Person, String>("surname"));
/* Address main column */
TableColumn addressCol = new TableColumn("Address Informations");
addressCol.setCellValueFactory(new PropertyValueFactory<Person, Address>("address"));
/* Client nestedcolumn */
TableColumn clientCol = new TableColumn("Client");
clientCol.setCellValueFactory(new PropertyValueFactory<Address, String>("client"));
/* Address nested column */
TableColumn addrCol = new TableColumn("Address");
addrCol .setCellValueFactory(new PropertyValueFactory<Address, String>("address"));
/* Number nested column */
TableColumn numberCol = new TableColumn("Number");
numberCol .setCellValueFactory(new PropertyValueFactory<Address, Integer>("number"));
addressCol.getColumns().addAll(clientCol, addrCol , numberCol );
getColumns().addAll(firstNameCol, lastNameCol, addressCol);of course i tried this and doesn't work..
Hey,
Looks a good question!
Welh, even if I didn't try.. I suppose you could look in this direction:
I would try to pass the hole object 'Address' to the different TableColumns 'client', 'address' and 'number'.
clientCol.setCellValueFactory(new PropertyValueFactory<Person, Address>("address"));
addrCol.setCellValueFactory(new PropertyValueFactory<Person, Address>("address"));
numberCol.setCellValueFactory(new PropertyValueFactory<Person, Address>("address"));Then create your own CellFactories for every TableColumn.
Link it this way.
clientCol.setCellFactory(myCustomCellFactory);Your CellFactory should look like this:
public class myCustomCellFactory extends TableCell<Object, Address> {
//constructor
public myCustomCellFactory() {
//methods
@Override
public void startEdit() {
@Override
public void updateItem(Address oAddress, boolean empty) {
super.updateItem(item, empty);
if (!isEmpty()) {
setText(oAddress.getClient());
}I'm not sure this example works, I've coded it here..
Hope it helps..
Edited by: FXdude on 17-jan-2013 6:55
Similar Messages
-
ComboBox disabled after binding with vo
Hi,
i have comboBox... its is enabled..after binding with view object its disabled.. Ive tried to change it from code and property inspector but nothing helps.\
Code from pageDef
<combobox id="DCComboBox" xmlns="http://xmlns.oracle.com/adfm/jcuimodel"
ListOperMode="navigation" IterBinding="SerieROView1Iter" StaticList="true" ApplyValidation="false" Editable="false">
<AttrNames xmlns="http://xmlns.oracle.com/adfm/uimodel">
<Item Value="NazwaSkrocona"/>
</AttrNames>
</combobox>ive added Viewable="true" in section above and it is working - combo is enabled and i can view attributes.... but i get errors in jdeveloper log
Exception in thread "AWT-EventQueue-0" java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Boolean
at oracle.adf.model.binding.DCControlBinding.evaluateBooleanExpression(DCControlBinding.java:523)
at oracle.adf.model.binding.DCControlBinding.isControlViewable(DCControlBinding.java:515)
at oracle.jbo.uicli.binding.JUCtrlValueBinding.isViewable(JUCtrlValueBinding.java:3207)
at oracle.jbo.uicli.binding.JUCtrlAttrsBinding$mySetEnabledThread.run(JUCtrlAttrsBinding.java:45)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
i understand it is connected with Viewable="true", but while editing xml it is expecting String.
And yes - it is read only VO - so why its working now? :) -
Join parent with child on nested object table
We made a nested table in Oracle 8i with two object types and collection type.
We manipulating with it - no problem.
However trying to join parent with the child cause the problem in PL/SQL
This sintax is OK for Oracle SQL and returns right result:
select
matl.barcode_id,
matl.LAST_MOD_TSP,
dtl.matl_nbr,
bmm.matl_dsc,
dtl.asn_qty,
dtl.mfg_dt
from
asn_barcode_matl_ot matl,
table(matl.asn_barcode_matl_dtl) dtl,
wms_brwy_matl_mstr bmm
where
matl.rcpt_seq_id = 1
and matl.brwy_cd = bmm.brwy_cd
and dtl.matl_nbr = bmm.matl_nbr;
But stored procedure with this statement doesn't compile and giving the error:
PLS-00201: identifier 'MATL.ASN_BARCODE_MATL_DTL' must be declared
Looks like a bug? What is wrong?It is not possible. You can do this with trigger code, or preferably by adjusting your delete procedure api. A delete of the master record will often fail because other children records exists, so you have to catch that exception and do something that is useful to you in this situation.
Regards,
Rob. -
Nested object property in a form?
Hi,
I have a problem with nested object property in a form; the nested property could be business.address.zipcode, however, the Flex data binding doesn't support the "." operator. Any advice/hint/code sample will be greatly appreciated.It does support the dot operator, there are several examples below:
http://livedocs.adobe.com/flex/3/html/help.html?content=databinding_4.html
Have you tried? What problems did you have? -
Queue Table with Nested Objects
I need to create a queue table based on nested object
These are my declarations
TYPE TESTATATYPE AS OBJECT (
CODICE VARCHAR2(5),
DESCRIZIONE VARCHAR2(30)
TYPE DETTAGLIOTYPE AS OBJECT (
CODICE VARCHAR2(5),
DESCRIZIONE VARCHAR2(30),
VALORE NUMBER
TYPE DETTAGLITYPE IS TABLE OF DETTAGLIOTYPE
TYPE MESSAGGIOTYPE AS OBJECT (
TESTATA TESTATATYPE,
DETTAGLI DETTAGLITYPE
Now i'm trying to create queue table
DBMS_AQADM.CREATE_QUEUE_TABLE(queue_table => 'MsgQTab',
queue_payload_type => 'MessaggioType',
storage_clause => 'NESTED TABLE
dettagli STORE AS dettagli_tab_Q',
sort_list => 'priority,enq_time'
but I get
ORA-00904: invalid column name
ORA-06512: at "SYS.DBMS_AQADM_SYS", line 2012
ORA-06512: at "SYS.DBMS_AQADM", line 55
ORA-06512: at line 3
maybe the problem is storage clause, can you help me ?
nullAndrea,
You cannot currently use a nested table even as an embedded object within a message payload.
However, you can create an object type that contains one or more VARRAYs, and create a queue table that is founded on this object type. I guess this might be the problem you are facing. -
Nested Objects for a Data Provider in a Data Grid, not displaying data
Hi, I have a datagrid and the dataprovider for this grid is the result of a RPC call. The result set has the following structure:
Array
[0]->Object #1
[one] => 1
[two] => 1
[three] => Object #2
[apple1] = > Object #3
[color] => red
[rate] => 20
[apple2] => Object #4 ( the number of apples is dynamic, apple3,apple4 .. and so on)
[color] => blue
[rate] => 100
and so on ... so the number of apple objects will vary since its
dynamic. How do I display this data in a datagrid ??? Please help!! I
saw many articles on creating the "Nested DataGridColumn " classes...
like this :
http://active.tutsplus.com/tutorials/flex/working-with-the-flex-datagrid-and-nested-data-structures/
it helps, but the problem with my data is that some of the indexes (like apple1,apple2 etc) are dynamic.
Also, my flex application is a desktop application (in case that matters). Just to see whats going on, I
dropped all the nested arrays and used a plain simple one-dimensional array. Even in this case the data
isnt getting displayed.
I dont know what im doin wrong. the datafields, labels etc e'thing is correct. I even debugged and
im getting the result on the flex side. whats going on ?No luck ... i converted the result set to a List, and even tried with an iList. Same problem - nothing gets displayed...
I have no idea whats happening ....
This is my code :
[Bindable]private var privilegesArray:ArrayCollection = new ArrayCollection();
public function init():void{ // called on creation complete
RO.getPrivileges.addEventListener(ResultEvent.RESULT,handleGetPrivileges);
RO.getPrivileges();
protected function handleGetPrivileges(event:ResultEvent):void{
privilegesArray = event.result as ArrayCollection;
<mx:DataGrid id="privilegesDG" dataProvider="{privilegesArray}" width="100%">
<mx:columns>
<mx:DataGridColumn headerText="Name" dataField="name" />
<mx:DataGridColumn headerText="Alias" dataField="alias" />
</mx:columns>
</mx:DataGrid>
The data that gets returned is smthing like this : (for the moment I have removed all the nested objects and arrays and returning just a simple plain array)
Array => [0] => Object #1
[name] => some name
[alias] => alias -
Using Nested Object Properties as DataGrid dataField
I am populating a DataGrid with an ArrayCollection of
Objects. Each of those Objects has a property that is itself an
Object. I want to use a property of the second (or "nested") Object
as a dataField for one of my columns.
Any idea how to make this work? Would a custom item render be
the only way?Using the labelFunction property of the DataGridColumn would
be enough:
<mx:DataGrid width="100%" height="100%"
dataProvider="{myAC}">
<mx:columns>
<mx:DataGridColumn dataField="myProperty1" />
<mx:DataGridColumn dataField="myProperty2" />
<mx:DataGridColumn
labelFunction="myOwnLabel" />
</mx:columns>
</mx:DataGrid>
function myOwnLabel(item:Object,
column:DataGridColumn):String
return item.myProperty;
The function must have that signature in order to work, where
item is an instance of the objects in your dataProvider and column
is the DataGridColumn calling the function. -
Can we show the nested objects in Powershell?
I am adding a .NET type to Powershell session using Add-Type and then creating object of that type using New-Object. This is done as follows:
Add-Type -AssemblyName OuterObj
$a = New-Object OuterObj
Object of type OuterObj is successfully created. Now .NET type $a has a field named innerObj which is object of another .NET type innerObject. So I add "innerObject" .NET type and create an instance using New-Object.
Add-Type -AssemblyName innerObject
$b = New-Object innerObject
Object of type innerObject is also successfully created. Now I do as follows:
$a.innerObj = $b
Now when I print $a, it shows something like this:
innerObj : innerObject
Thus it does not display the contents of innerObject by default. When I go and explore, innerObj has the fields. I know Powershell does not show the nested objects by default but instead just shows their types, but is there a way I can specify that what
level of nesting of objects powershell should show by default? Is there something to specify to show 1 or 2 levels of nested objects?
Any help would be highly appreciated.The simplest approach, if you're writing these C# classes yourself, is probably to override the class's ToString method. That way it will just display that way by default in PowerShell, without any extra effort on the scripter's part.
If that's not an option, then you can write PowerShell code to accomplish something similar. Here are examples of both:
# C# ToString version:
Add-Type -TypeDefinition @'
public class innerObject
public string Property1;
public string Property2;
public override string ToString()
return string.Format("Property1: {0}, Property2: {1}", Property1, Property2);
public class OuterObj
public innerObject innerObj;
$a = New-Object OuterObj
$b = New-Object innerObject -Property @{ Property1 = 'First Property'; Property2 = 'Second Property' }
$a.innerObj = $b
$a | Format-List
# PowerShell version using constructed property values with
# Format-List.
Add-Type -TypeDefinition @'
public class innerObject
public string Property1;
public string Property2;
public class OuterObj
public innerObject innerObj;
$a = New-Object OuterObj
$b = New-Object innerObject -Property @{ Property1 = 'First Property'; Property2 = 'Second Property' }
$a.innerObj = $b
$a | Format-List -Property @{ Label = 'innerObj'; Expression = { "Property1: $($_.innerObj.Property1), Property2: $($_.innerObj.Property2)" } } -
I am looking for advice on how to nest objected created from
cfcs...
The place I have seen this sdone is in the fusebox framwork
in the following:
#myFusebox.getCurrentCircuit().getAlias()#
What I would like to do is create an object called called
users from a users.cfc with methods such as listUsers() and
findUser(userID)...
Ex. #users.findUser(34)#
Then from there I want to next another object (object might
not be the correct term) or set of functions that deal with the
user specified such as getName() and getEmail()...
Ex. #users.findUser(34).getName()#
Ex. #users.findUser(34).getEmail()#
Can someone explain to me how this can be done?
Thanks!jeby wrote:
> Can someone explain to me how this can be done? Thanks!
>
How this is done depends largely on how the objects are
related to each
other. I.E. Does one object extend (inherit) the other object
creating
an is-a or parent child relationship. Or does one object
contain an
instance of the other as a property|variable (composite)
creting an
has-a relationship.
I'm doing some web service with complex object testing and I
have just
written this simple testing code. See if it makes some sense
to you.
basic.cfc
<cfcomponent>
<cfproperty name="foo" type="string">
<cfproperty name="bar" type="string">
<cfscript>
this.foo = "George";
variables.bar = "Gracie";
</cfscript>
<cffunction name="getBar" access="remote"
returntype="string">
<cfreturn variables.bar>
</cffunction>
</cfcomponent>
complex.cfc
<cfcomponent>
<cfproperty name="anObj" type="basic">
<cfscript>
variables.anObj = createObject("component","basic");
</cfscript>
<cffunction name="getObj" access="remote"
returntype="basic">
<cfreturn variables.anObj>
</cffunction>
</cfcomponent>
index.cfm
<cfscript>
complexComp = createObject("component","complex");
</cfscript>
<cfdump var="#basicComp#" expand="no">
<dl>
<dt>complexComp.getObj()</dt>
<dd><cfdump
var="#complexComp.getObj()#"></dd>
<dt>complexComp.getObj().foo</dt><
dd>#complexComp.getObj().foo#</dd>
<dt>complexComp.getObj().getBar()</dt>
<dd>#complexComp.getObj().getBar()#</dd>
</dl> -
I used DWCS4 to install a flash swf animation into a asp
page. (I have html pages on the site the swf plays no problem.) I
recieved the following error.
Active Server Pages error 'ASP 0139'
Nested Object
/index.asp, line 86
An object tag cannot be placed inside another object tag.
----->below is the source code that was genereated by CS4
when I installed the swf <-----------
<object id="FlashID"
classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="800"
height="80">
<param name="movie" value="rdslogo2.swf">
<param name="quality" value="high">
<param name="wmode" value="opaque">
<param name="swfversion" value="9.0.45.0">
<!-- This param tag prompts users with Flash Player 6.0
r65 and higher to download the latest version of Flash Player.
Delete it if you don’t want users to see the prompt. -->
<param name="expressinstall"
value="../Scripts/expressInstall.swf">
<!-- Next object tag is for non-IE browsers. So hide it
from IE using IECC. -->
<!--[if !IE]>-->
<object type="application/x-shockwave-flash"
data="rdslogo2.swf" width="800" height="80">
<!--<![endif]-->
<param name="quality" value="high">
<param name="wmode" value="opaque">
<param name="swfversion" value="9.0.45.0">
<param name="expressinstall"
value="../Scripts/expressInstall.swf">
<!-- The browser displays the following alternative
content for users with Flash Player 6.0 and older. -->
<div>
<h4>Content on this page requires a newer version of
Adobe Flash Player.</h4>
<p><a href="
http://www.adobe.com/go/getflashplayer"><img
src="
http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif"
alt="Get Adobe Flash player" width="112" height="33"
/></a></p>
</div>
<!--[if !IE]>-->
</object>
<!--<![endif]-->
</object>
Does anyone know how to correct this problem?Found the answer here:
http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?forumid=12&catid=189&threadid =1419395&enterthread=y
I was inserting the .swf into an .html page with my IIS
server set to read .html pages as .asp.
CS4 puts in different code for asp pages compared to html
pages.
Rich -
Hi,
OTT generates code as
streamOCCI_.setObject(obj);
when one define a nested object (not REF) e.g
CREATE TYPE inside_t (f1 NUMBER)
CREATE TYPE outside_t (id NUMBER, insider inside_t)
The problem I am seeing is that when I instantiate a persistent object of outside_t in a c++ app and assign the result to a Ref<>
Ref<outside_t> o = new(conn, "OUTSIDERS_V") outside_t;
where OUTSIDERS_V is an object view over a traditional relational table of the form
CREATE TABLE outsiders (id NUMBER, f1 NUMBER) and
CREATE VIEW outsiders_v OF outside_t ... AS SELECT id,inside_t(f1) FROM outsiders
it core-dumps on the setObject as the writeSQL is called upon the new but i don't have any value for inside_t yet and could want it to remain NULL for the lifetime of the object. Is it possible to achieve this without using REFs ?Unfortunately, AMF serialization is something of a black art. I'd run into multiple issues in the past (working with Granite DS, rather than Blaze--but it's essentially the same thing). I'm not sure about Blaze, but Granite has very verbose logging available if you configure log4j to DEBUG level for org.granite. The other alternative is to attach to your Java process with a debugger (Eclipse makes this fairly automagical), download the Blaze source and configure Blaze as a project in Eclipse, add it to source lookup for your project, and step through the actual serialization to see what's going on. This is moderately complicated to set up, but priceless when it comes to debugging.
-
Is there some way (script / plugin?) to auto nest objects on page?
In other words, to place all objects as tight as possible to eachother.@Meate
Our rip software (Wasatch Softrip) uses rectangles too. In most cases this is good enough (and allow easy cutting), but some cases where cutting isn't needed, tighter fitting would be helpful if available. See simple example in attachment.
But like i said, i was just checking if some script existed already. If not, it's not worth writing one for the rare occasions it would be helpful. -
How to send nested object collection to PL/SQL Procedure as an Input param
How to send nested object collection to PL/SQL Procedure as an Input parameter.
The scenario is there is a parent mapping object containing a collection(java.sql.Array) of child objects.
I need to send the parent object collection to PL/SQL procedure as a input parameter.
public class parent{
String attr1;
String attr2;
Child[] attr3;
public class Child{
String attr1;
SubChild[] attr2;
public class SubChild{
String attr1;
Urgent!!!
Edited by: javiost on Apr 30, 2008 2:09 AMjaviost wrote:
How to send nested object collection to PL/SQL Procedure as an Input parameter.There are a few ways to do this, all of which likely depend on the particular database you're using.
Urgent!!!Not to me... -
How to bind bar chart(columns) to array list object in c# win form
how to bind bar chart(columns) to array list object in c#win form
Hi Ramesh,
Did you want to bind list object to bar chart? I made a simple code to achieve binding list to bar chart.
public partial class Form0210 : Form
public Form0210()
InitializeComponent();
private void Form0210_Load(object sender, EventArgs e)
BindData();
public void BindData()
List<int> yValues = new List<int>(new int[] { 20, 30, 10, 90, 50 });
List<string> xValues = new List<string>(new string[] { "1:00", "2:00", "3:00", "4:00", "5:00" });
chart1.Series[0].Points.DataBindXY(xValues, yValues);
The links below might be useful to you:
# Data Binding Microsoft Chart Control
http://blogs.msdn.com/b/alexgor/archive/2009/02/21/data-binding-ms-chart-control.aspx
# Series and Data Points (Chart Controls)
https://msdn.microsoft.com/en-us/library/vstudio/dd456769(v=vs.100).aspx
In addition, if I misunderstood you, please share us more information about your issue.
Best Regards,
Edward
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click HERE to participate the survey. -
Nested object assignment to super type object
Can anybody explain how objects, which are nested as attributes into other object and have type hierarchy, are assigned?
Let view the following type hierarchy
create or replace type OT_A as object (
num number
) NOT FINAL;
create or replace type OT_A1 under OT_A (
num1 number
In the next PL/SQL code I assign objects which are in type hierarchy:
declare
v_a OT_A;
v_a1 OT_A1;
begin
v_a1 := OT_A1 (1,2);
v_a := v_a1;
dbms_output.put_line (v_a.num);
end;
After executing the fragment, '1' will be printed.
Let now add a new type
create or replace type OT_B as object (
a1 OT_A1
In the next PL/SQL code I will try to assign attribute (which is nested object) to its super type.
declare
v_a OT_A;
v_a1 OT_A1;
v_b OT_B;
begin
v_a1 := OT_A1 (1,2);
v_b := OT_B (v_a1);
v_a := v_b.a1;
dbms_output.put_line (v_a.num);
end;
After executing the fragment, nothing will be printed. Variable v_a will not contain valid num attribute.
Do I do something wrong or I can't do something like this at all?
Oracle version: Oracle9i Enterprise Edition Release 9.2.0.2.0 - 64bit Production
OS: HP-UXElena,
This looks like a bug. Do you have an Oracle customer id to file a TAR at http://metalink.oracle.com?
Regards,
Geoff
Maybe you are looking for
-
Additional Files in Sender File Adapter
Hi I have to collect 2 files (IN.txt, IS.txt) and attach 2 files as an attachment to mail. So I opted Additional Files in Sender File Adapter Source Directory = D:\usr\sap\pitest\LoadTest\Output\Invoice File Name = IN.TXT Additional Files File List <
-
Please help me with this etrecheck report!
Please help me understand this report. Note: I've noticed that it has taken me longer to login after installing Yosemite. My computer has frozen a few times already and has shut itself down once or twice..also I have this annoying pop-up "To view thi
-
Why won't my iPhone 4 automatically connect to my ipad mini when they come in contact? It will if I turn the ipad hotspot off then back on again
-
OpenSSL version mismatch.
Hello, I am getting the error message "OpenSSL version mismatch. Built against 90702f, you have 90801f." when I try to use the SSH client or when I try to connect remotely using putty w/ SSL. I am running 10.3.9 with all the latest updates from Apple
-
What is the best way of charging?
Hello 1-I ve read that it's better to charge the battery around 50 % , it means that for example if it discarges to 10 % then it's better to plug in , and leave it is charged up to around 50 %? 2-Is better to discharge fully (0 %) once in a month an