Access InputText Value in Declarative Component

Hi,
I have created a declarative component that contains an inputText component:
<af:inputText label="#{attrs.ucitLabelText}" id="dc_it1" contentStyle="text-transform:uppercase;" converter="StringAsUppercase"/>
When I use the declarative component on a page, is there any way to easily access the value of its inputText through the page backing bean? The declarative component is bound to the page, but what method can I use to access the inputText value?
Thanks,
Brad

Thanks.
I also figured out that I can simply do the following:
When creating the declarative component...
- Add an attribute to the declarative component (let's call it "inputValue")
- Assign the inputValue attribute to the inputText value.
When using the declarative component on a page...
- Create a String property in the page's backing bean
- Assign that property to the declarative component's inputValue attribute
Then I can access the backing bean property to get the inputText value.
Brad

Similar Messages

  • Error in accessing attributes of a declarative component in BackinBeanScope

    Hello,
    I'm using JDeveloper 11.1.1.4.0.
    For pagination we have created a declarative component. It's bean when in request scope works fine when the dec.comp. is used in page only once.
    In order to use it multiple times in the same page, I changed the scope to BackingBeanScope. It works fine the first time bean's method gets called. However on the next request, I'm getting NullPointerException when it tries to access the dec. comp's attribute.
    Why am I getting this error and how to correct it?
    As an alternative, we can store the attribute value received first time in a hidden form field and retrieve it every subsequent time. But this would be my last alternative.
    Appreciate a reason and a better way to resolve this.
    Regards,
    Amar

    Hi,
    Yes. The bean is declared in the dec. comp.
    Following is the code in my bean's c'tor:
    FacesContext fc                    = FacesContext.getCurrentInstance();
    ELContext elctx                    = fc.getELContext();
    ExpressionFactory elFactory    = fc.getApplication().getExpressionFactory();
    ValueExpression valueExpr      = elFactory.createValueExpression(elctx, "#{component}", UIXDeclarativeComponent.class);
    UIXDeclarativeComponent currDeclarativeComp            = (UIXDeclarativeComponent)   valueExpr.getValue(elctx);
    String currVOObjectName                                         = currDeclarativeComp.getAttributes().get("VOObject").toString();"VOObject" is the attribute name for the dec. comp. It's getting correct value the first time. Every subsequent time,the last line throws null pointer exception.
    Regards,
    Amar

  • Upload interactive form and access field values in WD component

    Hi Experts,
    I want to upload a prefilled  interactive adobe form in my webdynpro component and then I want to read the values filled in the form in my webdynpro component.
    I don't want to display the interactive form in the WD component. Just need to read the values.
    Please let me know how can I do it.
    Warm regards,
    Sushant Singh

    You can use the fileupload and filedownload uielements.
    Check these links:
    [File Upload|http://help.sap.com/saphelp_nw70ehp1/helpdata/en/b3/be7941601b1d09e10000000a155106/content.htm]
    [File Download|http://help.sap.com/saphelp_nw70ehp1/helpdata/en/09/a5884121a41c09e10000000a155106/content.htm]
    When you upload a file and save in SAP, are you saving it as xstring.
    If yes follow these steps for filedownload.
    Follow these steps for file download:
    1 Create FileDownload uielement in your View
    2.Create an Attribute of type xstring.
    3.Bind this attribute to the data property of your Filedownload uielement.
    4. during fileuplaod as you are saving the document in xstring format, fetch the same from your database table and pass the value to filedownload i.e set the attribute bound to data property of filedownload uielement with the xstring content.

  • Can i use one JSF component's value for other component in the same page.

    Can i use one JSF component's value for other component in the same page.
    For example
    I have a <h:selectBooleanCheckbox id="myChk"> in my jsf page, i want to access its value for another component like:
    <h:commandButton disabled="#{myChk.checked}" action="myAction" value="myValue" />
    ** "myChk.checked" >> I am just asuming "checked" property is available...

    Bind the checkbox to a UIInput myChk property. Then you can reference this property from the page, e.g.
    <h:selectBooleanCheckbox binding="#{myBean.myChk}" onchange="submit();" />
    <h:commandButton disabled="#{myBean.myChk.value}" action="myAction" value="myValue" />

  • Declarative component are not accessable in page fragment

    Hi,
    I have created declarative component .. But it can access only in *.jsf page not in fragment page ...

    HI,
    Got it actually i have created declarative component using faclet (*.jsf) page...  If i create DC using .jspx page ...its working
    Thanks,
    Nitesh

  • I am facing problem while accessing property value when i include a component inside another

    Hi Everyone,
    I am unable to access property value of richtext of a compoent that is included in another compoent.
    I have created a compoentA at following location myProject/components/componentA.
    I then created componentB at this location myProject/components/componentB
    ComponentB contains a design_dialog that has a richtext widget with following properties:-
    xtype=richtext
    name=./description
    titile=productdescription
    I have then included componentB in componentA.jsp using <cq:include path="productdescription" resourceType="myProject/components/componentB" />.
    I have then dropped componentA on a page. In design mode i could see the edit dialog for componentB and on edit I could see the rich text, but when i am trying to access the values entered in richtext inside componentB.jsp i am getting null/default value.
    <%=properties.get("description","Description not present")%>
    Can any one tell me why the property is not accessible on the included component.
    Thanks

    What is the tree structure created for the property of the componentB?
    Can you try the below code in your componentB jsp and check whether you are getting the property value
    Resource resource = slingRequest.getResource();
    String description = ((String) ResourceUtil.getValueMap(resource).get(
                        "./description", String.class));

  • How can add some suggested value to a propert on a Declarative Component,

    how can add some suggested value to a propert on a Declarative Component?

    kenyatta,
    Where you want to add the value ?
    If you want put some UIComponent(Value) to your declarative Component than follow my blog ( http://jneelmani.blogspot.com/2009/02/11g-how-to-create-declarative-component.html ) and add your value in STEP-5.
    You can watch live-demo at http://www.oracle.com/technology/products/jdev/viewlets/viewlet.html
    --Neelmani Jaiswal
    Edited by: Neelmani Jaiswal on Mar 23, 2009 11:11 AM

  • Need to access value on another component to cross-validate...

    Hi,
    I need to do a cross-validation on a field against value filled on the same form. The model is only updated after validation has completed successfully according to the Faces lifecycle, thus reading the managed bean would prove fruitless.
    Does anyone know how to access a value in another field on the same form so that I can cross-validate against?
    Regards...
    AT

    try this,
    request.getParameter("<BackingBeanName:fieldName>").
    This should give you the value.
    HTH !

  • Tinymce declarative component not working when added with PPR

    I have a declarative component that i exposed in a resource catalog.
    This component uses <af:resource> to inject javascript in the page.
    the problem that i have is when in editing mode, and you add the component. the components <af:resource> is not yet injected and i have to manually refresh my browser to see the effect.
    I am trying to integrate TinyMCE as a component.
    This problem occurs because when you click the add button it does a PPR.
    If i load a page where my component was already on, I don't have this problem.
    I also tried a refresh commandButton, but because forcePPR is configured in the web.xml and I may not change this, it is not executed correctly.
    Any ideas to solve this, or a workaround would be helpful?
    thanks in advance
    <af:group id="dc_g1">
          <af:commandButton text="refresh"
                            actionListener="#{backingBeanScope.tinymceBean.addScripts}"/>
          <af:resource type="javascript" source="/tiny_mce/tiny_mce.js" />
          <af:resource type="javascript" source="/tiny_mce/config.js" />
          <af:inputText simple="true" value="#{attrs.value}" styleClass="AFStretchWidth"
                        id="dc_it1" rows="2" />
          <af:resource type="javascript" text="initTiny();" />
        </af:group>

    Try collecting a Process Monitor trace https://technet.microsoft.com/en-us/sysinternals/bb896645 to check what is the Access is being Denied on.
    Windows Store Developer Solutions, follow us on Twitter:
    @WSDevSol|| Want more solutions? See our blog

  • How to access the value of a field of a field symbol.

    Hello All,
    i need to access the value of a field in a field symbol. But when i am trying to get the value like <FS>-POSNR, it's showing that that the <FS> has no structure.
    In my program, the field itself that i need to check should be dynamic. ie i'll get the field in a variable and i need to find the value of that field.
    Am pasting my code below, please tell me what needs to be done.
    here in my sample code i am moving the entry of the <FS> into a work area structure. But in my actual program, i gets the structure as a parameter. So is there any way i can declare a work area dynamically...
    FUNCTION z_39181_dyn_fs_60758.
    ""Local interface:
    *"  IMPORTING
    *"     REFERENCE(PARAMETER) TYPE  VBELN
    *"  TABLES
    *"      DATA_TAB
      BREAK-POINT.
      FIELD-SYMBOLS <fs> TYPE ANY.
      FIELD-SYMBOLS <fs1> TYPE ANY.
      FIELD-SYMBOLS <fstab> TYPE ANY TABLE.
      DATA name(5) VALUE 'POSNR'.
      FIELD-SYMBOLS <f> TYPE ANY.
      DATA: dref TYPE REF TO data,
            dref1 TYPE REF TO data,
            dref2 TYPE REF TO data.
      DATA: lv_lips TYPE string.
      DATA: lv_lipsfld TYPE string,
                lv_fld TYPE string,
                lw_lips TYPE lips.
                lv_lips = 'LIPS'.
                lv_fld = 'LW_lips-POSNR'.
      CREATE DATA dref1 TYPE (lv_lips).
      CREATE DATA dref TYPE STANDARD TABLE OF (lv_lips).
      CREATE DATA dref2 LIKE LINE OF data_tab.
      ASSIGN dref->* TO <fstab>.
      ASSIGN dref1->* TO <fs>.
    assign dref2->* to <fs
      <fstab> = data_tab[].
      LOOP AT <fstab> INTO <fs>.
        lw_lips = <fs>.
        WRITE lw_lips-vbeln.
        ASSIGN (lv_fld) TO <fs1>.
       write <fs>
      ENDLOOP.
    Helpful answers will be rewarded...

    Use syntax
    ASSIGN COMPONENT name OF STRUCTURE struc TO <fs>.

  • InputText value attribute issue

    If I add this in outputText it works, but in inputText it throws currentRow returned null. Why?
    value="#{bindings.MyIter.currentRow.dataProvider.city}"

    <af:inputText> is an editable value holder component in contrast to <af:outputText> which is not, so I suspect that <af:inputText> accesses its value holder during the Apply Request Values phase (i.e. before the iterator is executed, when there is no current row yet), but <af:ouputText> accesses it as late as the Render Response phase (when the iterator has already been executed).
    You should not reference directly the iterator binding in an <af:inputText>. You should create and reference an attribute value binding for the City attribute instead. So, create an attribute value binding for the City attribute in the pageDef and then use this binding in your <af:inputText>, for example
    <tt>  <af:inputText value="#{bindings.City.inputValue}" ... ></tt>
    As this value binding should be used in some other attributes of the <af:inputText> tag too, the simplest way to do everything is to go to the DataControl palette, to find the requested iterator and to drag-and-drop the City attribute on the JSF page as InputText. JDev will automatically do then everything for you.

  • Dynamic declarative component won't work properly within table row

    Hi guys,
    I built a dynamic declarative component which basically consists of an af:inputText surrounded by a af:panelLabelAndMessage tag.
    The component works fine until I put it inside a table column, then none of the attribute values get set.
    The problem seems to be related to the table row binding #{row.binding.Name.inputValue} , if I use a regular binding #{binding.Name.inputValue} it works ok.
    The declarative components attribute is defined as
    <attribute>
        <attribute-name>kbez</attribute-name>
        <attribute-class>java.lang.Object</attribute-class>
    </attribute>and is used as the inputText's value attribute
    <af:componentDef var="attrs" componentVar="component">
        <af:panelLabelAndMessage label="#{attrs.label}" id="dc_plam1"
                                 for="dc_it1" labelStyle="white-space:nowrap;"
                                 showRequired="#{attrs.showRequired}"
                                 rendered="#{attrs.rendered}">
            <af:inputText id="dc_it1" value="#{attrs.kbez}"
                          autoSubmit="true" immediate="false" ...>The component inside a table column is set like this
    <af:declarativeComponent viewId="/WEB-INF/ikb.adf.kreda.basis/mitarbeitersuche/ddc/mitarbeiterLOV.jsff"
                             id="ddc1" label="Mitarbeiter"
                             kbez="#{row.bindings.Kbez.inputValue}"/>My JDeveloper version is 11.1.1.5.
    Am I doing it wrong or is this a bug?
    Any help is appreciated.
    Thank you,
    Achim
    Edited by: Achim Rosenfeld on Mar 8, 2013 8:41 AM

    Hi,
    +#{row.binding.Name.inputValue} , if I use a regular binding #{binding.Name.inputValue} it works ok.+
    Don't think that #{binding.Name.inputValue} works okay in a table because it doesn't stamp the component per row. Actually I don't know if we support dynamic declarative components in a stamped environment (table). I know though that we don't for taglib declarative components in this context.
    Reason why it doesn't work: Tables are stamped at runtime, which means that for better performance, only the generated HTML is reused for each row with different data - not the component. Your component requires itself to be re-created for each row so it can re-read the attribute again. This is not the case in a stameped environment
    Solution: For your particular use case I don't think that a dynamic declarative component is needed as you can add the construct (af:inputText surrounded by a af:panelLabelAndMessage) directly into an af:column tag. The declarative component makes more sense for reuse of layout areas (e.g. custom tabs) that are iterated within an af:forEach (in which case instances of the decalarative components would be created).
    Bottom line: tables stamp their components and as such the attribute property exposed on a DDC doesn't seem to be called for each row, which is by design. This can be considered a bug if there is a use case demanding for a DDC in a table. If this is a requirement for you (and you can't directly add the components to the af:column tag) feel free to file this as a service request with customer support (required a support contract) so development can have a look if the requirement is feasible to implement.
    Frank

  • Error while saving changes of declarative component to MDS

    Hi,
    Using ADF Faces 11gR1PS1.
    I am trying to create a declarative component where user can close a panel box (not just minimize) by setting rendered property to false. It works fine.
    Next I tried to save the attribute change to MDS so that user settings are preserved across sessions. However I got the following error:
    <FilteredPersistenceChangeManager><_getQualifiedTagName> WebAppDesignContext is not available at application scope. Please ensure that your application is built as a 'Fusion Web Application (ADF)', and that taglib.jar and facesconfigmodel.jar are in class path.
    <FilteredPersistenceChangeManager><_isChangeAllowedThroughPersistentChangeManager> Could not obtain tag name for the component being changed. Component ref: RichPanelBox[UIXFacesBeanImpl, id=dc_pb2]
    <FilteredPersistenceChangeManager><_addDocumentChangeImpl> The DocumentChange is not configured to be allowed for the component: RichPanelBox[UIXFacesBeanImpl, id=dc_pb2]Following is the page code:
              <af:panelBox text="#{attrs.p2Header}" id="dc_pb2"
                           rendered="#{attrs.p2Header ne null and dashboardXBean.portletRendered.dc_pb2}"
                           showDisclosure="false">
                <af:componentDragSource discriminant="portlet"/>
                <f:facet name="toolbar">
                  <af:commandImageLink id="p_cil2"
                                       icon="/images/removeselected_dwn.png"
                                       hoverIcon="/images/removeselected_ovr.png"
                                       depressedIcon="/images/removeselected_ena.png"
                                       actionListener="#{dashboardXBean.handleHideEvent}"
                                       rendered="#{attrs.sideNavRendered}">
                    <f:attribute name="portletId" value="dc_pb2"/>
                  </af:commandImageLink>
                </f:facet>
                <af:facetRef facetName="p2"/>
              </af:panelBox>Following is the code in the managed bean to persist changes:
        private void saveShowHideChange(String portletId, boolean isRendered) {
            FacesContext fc = FacesContext.getCurrentInstance();
            ChangeManager cm = RequestContext.getCurrentInstance().getChangeManager();
            //ChangeManager pcm = AdfFacesContext.getCurrentInstance().getPersistentChangeManager();
            UIComponent puc = boundedDashboard.findComponent(portletId);
            ComponentChange pcc = new AttributeComponentChange("rendered", Boolean.toString(isRendered));
            cm.addComponentChange(fc, puc, pcc);
        }I am not really sure if the above code needs to be in the component managed bean or in the bean of the page that uses this declarative component.
    Any pointers are appreciated.
    Thanks,
    Husain

    Thanks for the reply Frank.
    For declarative components do we have separate renderer?
    The [Developers Guide|http://download.oracle.com/docs/cd/E12839_01/web.1111/b31974/ad_persist.htm#BABBGCJA] didnt seem very helpful on this topic.
    Can you point me to some reference material if available.
    Thanks,
    Husain

  • JDeveloper 11.1.2.3, ADF Faces: need declarative component idea for table

    Some background:
    I'm trying to create a reusable toolbar for standard af:table behavior, see screen shot
    http://wesfang.files.wordpress.com/2013/05/dc.jpg
    I got the idea from the from using documentation Frank has published in the past
    1. http://www.oracle.com/technetwork/developer-tools/adf/learnmore/001-access-declarative-comp-attr-169113.pdf
    2. Adding a new row programatically
    The consuming subsystem's page passes in a "MyPageBean" which is a subclass of a "ArchBean" where all actionlistener operations are defined. The idea here is to minimize developer customization when using this component.
    ... <f:facet name="toolbar">             <af:toolbar id="t2">                 <mskcc:basicTransactionToolbar id="btt1" pageBean="#{MyPageBean}" tableId="t1"/>             </af:toolbar> </f:facet> ...
    The table within the consuming page is by default dropped off as a "editable" table. The developer needs to further modify the "disable" attribute to true for all the input fields and command components within the table. I would like to remove this developer step and instead have it in an architectural component. All ideas are welcome.

    Ok, finally got it working (sort of)
    Using the following method as you suggested:
    public void encodeChildren(FacesContext fc){
            try {          
                super.encodeChildren(fc);
                RichTable table =
                    (RichTable)ADFFacesUtil.findComponentInRoot((String)this.getAttributes().get("tableId"));
                lockUnlockTable(table); //method for toggling disable attribute for all command and input components
            } catch (IOException e) {
                e.printStackTrace();
    }Now the strange problem I encountered is that the encode methods are not called if the declarative component is defined within a panelCollection's f:facet-toolbar like below:
    <f:facet name="toolbar">
                        <mskcc:basicTransactionToolbar id="btt1" tableId="t1" pageBean="#{TestBean}"/>
    </f:facet>Also the above code has to be manually created because the design time editor does not allow me to drop off the dc within the toolbar facet (even though the dc is a toolbar!)
    Instead, If I move the dc outside the panelcollection, then the encode methods are invoked and the desired enable/disable behavior is correctly displayed.

  • JDeveloper 11.1.2.3, ADF Faces: declarative component does not support af:clientListener?

    I am trying to create a declarative component with the following code:
    <?xml version='1.0' encoding='UTF-8'?>
    <af:componentDef xmlns:af="http://xmlns.oracle.com/adf/faces/rich" var="attrs" componentVar="comp" definition="private"
                     xmlns:afc="http://xmlns.oracle.com/adf/faces/rich/component">
        <af:xmlContent>
            <afc:component>
                <afc:display-name>DoubleClickTableDialogClientServerListener</afc:display-name>
                <afc:component-extension>
                    <afc:component-tag-namespace>org.mskcc.crdb.common.declarativecomponent</afc:component-tag-namespace>
                    <afc:component-taglib-uri>http://www.mskcc.org</afc:component-taglib-uri>
                </afc:component-extension>
            </afc:component>
                <af:clientAttribute name="serverListenerType" value="TableDoubleClickEvent"/>
                <af:clientListener method="handleTableDoubleClick" type="dblClick"/>
                <af:serverListener type="TableDoubleClickEvent"
                                   method="#{EditAddDialogTemplateBean.handleTableDoubleClick}"/>
        </af:xmlContent>
    </af:componentDef>
    At runtime I recieve the following error:
    javax.faces.view.facelets.FaceletException: ADF_FACES-60023:Component: DoubleClickTableDialogClientServerListenerComponent[oracle.adf.view.rich.component.fragment.UIXInclude$ContextualFacesBeanWrapper@7170a7, id=dctdcsl1] does not support client listeners.
      at oracle.adfinternal.view.faces.facelets.rich.BaseClientListenerHandler.apply(BaseClientListenerHandler.java:53)
    This component was intended to be dropped off within an af:table component. I would like to hear suggestions on workarounds, one other way I thought about was to create a code template for the three tags, however, the con to this approach is each developer would need to configure this template within jdeveloper. Ideas are appreciated.
    Also a side question, how can I embed code properly with the new forum? [code] tag does not seem to work now.

    Wes, can't help with the real question, but can tell you how to format code
    Change to the advanced editor (top right over the editor field), then you get more options. The one you are looking for is behind the blue '>>'. Here you select the language you want to insert and you get nice code formatting and color.
    Timo

Maybe you are looking for

  • IMac bongs when attempted startup

    Today I got a new apple TV. It appears to have killed my iMac, although I have been getting random crashes before. It has been crashing randomly since I switched on time machine. I unplugged the harddrive I was backing up to and this seemed to stop t

  • Problems Creating Custom Skin w/ further functionality

    Hello, To add that final piece to my project i have been attempting to modify the controls within the flash files located in the program files. I have been successful in editing the look without any problems, but that isn't the end of my plan. I have

  • Merge photos from starter edition to another edition on same computer

    I have both Adobe Photoshop Album 3.0 starter edition and Adobe 2.0 Photoshop on my PC. I accidentally downloaded some pictures from my camera onto the 3.0 edition (I primarily use the 2.0 edition). Is there any way to move the pictures in the 3.0 al

  • How to extend XI license

    Hello, Again one more basic query. Recently we installed NW 2004s PI70. And it gives us one month to update license. And we applied for permanent license. I have one more week to go. In case, if i don't get the key by chance, is there any possibilily

  • Having trouble installing or uninstalling itunes

    While trying to download updated itunes , it stopped working . There may have been a problem the hard drive being maxed out . I took care of the space problem . Running windows XP .When I hit the start button , itunes is there , but it says it's empt