How to initialize an adf component before a page loads

Hi all
I use JDeveloper 11.1.2.2.0
I have two pages:
first page has a link to a second page
<af:document title="first.jspx" id="d1">
  <af:form id="f1">
    <af:commandLink text="Page 2" id="cl1" action="goToSecondPage" actionListener="#{Bean.handleLinkActionEvent}"/>
  </af:form>
</af:document>and the second page has an inputText component:
<af:document title="second.jspx" id="d1">
  <af:form id="f1">
    <af:inputText label="Text" id="it1" binding="#{Bean.inputText}" readOnly="true"/>
  </af:form>
</af:document>First I load first.jspx and than I click the link. This event is handled in handleLinkActionEvent() method, in which I want to set a value to the inputText component of the second page. But I can't do it, because as expected I get NullPointerException.
So the question is how to initialize an adf component before a page loads?
Evgeny Michuk
Edited by: Evgeny Michuk on Oct 4, 2012 11:30 PM

Thanks a lot for your replies and links, it gives me some new knowledges.
I got your approach and achieved the aim for the described situation with tag <f:setPropertyActionListener>:
<af:commandLink text="Page 2" id="cl1" action="goToSecondPage"
                       actionListener="#{Bean.handleLinkActionEvent}" binding="#{Bean.firstPageLink}">
  <f:setPropertyActionListener target="#{pageFlowScope.text}" value="Hello, World!"/>
</af:commandLink>and for the inputText component I set the value:
<af:inputText label="Text" id="it1"  binding="#{Bean.inputText}"
                              readOnly="true" value="#{pageFlowScope.text}"/>I used request scoped managed bean and it is shared for both pages.
I understand that I can set a value of some attribute for managed bean
and use it to set a value for inputText component of the second page,
but as I understand it is almost the same way as usage of tag <f:setPropertyActionListener>.
In my real situation on the second page I have a dynamic table, and it's field is read only.
Structure of this table depends on a link clicked on the first page.
So I define components for table columns in runtime, it may be outputText, inputDate, goLink and some others.
And I have to get table through the UIComponent binding to set columns.
Certainly I can define all needed components for all columns
and render it according to the column types
<af:table value="#{Bean.collectionModel}" var="row" id="t1" binding="#{Bean.mainTable}">
   <af:forEach items="#{Bean.columnDescriptionList}" var="column">
      <af:column headerText="#{column.caption}" id="c1">
         <af:outputText value="#{row[column.fieldName]}" id="ot1" rendered="#{column.type == '1'}"/>
         <af:inputDate value="#{row[column.fieldName]}" id="ot2" rendered="#{column.type == '2'}"/>
         <af:selectBooleanCheckbox id="sbc1" selected="#{row[column.fieldName] == '1'}" rendered="#{column.type == 'n'}"/>
      </af:column>
   </af:forEach>
</af:table>but I think it is not very good.
Have you any idea?
P.S. I hope I clearly explained my situation =)
Evgeny Michuk

