ADF UIX programatic data binding
Oracle ADF UIX Developer's Guide mentions the possibility to use the UIX framework in Java, to create new objects or alter the existing ones.
E.g. we can create a table using a construct like:
TableLayoutBean tlb = new TableLayoutBean();
The same document demonstrates the data binding:
BoundValue rows = new DataBoundValue(_YOUR_NAMESPACE, YOURNAME, "rows");
tlb.setIndexedNodeList(new DataObjectListNodeList(rows));
For "simple" attributes using DataObject DataObjectList, etc. the procedure is clear. But what about creating a data bound table or input text:
<table model="${bindings.EmpView1}" ... >
<messageTextInput model="${bindings.DeptCode}"/>
Itâs easy to understand that model="${bindings.EmpView1}" or model="${bindings.DeptCode}" are equivalent to multiple attribute bindings (data, validation, read-only, etc.), but it looks that the classes/methods resolving these equivalences and linking the bean to the corresponding DCControlBinding, are not public (or maybe I was not able to find them).
How can we obtain programmatically, in Java, the same structure as described above (in XML)? The best would be to use the same classes used when the UIX XML document is parsed to create the page description.
It would be very nice to be able to use a structure like
tbl.setModel( new JUCtrlRangeBinding(...) );
txt.setModel( new JUCtrlValueBinding(...) );
or maybe
txt.setAttribute( "model", new TextInputModelBoundValue(...) ) etc.
In JSF we can do something like:
ValueBinding vb = application.createValueBinding(value);
component.setValueBinding(attributeName, vb);
Can we do something similar in UIX?
Any help will be appreciated,
thanks,
Mircea Ionita
Since the code is already written, it's a pity that we can't use/extend it. I don't like to say it (sorry) but I find this design choice (implement the "model" only into the XML parsing layer) a little bit strange (or maybe I don't understand... ;-) ). We should (or we are supposed to) be able to do in java everything that we can do in XML.
I would like to find more support/help for the programmatic approach. I have the feeling that you are too focalised on "use-our-state-of-the-art-tools/wizards-to-write-the-code-for-you" and you forgot that this is not suitable for all projects. E.g. our application creates the user interface according to a layout defined by each user. To generate it, we need to use at maximum the extension mechanism and we can't simply relay on "rendered" attribute etc.
-When should we expect this new UIX release?
-What about the UIX controller? The Struts controller will replace it?
-What about the source code of uixexp2-demo.jar (distributed with ADF_UIX_component_guide)?
-Why while debugging we can't set a method/class breakpoint on UIX classes (to understand the data flow) - the stack is secret?
Thanks
Similar Messages
-
Adf uix, removing date picker
I am working (with jdev 10.1.2) to an adf uix project. In some messagedatefield the date picker is not useful, and I donât want the user to try to use it. How can I remove it?
Thanks in advance, MauroYou can use the messageTextInput with a onSubmitValidator
<onSubmitValidater>
<date dateStyle="short"/>
</onSubmitValidater>
This will validate that the input is of the short date format.
Jeanne -
Data Binding in ADF UIX example trouble
Two related questions:
From the help example 3. Data Binding in ADF UIX example trouble in JDeveloper on UIX. If this worked I was going to run a small java class that captures the login and passes it as a messagebox with a Welcome login name on the first page, but I can't get past the example and path problems.
From the example..."
package yourpackage;
import java.util.Date;
public class CurrentDateBean
public CurrentDateBean() { }
public String getTime()
return (new Date()).toString();
Now, we want to change the page so it uses getTime(). We need to do three things: Tell UIX to data bind the text attribute. Add a <dataScope> to the page to provide data to the content. Write a small "data provider" in Java that can access the bean. First, we'll data bind "text": <text xmlns="http://xmlns.oracle.com/uix/ui"
text="${uix.data.currentDate.time}"/>The example has one small change. The value is changed to ${uix.data.currentDate.time}, which is an expression that defines the data. This is shorthand for "get the time property from currentDate." If you tried running this example, you'd see nothing. That iss because we haven't given currentDate to the page, so the databinding failed, and the "text" is left to null. We do this by adding <dataScope> to the page: <dataScope xmlns="http://xmlns.oracle.com/uix/ui">
<provider>
Q#1?? Trying to follow the demo. The method class and method name do not seem to match the names in the above class from the demo. Am I missing a point here, please help.
<data name="currentDate">
<method class="yourpackage.DataDemo" method="getCurrentDate"/>
</data>
</provider>
<contents>
<text text="${uix.data.currentDate.time}"/>
</contents>
</dataScope>
Q#2?? When I try and apply the demo class to my home.uix XML file with
"<?xml version = '1.0' encoding = 'windows-1252'?>
<page xmlns="http://xmlns.oracle.com/uix/controller"
xmlns:ui="http://xmlns.oracle.com/uix/ui"
xmlns:data="http://xmlns.oracle.com/uix/ui"
xmlns:ctrl="http://xmlns.oracle.com/uix/controller"
xmlns:html="http://www.w3.org/TR/REC-html40" expressionLanguage="el">
<content>
<dataScope xmlns="http://xmlns.oracle.com/uix/ui">
<provider>
<!-- start Add DataProviders (<data> elements) here -->
<data name="currentDate">
<method class="us.mn.state.dot.apptrack.security.CurrentDateBean" method="getTime()"/>
</data>
<!-- end Add DataProviders (<data> elements) here -->
</provider>
<contents>
<text text="${uix.data.currentDate.time}"/>
<document>
<metaContainer>"
I get the following, and I don't know how to make the UIX XML accept the correct path, please help:
�file:/C:/JDeveloper905p/jdev/mywork/ProjTrack/AppTrack/ViewController/public_html/home.uix: Parsing error, line 12, column 97: Could not find class us.mn.state.dot.apptrack.security.CurrentDateBeanfor question 1 the name of the class CurrentDateBean
actually has nothing to do with the el expression
uix.data.currentDate.time. The currentDate part of the
el expression is coming from the method data provider part
of your page:
<data name="currentDate">
<method class="yourpackage.DataDemo"
method="getCurrentDate"/>
</data>
so if you changed the name of the data provider to "foo":
<data name="foo">
<method class="yourpackage.DataDemo"
method="getCurrentDate"/>
</data>
your el would look like this:
uix.data.foo.time
by the way the uix.data part tells UIX to look for
a <data> element define in the <provider> section of
your dataScope.
For question #2, do you have the java file
us.mn.state.dot.apptrack.security.CurrentDateBean on
your classpath and is it compiled? You will get that
warning if it is not on your classpath.
Also you are incorrectly interpreting the example. What
you are doing is trying to reference the actual bean
object and its getTime() method. What you want to do
is write a method data provider that returns your
CurrentDataBean. so uix.data.currentDate would return
a CurrentDateBean instance object. the .time part of the
el expression would tell UIX to look for a method named
getTime() and use that value.
let me know if you have any more questions. -
ADF UIX with ADF Binding without Struts
After trying the CRUD tutorial from the "Complete ADF UIX Application (Browse, Create, Update, Delete)" -(http://otn.oracle.com/products/jdev/collateral/tutorials/9050/adfuix_tut.html), I found it may be thousands of struts actions in my upcoming project.
It will be difficult to merge and sync my team members works and the usefulness of StrutsPageFlow diagram will decrease severely although it is very convenient to drag data control operations to struts data actions without coding.
I am trying to use ADF Controller event handler as my page flow engine to eliminate these drawbacks.
When I use ADF controller as my page flow engine, if I have to pass ui model reference, initialize binding container, get binding container, get application module and refresh binding container, ... manually in my event handler codes just like the BasicDataAction class does in "ADF data binding primer (http://www.geocities.com/smuench/adfprimer/)"?
Is there any document that cover this information or any suggestions?
DanielADF Controller questions should be posted in the JDeveloper forum.
-
ADF UIX: How to define a binding's subtype?
In an ADF-UIX project, we have deleted a binding which had been automatically created by a drag and drop operation that generated a multirecord master-detail form.
When we try to recreate the binding using the binding editor (in application navigator, mouse right click and select the ...UIModel.xml file -> Create Binding), we choose to create a binding of type "range" (since the icon is of the same type than the icons for bindings generated automatically for a multirecord detail), however we get a binding of subtype "DCTable" instead of a "DCHGrid". There doesn't seem to be any way to create a "DCHGrid" binding and the UIModel.xml file is not editable.
The problem is that the DCTable doesn't render properly when the UIX form is run.
Any suggestions?The reason for deleting it was because the Data Binding is not always correclty refreshed after a column is added to the underlying VO. Initially we thought it would be necessary to recreate the binding, but using the drag & drop method would have been costly as the form was complex and a lot had been modified after the initial drag & drop operation.
The case where the refresh on the binding is not made is when the binding is displaying all the attributes available within the iterator. Surprisingly, if the binding is only using a subset of the attributes of the iterator, then a new attribute on the underlying VO is immediately displayed. -
Manual Data binding with ADF table?
Hi,
I am making a stored procedure call for fetching data from database on the click of action button. My query has a where clause in it. I am not able to bind my adf table manually with my data control. Can anyone provide me some link for binding my ADF table with data control manually? My requirement is like : - I have one table in which I am displaying data in ADF table. I want to display data in another table on click of some id in the coulmn of first table.You basically have two options - you can choose to use ADF Binding - and have your Java class return a collection - then you just right click the class to expose it as an ADF Data control.
Or if you rather not use ADF Binding, then you'll need to have a managed bean that returns a collection and you can use "regular" JSF binding to bind the table to it.
The second option is shown in the ADF Faces Components demo: http://www.oracle.com/technology/products/adf/adffaces/11/doc/demo/adf_faces_rc_demo.html -
Binding Editors not present in ADF UIX
Hi
I have been having some trouble with accessing both the Boolean Binding Editor and the LOV Editor from the structure window, when in design mode of an ADF UIX page.
My bindings are present, but when I 'Edit' the binding, the only option available to me is to select the Iterator and the attribute.
The documentation keeps telling me to select different tabs, but there aren't any!
Anyone had this problem????
I'm on;
Oracle IDE 9.0.5.16.27
Business Components Version 9.0.5.16.0
UML Modelers Version 9.0.5.14.78
Versioning Support 9.0.5.14.78
WebDAV Support Version 9.0.5.14.78
Struts Modeler Version 9.0.5.4.22
Designer Generators Framework 9.0.5.5.71
ADF UIX 2.2.8
java.version 1.4.2
java.home C:\j2sdk1.4.2_04\jre
java.vm.name Java HotSpot(TM) Client VM
java.vm.vendor Sun Microsystems Inc.
java.vm.version 1.4.2-b28
user.language en
user.region <no value assigned>
user.name chris.bell
user.home C:\Documents and Settings\chris.bell
user.dir C:\Software\Oracle\jdev9052\jdev\bin
os.name Windows XP
os.version 5.1
os.arch x86
http.proxyHost <no value assigned>
http.proxyPort <no value assigned>
http.nonProxyHosts <no value assigned>
ide.patches
Thanks in advance
Christhe primaryclient action should pass the rowkey of the current row (${uix.current.rowKeyStr}) as a parameter. This way the server can find the corresponding row on the server in an event handler.
see
http://www.oracle.com/technology/products/jdev/tips/jacobi/edittable/tip_adfuixtable_edit.html -
JDev 10.1.2 / ADF UIX: Approach to render data in levels/groups
Hi guys, I'm looking for ideas on how to use ADF (UIX and BO) to render (and let the user work with) a structure of 3 tables which have a parent->child->child-of-the-child relationship.
The need is to show a table with the parent in one row and below of it all its children and below of each children its own children. Also, the lowest level rows have numeric data which have to be summarized by the parent and so on upwards; and the lowest level rows should be selectable for edition in another page, and after edition return to the table.
Is the recommended approach to use the hGrid to do this?
Or should I use plain JSP and customized tags to achieve this (for easiness)?
Are there any other options?Solved it!! :-)
In the UIX page I check for the proxy in the event result, if it is there I take it, otherwise I take it from bindingcontext. Is this the right way to do it? Here is the UIX code:
<hGrid id="pptoHGrid" alternateText="No items were found"
treeData="${bindings.bindingContext['tree']}">
<boundAttribute name="proxy">
<if>
<comparison type="equals">
<null/>
<dataObject default="${uix.eventResult.hGridProxy}"/>
</comparison>
<dataObject default="${bindings.bindingContext['hGridProxy']}"/>
<dataObject default="${uix.eventResult.hGridProxy}"/>
</if>
</boundAttribute>Greets,
Fernando -
Binding LinkedList to ADF Web Service Data Control
Hi guys,
I would like to ask about how to bind a LinkedList (consumed from webservice) to ADF web service data control, in order to display it in JSF page. This LinkedList contains java beans that hold information I need. I've tried to ask google and search this forum, but still got no luck.
<p>
Yes I found article about dealing with complex input params, but seems not what I'm looking for.
<p>
Anybody has hint or idea on this ?
<p>
ThanksTake a look at this blog entry from Susan Duncan: Dealing with Complex Input Params in ADF Web Service Data Controls.
It looks like what you are asking for.
Hope it helps,
-Eric -
New to UIX : Need help in data binding
I am new to UIX. I am using jDeveloper 9.0.5.2 (ADF UIX version is 2.2.8). I need to create a simple table with one column with checkbox, one column with input field and 2 columns from database query. How should I go about it ?
I went through some tutorial but it's not helping me much. Can you point me to some examples / Tutorials which can help me to move further.
Thanks in Advance.
Sid.Hi Sid,
you can do all that you are wanting to do using UIX and ADF but it's not as straight forward as dragging components from the data control palette. You have to write a bit of code in the source viewer in the UIX page.
Refer to this document to create an editable table:
http://www.oracle.com/technology/products/jdev/tips/jacobi/edittable/tip_adfuixtable_edit.html
also read forum post: question regarding ADF UIX editable tables
this document shows you how to do LOV's:
http://www.oracle.com/technology/products/jdev/howtos/10g/adf_uix_lov_ht/index.html
once you have the editable table working properly, you can add LOV code and other components to the selected column of the table. I suggest that you get the editable table working properly before trying to add lovs and checkboxes etc..
another simpler option would be a read-only table with a link to an edit page containing an input form (for the same data control) without navigation. the input form could be on the same page as the read-only table, or a different page.
regards,
Brenden -
How to handle html:multibox in jsp with ADF Data Binding
Hi,
I like to use html:multibox feature in my jsp with ADF Data Binding. I am able to retrieve checked values in the DataForwardAction form. However, when the page is refreshed, the checkboxes are not persistent and yet an error showing
"JBO-25009: unable to create object type ....oracle.jbo.domain.Array" appears.
Here is my jsp code:
<c:forEach var="type" items="${bindings.SystemTypeView1.rangeSet}">
<c:if test="${Row['SystemGroup'] == type['SystemGroup']}">
<br>
<html:multibox property="selectedSystemType">
<c:out value="${type.SystemType}"/>
</html:multibox>
<c:out value="${type.TypeDesc}"/>
</c:if>
</c:forEach>
Can anyone tell me how to handle html:multibox with ADF Data Binding and make the checkboxes persistent.Generally this can be done.
I see a problem with your use case, which has nothing to do with jdev or java:
How do you identify the user when he comes back to finish the form?
For this you can't use information like session cookie or IP address because they change.
So you have to save some information about the user which lets you identify him when he comes back. All other requirements can be implemented by ADF.
Timo -
Help: Data binding using uix:choice
I have a uix jsp page with the following code snippets (trying to make a simple drop down list):
<jbo:DataSource id="ds2" appid="PubModuleDef" viewobject="PubModule.FOAOIDGroupsVO" />
and further down:
<uix:choice>
<uix:contents>
<jbo:RowsetIterate datasource="ds2">
<uix:option text="<%= ds2.getRowSet().getCurrentRow().getAttribute(\"Name\") %>" />
</jbo:RowsetIterate>
</uix:contents>
</uix:choice>
I am looking for a more elegant way to do this. Particularly I would like to eliminate the <%= ... %> code but I simply have not been able to figure out how to use Data Binding...
Any advice?
ClausHi Matthias,
I hope this is what you are looking for:
http://help.sap.com/saphelp_erp2004/helpdata/en/fb/fbb84c20df274aa52a0b0833769057/frameset.htm
Regards,
Rainer -
I set up a UIX drop down data binding field on my application which works great, now I need to make the list sorted but i do not know where and how to do this. Does anyone know?
You've got to use the BC4J bindings; or build a bean, or a
DataObjectList which present your data. Take a look at the BC4J chapter
of the Developer's Guide. -
Help for ADF data binding with MySQL BLOB type.
Hi,
I have a blob column called photo for table person in my MySQL database, with ADF, I want to bind this column with a JUImage control, but when I drag the column attribute from the data control palete as a JUImage, an error dialog appears, it says:
Control cannot be bound to that Attribute.
This control should be bound to an Attribute whose Java type is one of the following
oracle.ord.im.OrdImageDomain
oracle.jbo.domain.BlobDomain
oracle.jbo.domain.Raw
What should I do ?
Thanks.Hi,
Are you using BC4J as the persistence layer? If you use your own persistence (e.g. a bean) then you need to make sure the datatype of the atribute is defined as one of the three mentioned in your question.
Frank -
ADF UIX page displays data which is not in database
Using JDeveloper 10.1.2, I created an ADF UIX browse page. It worked correctly, showing all 200 rows that were in the database table. I then used JDev SQLWorksheet to delete 190 rows, so 10 rows remain. Now when I test the browse page, it still shows all 200 rows rather than the 10 rows which are in the table. I exited and restarted the application but the problem persists. Help.
Did you perform commit command from SQLWorksheet?
If not, perform it!
Maybe you are looking for
-
When I updated to iOS 8.3 I lost all shared photo albums on my iPad Air. Other devises which I shared to still have access to photo albums but my iPad does not, therefore I can no longer add or delete to shared albums. I can create new shared albums.
-
Setting up failover in an RV042 V3
I have a new (about 4 months old) RV042 V3 4.0.0.07 firmware that I am trying to use in failover mode. I have a SOHO and I normally use cable Internet connection. It is quite fast (15 megabit), but not super reliable. I have added DSL (3.3 megabit
-
Exporting / Importing Playlists
I have a bunch of playlists on my IPOD. If I decide to wipe the IPOD clean and bring back all my music onto it, how can I bring my playlists back in without having to redo it all? Thanks for the help
-
When I export into an external editor (PSE 9), make a few edits and save back to Aperture 3 I see the version, but it is unchanged except that because of my export pre-set it is now a tiff file. I export with the preset of tiff (8bit) 300dpi. Why, an
-
Changing facebook account in iphoto
posted to facebook from iphoto, saved my login info. How do I change/add another login to a different facebook account?