This discussion is archived
1 Reply Latest reply: Nov 21, 2003 10:33 AM by 55663 RSS

Data Binding in ADF UIX example trouble

173440 Newbie
Currently Being Moderated
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=""
text="${}"/>The example has one small change. The value is changed to ${}, 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="">

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"/>
<text text="${}"/>

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=""
xmlns:html="" expressionLanguage="el">
<dataScope xmlns="">
<!-- start Add DataProviders (<data> elements) here -->
<data name="currentDate">
<method class="" method="getTime()"/>
<!-- end Add DataProviders (<data> elements) here -->
<text text="${}"/>
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
  • 1. Re: Data Binding in ADF UIX example trouble
    55663 Newbie
    Currently Being Moderated
    for question 1 the name of the class CurrentDateBean
    actually has nothing to do with the el expression 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"
    so if you changed the name of the data provider to "foo":
    <data name="foo">
    <method class="yourpackage.DataDemo"

    your el would look like this:
    by the way the 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 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 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.