Similar Messages

  • Detect absolute ID for an ADF component on the page

    Hi All,
    I need to locate an ADF component on the page using ADF Client javascript framework. I'm trying to locate it using following method AdfPage.PAGE.findComponentByAbsoluteId()
    The problem is this component is placed in a page fragment inside page template with several levels of nested naming containers. And I don't have access to the source code of the page template, hence it's quite hard for me to detect the correct absolute id for the component.
    So the question is: how can I know the final value for the absolute id of the component? Can I look it somewhere at runtime? Or if not, is there any alternative way to locate ADF component using just the design time id attribute set for the component?
    Thanks in advance.

    Hi Arun,
    Do you mean the id of the component in the final DOM? I tried to use that but didn't work. In my case, I need to find inputText component on the page. After page is loaded I can select it via Firebug and it has an id like 'pt1:USma:0:MAt1:0:pt1:reportXml::content'. If I then call following method:
    AdfPage.PAGE.findComponentByAbsoluteId('pt1:USma:0:MAt1:0:pt1:reportXml::content')
    I get null. Am I missing something?
    Thanks,
    Maksym

  • Have been running version 4 for a week without problems. Today, downloaded MS live security update, and have had problems since. when I click on a favorite site, it takes 20 to 40 seconds before the page load's and the same if I click a link on the page.

    been running version 4 for a week without problems. Today, downloaded MS live security update, and have had problems since. when I click on a favorite site, it takes 20 to 40 seconds before the page load's.'''bold text'''

    http://portableapps.com/apps/internet/firefox_portable/localization#legacy36

  • Dynamically setting where clause parameter before the page load

    Hi Experts,
    I do have the following requirement.
    I am working on jsf page in ADF10.1.3.3. I have a View Object which displays the results on the screen. Can someone provide me some example where I can dynamically set the where clause parameter to my Query in VO before the Page Load happens(By Overriding the Prepare Model) and display results on screen.
    Thanks

    Hi,
    Thanks for yor advice.
    I need to write the method in Prepare Model method when the page loads and not in AM.
    Here in the page there is no action as such.
    On the Page load we need to directly set the Where Clause on the VO.
    Provide me some examples if any.
    Thanks

  • ADF - Executing Code on Page Load  running on Weblogic 10.0

    Has anybody also try the on page load example at
    http://groundside.com/blog/DuncanMills.php?blog=6&c=1&page=1&more=1&title=adf_executing_code_on_page_load&tb=1&pb=1&disp=single
    this example run ok in jdeveloper but failed on weblogic 10, this should be a deployment isue.
    any ideas?

    I got following error message, seem like this issue is related to the AdfFacesContext object releasing :
    WARNING: AdfFacesContext had not been properly released on earlier request.
    java.lang.NullPointerException
    at oracle.adfinternal.view.faces.renderkit.core.CoreAdfRenderingContext.<init>()V(Unknown Source)
    at oracle.adfinternal.view.faces.renderkit.core.CoreRenderKit.encodeBegin(CoreRenderKit.java:329)
    at oracle.adfinternal.view.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:149)
    at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:107)
    at com.sun.faces.lifecycle.LifecycleImpl.phase(Ljavax.faces.event.PhaseId;Lcom.sun.faces.lifecycle.Phase;Ljavax.faces.context.FacesContext;)V(Unknown Source)
    at com.sun.faces.lifecycle.LifecycleImpl.render(Ljavax.faces.context.FacesContext;)V(Unknown Source)
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:214)
    at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1077)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:465)
    at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:28)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:27)
    at oracle.adfinternal.view.faces.webapp.AdfFacesFilterImpl._invokeDoFilter(AdfFacesFilterImpl.java:228)
    at oracle.adfinternal.view.faces.webapp.AdfFacesFilterImpl._doFilterImpl(AdfFacesFilterImpl.java:197)
    at oracle.adfinternal.view.faces.webapp.AdfFacesFilterImpl.doFilter(AdfFacesFilterImpl.java:123)
    at oracle.adf.view.faces.webapp.AdfFacesFilter.doFilter(AdfFacesFilter.java:103)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:27)
    at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:162)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:27)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:7053)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
    at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3902)
    at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2773)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:224)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:183)
    I have two filter defined in web.xml, is that correct order?
    <filter>
    <filter-name>adfFaces</filter-name>
    <filter-class>oracle.adf.view.faces.webapp.AdfFacesFilter</filter-class>
    </filter>
    <filter>
    <filter-name>adfBindings</filter-name>
    <filter-class>oracle.adf.model.servlet.ADFBindingFilter</filter-class>
    </filter>

  • Progress bar/Icon before the page loads

    Hi,
    I am having a page which takes 1-2 mins to load and render the data now i want to display animated icon/progress-bar immediately the page pops up(ie. when blank). Ive already done progress bar on the page load but in this case i want it to display much early when the page is still blank, any idea please. If this is not doable in Apex i might borrow JS/JQuery......thanks all.

    All,
    I got this issue to work in a better way using Skillbuilder's pop-up plugins but again I am having issue with that too as described below,
    The first time the popup page comes up the background is totally black, how can i change this to make it meaningful color?
    http://apex.oracle.com/pls/apex/f?p=4550:1:0:::::
    workspace=proj2010
    userid/pwd=demo/demo123
    thanks in advance.
    Edited by: jieri on Jul 30, 2012 1:18 PM

  • How can we delete adf component at runtime

    Hii all,
    i am developing an application in which i am generating the ui components at runtime, and displaying them it the pop up window,
    the ui component is generated according to the list of objects.
    The problem i that, this list changes every time as it is specific for a particular document, so when i open the pop up again the old component generated
    are still there, i have a command button on which i am performing the following action to delete the previously generated components -
    public void removeExtraFieldsAddedToUploadForm(UIComponent parentTableLyoutComponent,boolean isCommandButtonClick){
    try{
    if(parentTableLyoutComponent.getChildCount() > 6) {
    List <UIComponent> addedComponents = parentTableLyoutComponent.getChildren();
    for(UIComponent uicomponent:addedComponents){
    String strCompID= uicomponent.getId();
    if(strCompID.indexOf('x') == 0) {
    uicomponent.setRendered(false);
    if(isCommandButtonClick){
    AdfFacesContext.getCurrentInstance().addPartialTarget(parentTableLyoutComponent);
    this things works fine as it refresh the components according to the current list of objects, but when i fetch the values for the components form the pop up window, i am also getting the values for the earlier generated components.
    Is there is any way through which i can delete the previously generated components..??
    Thanks.
    JDeveloper Version 11.1.1.6.0

    As you only set the rendered attribute to false the components are not rendered on the page up are still part of the component tree. So you still can access them (which you do if you iterate over the list of children).
    As you get a {noformat}List<UIComponent>{noformat} from the panelFormLayout you should delete the components from the list
    addedComponents.remove(uicomponent);Timo

  • Calling a method in the Custom ADF component from JSF page

    HI.
    I have created some custom compoents by extending the core ADF Components. Like i have a ComboBoxDefault component with it's ComboBoxDefaultTag.java and Controls.tld file.
    Now my requirement is i want to bind my label to this component from the JSF page. like
    <fwcontrols:label binding="#{listComponents.comboBoxDefaultLabel}" id="label1"/>
    <fwcontrols:comboBoxDefault binding="#{listComponents.cmbLocales}"
    value="en_GB" id="comboBoxDefault" autoSubmit="true" label="label1">
    <f:selectItems value="#{listComponents.locales}"/>
    </fwcontrols:comboBoxDefault>
    In my JSF page the label will have an id, and that id will be specified in the label tag of the component.
    In Tag.java file i have overrided the setProperty(FacesBean facesBean). In this method i have bind all my properties. In core JSF the setProperty method is provided with the UIComponent parameter, so i can call my method in component also. Which is not in case of ADF Faces.
    My main point is how i can call my method setLabel() which is in ComboBoxDefault.java so that i can set the label.
    Thanks in Advance.

    Thanks for all your replies. I want this kind of a functionality because Im trying to invove a DC (Child DC) from a Parent DC such that the Child DC's view is displayed onto the view container of the Parent DC. I have embedded using 'interface view of a component instance' in the Parent Window and am able to create the component and set usage though the onPlugDefault of the Child View.
    But I observe that when i make a call from the parent, the flow is like this:
    1. The wdDoInit of the Child Component Controller gets triggered first.
    2. Then the wdDoInit of the Child's <b>VIEW</b> gets triggered
    3. and <b>THEN</b> the onPlugDefault of the Child Component Interface View
    What I had actually wanted was to Fire onPlugDefault where Im calling a method LoadData(), after which the Child DC's view must be triggered so it can display the fetched data.
    What is actually happening is the view gets displayed, but no data is displayed in the view.
    Right now I have just given a work around where Im triggering <b>LoadData()</b> of the <b>COmponent COntroller</b> from the <b>wdDoInit</b> of the <b>VIEW</b>.
    Is there a better way to do this? I find it strange that I have to load the Data from the view.
    Thanks
    Jack

  • How to create UIComponent at the time of Page Load itself?

    Hi,
    I have to create OuputText Beans at runtime and set the values which i will get from the previous page. My Backing bean is extended of PhaseListners.
    I created Form declarative. At runtime i created PanelLabelAndMessage,OuputText . I attached OuputText to PanelLabelMessage. After this i attched the PanelLabelMessage to Form as getForm1().getChilders().add(PanelLaelMessage).
    But code is executed but my page is not refelcted the changes.
    My query is:
    1. Where i have to add the code? is it in Constructor? OR. afterPhase() method of PhaseListner method.
    Pls suggest how to forward.
    Code:
    Iterator itr_4 = hashWithResult.keySet().iterator();
    while(itr_4.hasNext())
    Object key_4 = String.valueOf(itr_4.next());
    Object value = String.valueOf(hashWithResult.get(key_4));
    System.out.println("In While loop");
    System.out.println("key-------->"+key_4);
    System.out.println("value------>"+value);
    CorePanelLabelAndMessage paneMsg = new CorePanelLabelAndMessage();
    paneMsg.setLabel(String.valueOf(key_4));
    CoreOutputText text = new CoreOutputText();
    text.setValue(String.valueOf(value));
    paneMsg.getChildren().add(text);
    UIComponent panelform = FacesContext.getCurrentInstance().getViewRoot().findComponent("panelForm1");
    panelform.getChildren().add(paneMsg);
    Regards,
    Adhi

    Sorry, I am using ADF 10.1.3.4.

  • How can I show the progress of web page loading only in the right bottom of screen?

    When I downloaded the first Firefox upgrade that had no progress bar, I somehow found out how to stop the new progress bar (that shows all the progress in web addresses rather than a progressive bar) from jumping around in the bottom left or right of the screen. I had it only appearing in the bottom right of screen. Now a new version of Firefox has been downloaded and is once again jumping around from left to right depending what else is showing on the screen. Most annoying, how do I get it to always appear & remain in only the bottom right again.
    Thanks in anticipation, Katnko.

    Hi Cor-el, thanks for your help. Is there a help file anywhere for Status-r-Evar? I don't understand which way to set all the Options, as it is great having the green status bar showin once again, but I wouldn't mind keeping the name of the file that is progressing as well. Do you understand what I mean? Thanks, Katnko

  • Display loading image before pre page load

    hi,
    We have requirement some pages are loading very slow, while the page is processing we need to display a loading image. How to achieve this requirement.
    Especially in IPC on click of one portlet it is taking some time to display in other portlet.
    Thanks
    Manu

    Use Javascript

  • Javascript  before/after Page Load

    hi, i want to call javascript before or after page is loading,
    is it possible?

    Hi,
    Under Page Rendering--->
    Open the page definition
    Under --> Display Attributes
    change to 'Donot focus cursor'
    In Page html body attributes
    enter --> onload="set_focus();"
    bye
    Srikavi

  • When I open a new window with firefox I very briefly get a blue screen every time before the page loads. I have already upadated my graphics driver but no difference.

    This started today after my mail account was compromised.

    Dos it help if you disable hardware acceleration?
    *Tools > Options > Advanced > General > Browsing: "Use hardware acceleration when available"
    Start Firefox in <u>[[Safe Mode]]</u> to check if one of the extensions or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox (Tools) > Add-ons > Appearance/Themes).
    *Don't make any changes on the Safe mode start window.
    *https://support.mozilla.com/kb/Safe+Mode

  • I get a flash of blue background before the page loads.

    its happening on this  page I created. its a duplicate from an older page in where i use the framework.
    but  all other pages on site ae fine.
    please help
    http://www.factoryfresh.net/factoryfreshinventory_Skew_wordUp.html

    http://www.factoryfresh.net/factoryfreshinventory_Skew_wordUp.html
    The blue is coming from your use of bgcolor="#003366" in your first row cell which appears while waiting to load all those graphics. Once the graphics are cached, I don't see the blue anymore.
    Change this:
    <td colspan="7" bgcolor="#003366">
    to this:
    <td colspan="7">
    You also have a mixture of XHTML and HTML causing some of the 1094 validation errors at http://validator.w3.org .
    Since you apparently don't need XHTML (your server is sending it as text/html anyway), try File->Convert->HTML 4.01 Transitional
    Sidenote - Missing links:
    http://www.factoryfresh.net/print.css
    HTTP/1.x 404 Not Found
    http://www.factoryfresh.net/mm_spacer.gif
    HTTP/1.x 404 Not Found
    Mark A. Boyd
    Keep-On-Learnin' :-)
    [Edit: re-inserted missing line feeds]

  • How do I have spry effect trigger on page load?

    I do not want to use the on click behavior to trigger spry
    effects, is it possible to have the effects triggered by the on
    page load command?
    Please help and thanks very much.
    Patrick

    quote:
    Originally posted by:
    dynchuck
    I attach it to an image:
    <img src="images/bookcover.png" width="240" height="375"
    onload="MM_effectAppearFade('buttonCol', 6000, 0, 100, false)"
    />
    Actually the effect is applied on the entire page and is
    currently triggered by the onclick button command.
    So I was wondering if I could leave it that way but have it
    triggered by the onload command.
    Here is the site, the effect is only on the first tab for
    now.
    http://www.patrickjudson.com/weddingIndex.php
    Patrick

Maybe you are looking for

  • Creating Dashboard in OBIEE 11g

    Hi I installed OBIEE 11g newly Can anyone help me in creating Dashboard in OBIEE 11g. Mannu

  • Material group hierarchy in SAP Retail

    Hi Guru's; I'm looking to load hierarchy of material group in BW. In the SAP source system the used standard transaction WG21, WG22CLWM for managing retail material group hierarchy. I suppose that from those transaction there is a BW hierarchy to rec

  • Sending Multiple attachements (PDF) in a single email

    Hello All, I came across below link but could not understand. How to send multiple attachements in single mail Any idea how i can send email with Multiple attachements (PDF format files). Thanks.

  • API for video profile selection in Adobe Flash Player

    Thanks to ActionScript 3, we are able to do programming with regard to Flash Player behavior,  extract info, etc. Since now Adobe Flash Player supports adaptive bit rate video, I wonder if there is an API for Adobe Flash Player so that we can set a f

  • Mic "button" function stopped working!?

    I keep my headphones really, really neat and nice and don't ball them up, or shove them in my pocket, or treat them badly in any way. So... why is my mic "click" not clicking? I can't end phone calls, or stop/start music. They're fairly new, too. Any