Value and binding attributes?

In a number of UIComponents there is a value and a binding attribute. What is the difference between these attributes and when should one be used vs. the other?

The "binding" attribute is used to bind the tag to a related instance of a component on a backing managed bean.
For example, if you had created an instance of HtmlPanelGrid (called "grid") on a backing bean and had a getter/setter method for that component (getGrid/setGrid), you would use "binding={managedBean.grid}" to tie the <h:panelGrid> tag to the backing instance of component.
The "value" tag is used to assign a value to the component. This may be a String for some components (i.e. outputText) or a List (i.e. dataTable)
The simplest example would be:
<h:outputText value="Hello world!"/>
The preceding tag would render text of "Hello World!"
However... if you were to use binding for that... in your managed bean:
private HtmlOutputText text = new HtmlOutputText();
text.setValue("Hello world!");
public void setText(HtmlOutputText t) {
this.text = t;
public HtmlOutputText getText() {
return text;
Then on the JSP:
<h:outputText binding="#{managedBean.text}"/>
Regards.

Similar Messages

  • Regarding Value and Binding properties of af:inputTextBox

    Hi All,
    I am using JDeveloper 11.1.1.6.0. I want to set the value for af:inputTextBox from the backing bean.
    I observed there are two properties for this component, 'Value' and 'binding'.
    So, I thought of using 'Value' property. For this I created a property in my backing bean.
    Number textBoxValue; //Setter and getter methods for this ( I want to display numbers ans persist the same thats whay i have given as Number)
    and in one of my methods I had given,
    textBoxValue = new Number(12);
    I am able to display the value in the UI
    Here goes my queries, please clarify these.
    1) What is the need of these two properties?
    2) How can set value using the 'Binding' Property.
    3) Can I set value to the input using both properties?
    4) If 2nd point is correct then what will happen, if I set two different values to the textbox using these two components.
    Thanks & Regards,
    Ravi.

    1) Binding is uses as an EL reference that will store the component instance on a bean. This can be used to give programmatic access to a component from a backing bean, or to move creation of the component to a backing bean.
    Value represents the value of the component. If the EL binding for the "value" points to a bean property with a getter but no setter, and this is an editable component, the component will be rendered in read-only mode.
    So they are different.
    2) You don't
    3) You don't
    4) as 2) in not correct this is not relevant
    If you want to set the value of a ui component from inside a bean you have different possible solutions. Lets assume you have a binding for The component to bean. In case of a input text the bean property would be of type RichInputText. Lets the property name be myIPT. Then you set the value as myIPT.setValue("YOUR VALUE"); (if the component shows text).
    If you have bound the value property of the component to a bean attribute (using EL) you only need the change the bean attribute.
    If the value is bound to a value binding (e.g. one that was generated by dragging a VO onto the page and dropping it as form), you get the the value binding by
    // GET A METHOD FROM PAGEDEF AND EXECUTE IT
    // get the binding container
    BindingContainer bindings = BindingContext.getCurrent().getCurrentBindingsEntry();
    // get an ADF attributevalue from the ADF page definitions
    AttributeBinding attr = (AttributeBinding)bindings.getControlBinding("NAME_OF_THE_ATTRIBUT");
    attr.setInputValue("test");Timo

  • Difference between value and binding ?

    hello
    I am afraid I am not clear on difference between value and binding of a component?
    I will appreciate if you supply an explanation.
    kind regards

    Binding? Aren't you talking about JSF? That term doesn't occur in JSP world.

  • Problem with h:dataTable and binding attribute

    I am new to JSF and I have a problem using the binding attribute of h:dataTable.
    I can successfully use the value attribute to display rows of data fetched from an Oracle database into h:dataTable, but I do know how to bind a h:dataTable to a server object which I would use to update the changes made in the h:dataTable.
    Can some body show me an example how to do so ?
    Thanks in advance.

    I'm not sure whether i understand your problem,
    It doesnot need using the binding attribute If you wanna updating the value of each rows in the datatable.
    below is a sample that updating each rows of a datatable
    jsp file
    <h:dataTable value="#[sampleBean.data}" var="row">
        <h:column><h:inputText value="#{row.col1}"/></h:column>
    </h:dataTable>
    <h:commandButton value="update" action="#{sampleBean.update}"/>BackingBean:
    SampleBean.java
    public class Samplebean{
      private SampleRow[] rows[];
      public SampleRow[] getData{
              return rows;
      public String update(){
          for(int i=0; i<rows.length; i++){
             rows.update();
    return "success";
    SampleRow.java
    public class SampleRow{
      private String col1;
      public String getCol1(){
        return col1;
      public void setCol1(String col1){
        this.col1 = col1;
      public void update(){
         //write your code to save one row data to db/file here

  • Use VO to get DB value and set attribute

    Hi,
    I am working a page to create new order. I need some information populate. This is my code, which somehow not work
    public void createOrder() //(String[] args)
    OAViewObject vo = (OAViewObject)getxxMobileOrderVO1();
    if (!vo.isPreparedForExecution())
    vo.executeQuery();
    Row row = vo.createRow();
    vo.insertRow(row);
    row.setNewRowState(Row.STATUS_INITIALIZED);
    // Populate support information
    xxMobileSupportVOImpl sptVo = (xxMobileSupportVOImpl)getxxMobileSupportVO1();
    if (sptVo == null)
    MessageToken[] errTokens = {new MessageToken("OBJECT_NAME", "xxMobileSupportVO1")};
    throw new OAException("PER", "XXBOL_OAF_OBJECT_NOT_FOUND", errTokens);
    sptVo.initSupport();
    Row sptRow = sptVo.getCurrentRow();
    if (sptRow != null) {
    row.setAttribute("SupportPersonId", sptRow.getAttribute("PersonId"));
    row.setAttribute("SptName", sptRow.getAttribute("FullName"));
    row.setAttribute("SptEmail", sptRow.getAttribute("EmailAddress"));
    The VO xxMobileSupportVO is a simple select returns one records:
    SELECT ppx.person_id
    , ppx.employee_number
    , ppx.full_name
    , ppx.email_address
    --, lk.tag
    FROM fnd_lookup_values lk
    , per_people_x ppx
    WHERE lk.lookup_type = 'XXXX'
    AND lk.lookup_code = ppx.employee_number
    AND lk.enabled_flag = 'Y'
    AND lk.LANGUAGE = USERENV('LANG')
    AND lk.tag =
    ( SELECT MAX(NVL(tag, 0))
    FROM fnd_lookup_values
    WHERE lookup_type = 'XXXX'
    AND TRUNC(SYSDATE) BETWEEN lk.start_date_active
    AND NVL(lk.end_date_active, hr_general.END_OF_TIME)
    The VO is correctly attached to AM. I use Test feature to be sure it does get value.
    However, when the page is opened and createOrder method is called. The field does not get value populated.
    Does anyone can tell what is the issue?
    Thanks in advance.
    Rudoph

    Are you executing the VO query?
    I suppose you are executing it in sptVo.initSupport();
    If not first execute the VO using sptVo.executeQuery()
    After executing the query, do sptVO.first().
    This will give you the row of the VO.
    Then do your work based on that.
    Regards,
    Peddi.

  • Value or binding, best practice.

    I was using a lot of value attribute before. Played with Sun Creator lately and realized that it is using binding very heavily.
    What's the best practice to use value and binding?
    To use binding, it's more like Java Swing. You can access the UI Component inside the page bean. To use value, the user input is converted to the right type by the framework, which is very convenient.
    thanks.

    Note that you can use both at the same time.
    I think that if you're comfortable with the concept of coding a "model" for your data - instead of just, say, writing JDBC calls - then the best practice is to use "value", and use "binding" only where you need to specifically access the component for component-ish things. This'll keep your model cleanly isolated from your view, generally considered a good thing.
    But if you've got a strong personal preference for just talking to APIs like JDBC directly, and don't want the extra abstraction of a model layer, then by all means use "binding". Sun's JS Creator is targetted at that sort of developer.
    Hope this helps.
    -- Adam Winer (EG member)

  • What is binding attribute of inputtextfield.

    hi,
    what is the binding attribute in jsf.
    how can we call a valueChange method from this binding method in managed bean.
    can we use both value attribute and binding attribute for one textfield.I used both.
    the value attribute is pointing the managed bean property which of string type.and binding attribute is pointing to a property of HtmlInputText .I wrote setter and getter for that HtmlInputText field.how to use the getValueChangeListener method on this HtmlInputText.

    This article might give new insights: http://balusc.xs4all.nl/srv/dev-jep-djl.html

  • Database growing and weird attributes appearing

    Hello.
    Our SunOne 5.2 DS database is expanding.
    I ran an Export Database task from console and I see attributes like:
    modifyTimestamp;adcsn-43218888000000020002;vucsn-43218888000000020002: 2005090
    9130000Z
    modifiersName;adcsn-43218888000000020001;vucsn-43218888000000020001: cn=direct
    ory manager
    certificateRevocationList;adcsn-43218888000000020000;vucsn-43218888000000020000::
    certificateRevocationList;vucsn-431857af000000010000;deleted::
    certificateRevocationList;vucsn-431873cf000000010000;deleted::
    objectClass;vucsn-42f9bf16000000010000: top
    objectClass;vucsn-42f9bf16000000010000: pkiCA
    objectClass;vucsn-42f9bf16000000010000: cRLDistributionPoint
    cn;vucsn-42f9bf16000000010000;mdcsn-42f9bf16000000010000: PV CA
    creatorsName;vucsn-42f9bf16000000010000: cn=directory manager
    createTimestamp;vucsn-42f9bf16000000010000: 20050810084209Z
    nsUniqueId: 856ca182-1dd211b2-803cf017-d10f91b5
    I have never seen names like these before.
    But where might they be coming from. Apart from the PKI schema, this is a plain vanilla Directory server install on Solaris.
    What worries me is the ;deleted attributes as they are filling up the database... how can they be removed automatically? (and why arent they?)
    Any hints welcomed.

    In a single-server scenario you will never have the old values and deleted attributes. Once you activate replication, the server starts keeping those values for as long as the changelog maxage (this aids in being able to restore other servers from backup or who were done for some period of time). Unfortunately the changelog maxage defaults to unlimited, so entries can grow very big, especially if there are multi-valued attributes.
    I recommend that sites should consider setting
    nsslapd-changelogmaxage under cn=changelog5,cn=config
    to somewhere from 4-7 days depending on your space/recovery needs.
    You will need to export/import if you want to reduce your database size.
    Hello.
    Our SunOne 5.2 DS database is expanding.
    I ran an Export Database task from console and I see
    attributes like:
    modifyTimestamp;adcsn-43218888000000020002;vucsn-43218
    888000000020002: 2005090
    9130000Z
    modifiersName;adcsn-43218888000000020001;vucsn-4321888
    8000000020001: cn=direct
    ory manager
    certificateRevocationList;adcsn-43218888000000020000;v
    ucsn-43218888000000020000::
    certificateRevocationList;vucsn-431857af000000010000;d
    eleted::
    certificateRevocationList;vucsn-431873cf000000010000;d
    eleted::
    objectClass;vucsn-42f9bf16000000010000: top
    objectClass;vucsn-42f9bf16000000010000: pkiCA
    objectClass;vucsn-42f9bf16000000010000:
    cRLDistributionPoint
    cn;vucsn-42f9bf16000000010000;mdcsn-42f9bf160000000100
    00: PV CA
    creatorsName;vucsn-42f9bf16000000010000: cn=directory
    manager
    createTimestamp;vucsn-42f9bf16000000010000:
    20050810084209Z
    nsUniqueId: 856ca182-1dd211b2-803cf017-d10f91b5
    I have never seen names like these before.
    But where might they be coming from. Apart from the
    PKI schema, this is a plain vanilla Directory server
    install on Solaris.
    What worries me is the ;deleted attributes as they
    are filling up the database... how can they be
    removed automatically? (and why arent they?)
    Any hints welcomed.

  • Need to add row and set attribute value on pageload

    Guys,
    On my page based on the pageflowscope variable value, i need to add a row for master and one row for detail viewobject and set attribute values. (Some of the attribute are LOV and Checkboxes as well)
    I am using following code to create records.....records are being added but i am not able to set the attributes
    OperationBinding ob;
    ob = ADFUtil.findOperationBinding("Create");
    ob.execute();
    ob = ADFUtil.findOperationBinding("CreateInsert3");
    ob.execute();
    I am using following code to set the attributes value
    DCIteratorBinding dc1 = ADFUtil.getBindingIterator("firstiterator");
    DCIteratorBinding dc = ADFUtil.getBindingIterator("seconditerator");
    row1=dc1.getCurrentRow();
    row=dc.getCurrentRow();
    row.setAttribute("activest","A");
    row1.setAttribute("type","dc14");
    Anything i am doing wrong here or any suggestion to try is greatly appreciated....

    Vinod,
    Yes commit button is there and yes its also has entry in pagedef...
    When I open the same page on edit mode and i can edit regular record and save them
    Problem is that when i open the page on new mode and try to add rows on page load..... and setting values as described above.... save button somehow doesn't work...
    seems like after i add the rows on the fly, i need to refresh the binding?
    any help is greatly appreciated....
    thank you guys

  • Binded attribute value reset in ADF BC 10.1.3.3.

    Hi,
    I have a jspx page with data from a couple of bind iterators. On one of those iterators I have an attribute AuditId I'm using when user chooses to view some data or download some file. I need this AuditId to be the same the until user leaves the page so that every part of data he sees is stored in DB with the same Id.
    I've created an transient attribute on one of the iterators with -1 the default view. When the page is opened and there exists some data that the insight into must be recorded, the AuditId is given and set to this attribute. This works fine for the data already displayed on the page, but when the user downloads some document from the page - the code is in an actionListener of the command button and on application module - the value of attribute AuditId is -1 again although the execute for that iterator was never executed (I know this since I have a custom execute method and I set a breakpoint there - it is executed only when the page opens).
    How comes that the attribute value is reset to -1 without executing the query behind the iterator's VO that has already been set to the right value.
    Before this solution I also tried putting the value to processScope and the behaviour was the same. Without resetting the value through the code the value was lost somewhere. Maybe there is a problem that I have some code in a backing bean and some on the application module? Is there some other way to store the value of this attribute without declaring it on a VO?
    Thank you in advance,
    regards!

    Dragan,
    If you are talking about iterating over VO records - have a look at the VO tuning parameters, especially if you are using range paging mode. In range paging mode, the performance of getting the next set of rows degrades as you proceed through the result set.
    John

  • Use XML Node Value as Node name and as attribute name

    im quite new to XML and XLST. I got an Open Office XML file that I transformed with XLST.
    <?xml version="1.0" encoding="UTF-8"?>
    <ooo_calc_export scriptVersion="2.2.0" scriptUpdate="2010-12-19" scriptURL="http://www.digitalimprint.com/misc/oooexport/" scriptAuthor="vjl">
       <ooo_sheet num="1" name="Blatt1">
          <ooo_row><Artikelnummer>C12-34567</Artikelnummer><ArttikelnummerAlt/><Details>AAA AAA AAA AAA</Details><Abmessungen/><Bildpfad>file:///cmyk/C12-34567.PSD</Bildpfad><EK>1234,-</EK><VK>3456,-</VK>
            </ooo_row>
          <ooo_row><Artikelnummer>C23-45678</Artikelnummer><ArttikelnummerAlt/><Details>BaB BaB BBB BBB</Details><Abmessungen/><Bildpfad>file:///cmyk/cmyk/C23-45678.PSD</Bildpfad><EK>2345,-</EK><VK>4567,-</VK>
            </ooo_row>
          <ooo_row><Artikelnummer>C34-56789</Artikelnummer><ArttikelnummerAlt/><Details>CaC CaC CaC CaC uli</Details><Abmessungen/><Bildpfad>file:///cmyk/cmyk/C34-56789.PSD</Bildpfad><EK>3456,-</EK><VK>5678,-</VK>
            </ooo_row>
       </ooo_sheet>
    </ooo_calc_export>
    I transformed the XML with the following XLST:
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
      <xsl:output method = "xml" version="1.0" encoding="UTF-8" indent="yes"/>
      <xsl:strip-space elements="*"/>
      <xsl:template match="ooo_sheet">
    <xsl:element name="Import">
    <xsl:for-each select="ooo_row">
    <xsl:element name="Artikel">
      <xsl:element name="Text">
            <xsl:copy-of select="Artikelnummer"/>
            <xsl:copy-of select="Details"/>
            <xsl:copy-of select="Abmessungen"/>
            <xsl:copy-of select="EK"/>
      </xsl:element>
    </xsl:element>
    </xsl:for-each>
    </xsl:element>
    </xsl:template>
    The result is:
    <?xml version="1.0" encoding="UTF-8"?>
    <Import>
        <Artikel>
            <Text>
                <Artikelnummer>C12-34567</Artikelnummer>
                <Details>AAA AAA AAA AAA</Details>
                <Abmessungen/>
                <EK>1234,-</EK>
            </Text>
        </Artikel>
        <Artikel>
            <Text>
                <Artikelnummer>C23-45678</Artikelnummer>
                <Details>BaB BaB BBB BBB</Details>
                <Abmessungen/>
                <EK>2345,-</EK>
            </Text>
        </Artikel>
        <Artikel>
            <Text>
                <Artikelnummer>C34-56789</Artikelnummer>
                <Details>CaC CaC CaC CaC uli</Details>
                <Abmessungen/>
                <EK>3456,-</EK>
            </Text>
        </Artikel>
    </Import>
    I need another child within the node "Artikel" named "Bild". It should have an "href" attribute. The value of the attribute should be the value in the node "Bildpfad".
    The result of this transformation should be
    <Artikel>
      <Text>
        <Artikelnummer>C34-56789</Artikelnummer>
        <Details>CaC CaC CaC CaC uli</Details>
        <Abmessungen/>
        <EK>3456,-</EK>
      </Text>
      <Bild href="file:///cmyk/C12-34567.PSD"></Bild>
    </Artikel>
    I want to import this XML into Indesign. It seems that the images path needs to be in a href attribute so Indesign accepts the node as an image object.
    Another problem is that Indesign won't import the original xml with selection of the listed xsl to tranform the xml. So I used another xml editor instead to perform the transformation.
    Thank you all for your help!

    Hi Dorian_fs,
    I think we're still missing details here on what exactly it
    is you're trying to do? Are you loading this XML via a data set? In
    which case, Don's samples would apply? Or are you trying to load
    XML independent of data sets and regions, in which case, you are
    looking for something that simplifies the access of data from the
    resulting XML document? If the latter than perhaps you want to use
    XMLDocToObject:
    http://labs.adobe.com/technologies/spry/samples/utils/XMLDocToObject.html
    --== Kin ==--

  • Pass values to bind variales and execute VO query

    Hi All,
    I have a requirement to add validation to an appraisal page via OAF.
    As a part of testing I need to check, if the values in the query of VO is displayed in the page.
    VO - QuestAnsValuesVO
    EO - QuestAnswerValueEO, QuestFieldEO
    The VO query is
    SELECT * FROM (SELECT QuestAnswerValueEO.QUEST_ANSWER_VAL_ID, QuestAnswerValueEO.QUESTIONNAIRE_ANSWER_ID, QuestAnswerValueEO.FIELD_ID, QuestAnswerValueEO.OBJECT_VERSION_NUMBER, QuestAnswerValueEO.VALUE, QuestFieldEO.FIELD_ID AS QUEST_FIELD_ID, QuestFieldEO.NAME, QuestFieldEO.TYPE, QuestFieldEO.HTML_TEXT, rank() over (partition by QuestFieldEO.NAME order by QuestFieldEO.FIELD_ID) AS RANK, QuestAnswerValueEO.QUESTIONNAIRE_ANSWER_ID AS QUESTIONNAIRE_ANSWER_ID1 FROM HR_QUEST_ANSWER_VALUES QuestAnswerValueEO, HR_QUEST_FIELDS QuestFieldEO WHERE QuestFieldEO.QUESTIONNAIRE_TEMPLATE_ID(+) = :1 and QuestAnswerValueEO.QUESTIONNAIRE_ANSWER_ID(+) = :2 AND QuestFieldEO.FIELD_ID = QuestAnswerValueEO.FIELD_ID (+)) QRSLT ORDER BY QUEST_FIELD_ID
    I am trying to execute this query in the extended controller class so that i can get the values printed on the page. I am getting SQL exception saying - not all variables are bound.
    How do i pass values to bind variables :1 and :2 and execute this query?
    Please help.
    Thanks
    Geetha

    Geetha,
    Instead of :1 and :2 use a named bind variable as part of your VO and then set either a default value or set its value during runtime. See this example on how to create bind variable:
    http://formattc.wordpress.com/2010/04/02/custom-java-bind-variable-in-a-where-clause-of-an-adf-view-object/
    Once created, you can set its value during runtime either in ApplicationModuleImpl or in ViewObjectImpl class
    e.g.,
             ViewObjectImpl view = this.getEmpView();
            VariableValueManager vm = view.ensureVariableManager();
            vm.setVariableValue("empNo", value);
            view.executeQuery();regards,
    ~Krithika

  • JAVA Read XML file and modify attribute values based on some conditions

    I have the following XML file "C:/Data.xml".
    If the attributes on Dimension, Metirc, Data date Matches then Add the amount values and remove the duplicate DS node.
    I looked some examples on hashtable/hashmapping but I could not find that meets my creiteria. I appriciate any direction or suggestions on this.
    <ED LG="US">
    <DS name="1" source="A" freq="Day">
    <Dimension name="code" value="3">
    <Metric ref_name="A1-ACT">
    <Data date="2011-03-04T00:00:00" amount="30" />
    </Metric>
    </Dimension>
    </DS>
    <DS name="1" source="A" freq="Day">
    <Dimension name="code" value="3">
    <Metric name="A1-ACT">
    <Data date="2011-03-04T00:00:00" amount="40" />
    </Metric>
    </Dimension>
    </DS>
    <DS name="1" source="A" freq="Day">
    <Dimension name="code" value="3">
    <Metric name="A1-ACT">
    <Data date="2011-03-05T00:00:00" amount="20" />
    </Metric>
    </Dimension>
    </DS>
    </ED>
    Expected Result:
    <ED LG="US">
    <DS name="1" source="A" freq="Day">
    <Dimension name="code" value="3">
    <Metric ref_name="A1-ACT">
    <Data date="2011-03-04T00:00:00" amount="70" />
    </Metric>
    </Dimension>
    </DS>
    <DS name="1" source="A" freq="Day">
    <Dimension name="code" value="3">
    <Metric name="A1-ACT">
    <Data date="2011-03-05T00:00:00" amount="20" />
    </Metric>
    </Dimension>
    </DS>
    </ED>
    thanks
    Edited by: user7188033 on Mar 19, 2011 1:40 PM
    Edited by: user7188033 on Mar 19, 2011 2:01 PM
    Edited by: user7188033 on Mar 19, 2011 2:02 PM

    Use XSLT for transforming the XML document.

  • Clipboard functionality and Multi Value in an attribute of component WD_SELECT_OPTIONS_20

    Hi All,
    Clipboard functionality and Multi Value in an attribute functionalities are not working.
    I tried to look into the standard component and could not found relevant piece of code.
    Our system is on 7.3 EHP1 SP9 but functionality does not seem to work.
    Does anyone know in which EHP of 7.3 NetWeaver these functionalities are delivered.
    Any note avalibale compatible with our system level?
    Regards
    Sounak

    Hi All,
    Clipboard functionality and Multi Value in an attribute functionalities are not working.
    I tried to look into the standard component and could not found relevant piece of code.
    Our system is on 7.3 EHP1 SP9 but functionality does not seem to work.
    Does anyone know in which EHP of 7.3 NetWeaver these functionalities are delivered.
    Any note avalibale compatible with our system level?
    Regards
    Sounak

  • When we run query how it gets the characteristic values and attributes.

    Hi,
    When we load transaction data it chacks characteristic values then SIDs then DIM IDs then insert  DIM IDs into fact table but when we run the query how it checks and gets the characteristic values and attributes.
    Bye
    GK

    when we run the query how it checks and gets the characteristic values and attributes.
    Just the opposite way you have described. It gets from the corresponding masterdata tables, with the connected SID.

Maybe you are looking for