How to override ADFLifeCycle

Using Jdev 11g R1.
In order to set properties on UIComponents at runtime, I can use the beforePhase in the f:view component of each page. On this method, before RENDER_RESPONSE Phase, I can look for the UI components I want to modify using the FacesContext.getCurrentInstance().getViewRoot().findComponent("idComponentToFind") method, I can access the UIComponent, modify it's values, and the page is rendered accordingly.
This solution works, but I need to implement the beforePhase for each page. As this will be mandatory for all pages in our application, I would like to implement this code just once, and avoid using the f:view in each of our pages.
I tried to create a PagePhaseListener, and declaring it into adf-settings.xml, as explained in section 20.4.2 How to Register a Listener Globally in Fusion Developers Guide. In the beforePhase(PagePhaseEvent) method, I can't find the moment (PagePhase Id) where to look up my UIComponents. From the UIViewRoot, using the findComponent method, I can't find any of my UIComponents.
After observing the behaviour, I can see the following about the order of the phases-PagePhases:
.... initial phases...
PagePhaseListener.afterPagePhase 1(prepareModel)
PagePhaseListener.beforePagePhase 14(jsfRenderResponse)
PagePhaseListener.beforePagePhase 8(prepareRender)
PagePhaseListener.afterPagePagePhase 8(prepareRender)
af:view.beforePhase (RENDER_RESPONSE 6)
PagePhaseListener.afterPagePhase 14(jsfRenderResponse)
..... end...
And these are the results of placing my code in:
PagePhaseListener.afterPagePagePhase 8(prepareRender) -> I can't access the UIComponents, using the ui view root findComponent method. It allways returns null. Seems that view tree is not yet prepared.
af:view.beforePhase (RENDER_RESPONSE 6) -> It works perfectly. But at each page level, not generic for all pages in application.
PagePhaseListener.afterPagePhase 14(jsfRenderResponse) -> I can access the UIComponents, but they are not updated in the view.
Is it possible to write a PhaseListener in the same way I can do it at page level, but at application level (for all pages in the application) ?
If not, how can I get my UIComponents updated in the view if I modify them in the after jsfRenderResponse phase ?
Thanks in advance,
Roger B

Hi,
In fact the question is not fully solved.
Like Kedar, I want to apply dynamic security at component level in a generic way.
I tried to use the f:view before phase attribute, so at page level, and it worked. In the before phase render response (id 6), the UIComponents are available using the ViewRoot.findComponent or also using the invokeOnComponent. But if Im move that code in a PhaseListener, trying to implement something reusable, and configure it in faces-config.xml, won't work. UIComponent tree is created between the call to the PhaseListener and the call to f:view before phase method.
So, what I finnaly decided is to create a generic permission bean. A method on this bean will be called from the appropiate property (disabled) of the components for which I want to apply special security. I'll pass the id of the component as a parameter (#{bean.checkPermission['id_component']}). In that method I'll handle the logic to disable or not the UIComponent (based on the component id and the userid and role got from SecurityContext).
I've decided this because applying this kind of security won't be common in our application, just special cases. If your case is to apply security to all components, I would recommend to use the f:view.beforePhase method, and from that method call your security bean. Inside this method you can use the findComponent to locate the components you want to disable/enable. So the method is generic, but you need somehow that each page calls your method.
Anyway it would be nice if somebody can explain why the application PhaseListener, in before phase 6, does not have the UIComponent tree built.
Roger

Similar Messages

  • How to override the create method invoked by a create form?

    Hello everyone, I'm using ADF Faces and have the next question:
    How can I override the create method which is invoked by a create form to preset an attribute in the new row (the preset value is not fixed, I have to send it to the method as a parameter as it is obtained using an EL expression)?
    In the ADF guide I read how to override a declarative method (Section 17.5.1 How to override a declarative method), but this explains how to do it with a method that is called by a button. I don't know how to do the same with a method which is called automatically when the page is loaded.
    I also tried overriding the view object's createRow() method to receive a parameter with the preset values but it didn't work, I believe that was because the declarative create method is not the same as the view object's createRow. This caused the form to display another row from the viewobject and not the newly created one (I also set the new row into STATUS_INITIALIZED after setting the attribute).
    Well, I hope my problem is clear enough for somebody to help me.
    Thank you!

    Hello,
    I'm not sure you can do it with standard generated Create Form.
    In your view object you'll need to create your own create method with parameters, publish it to client interface and invoke instead of standard generated create action in page definition.
    Rado

  • Computer doesn't recognize administrator password.  How to override or reset?

    Computer doesn't recognize administrator password.  How to override or reset?

    You cannot override but you can chage it, the approach depends on the Mac OS X you are using.

  • How to override confirmation fr sending sms? -urgent-

    I made an application that suppose to send an sms automatically. But it always prompts a confirmation question. How to override this? Thank you..

    This is a problem not only when sending to the few people without a data plan but for people roaming with their data connection disabled to control costs. Somehow, my iPhone can tell the other phone is an iPhone even with no data connection and tries to send an iMessage. It would be nice to be able to send a text message right away instead of waiting for the iMessage to fail or perhaps failing to notice that the "Delivered" notice did not appear.

  • HOW TO override/modify default PTG homepage?

    Hi:
    I want to know how to override default portal to go homepage. I've create my wireless app that is already well deployed in a container and already working in PTG. I want to know how to modify the default ptg home. I've removed all apps from ptg to the guests users and just give access to guest to my application. I need a simple default homepage and i need to remove the SETUP link that is always displayed in /PTG/RM page. Also, can anyone tell me how to create a simple url to access my wireless portal?
    for instance i have to write : portal.myorg.pt/ptg/rm and i would like to just hae to write : wire.morg.pt
    How can i achieve this?
    Thanks
    Joao

    I'm using a beta of 10G at the moment. What I did is change the oracle logo (logo.gif) with our own company's logo (http://host:port/ptg/images/logo.gif) (also the wbmp and png file) .
    If you can get access to the webtool http://host:port/webtool/login.uix you can click on the system tab and look for
    System > Wireless Server: Administration > Device (look at component configuration).
    From here you can enable/disable standard interface options
    Multi-Channel Server Setup Menu Configuration
    Enable Login
    Enable Logout
    Enable User Info
    Enable Application Customization
    Enable Global Preset
    Enable User Profile
    Enable Self Registration
    Enable User's Home Page
    Enable Help
    Help URL
    You can change the logon page and other pages on <oracle_home>\wireless\j2ee\applications\ptg\ptg-web\modules\login
    and
    <oracle_home>\wireless\j2ee\applications\ptg\ptg-web\modules\iaswfr
    I'm also curious if there is a more easy way to customize things.
    Thomas

  • How to override truncateToFit method for SuperTabNavigator

    Hi All,
               How to override truncateToFit method for SuperTabNavigator.
    we have editableLabel method for changing the tab name.
    it is dispalying the ... elipse when entered characters grater than the tab width. it is ok.
    but if the entered characters less than the tab width it is also appending the ... elipse.
    i dont want that . how to remove those. i dont want completely truncateToFit option.
    how to override .
    Can any help me regarding this?
    Thanks in Advance
    Raghu.

    Give me a sample codeNo. Read the links provided by Yannix, try it out for yourself, and if you still have a question, post the code you tried.
    db

  • How to override component default events

    How to override the scroll panel default click event to custom event.

    Events bubble by default... It sounds like you want to look at the Event class' stopImmediatePropagation method.

  • How to override iMac password?

    how to override iMac password?

    This discussion is for computer built before 2006.  The same solution probably applies to newer computers.
    You can  change the password on an account.  ( Do you know Unix. You are in a Unix single user console. )  The setup commands you need should be listed on the screen.  For Mac OS 10.4.11, the commands are:
    # Type the follow two instructions to access the startup disk in read/write.
    # check out the filesystem.
    # ( in case of partial success repeat this command until errors go away. )
    /sbin/fsck -fy
    # Gain read / write access to your startup drive
    /sbin/mount -uw /
    ->Start up some utility processes that are needed.
    sh /etc/rc
    ->You will probably need to press the return key once the system stops typing.
    ->To find out the users on the system type, use the ls command. The l is a lower case L:
    ls /Users
    ->One of these accounts will be the administrator.
    ->Pick one of the users which I'll call a-user-name and type it in this command:
    passwd a-user-name
    ->and enter the new user password. You need six characters.
    ->You will need to enter your password twice.  Your typing will not show up on the screen just
    -> press enter when you complete the typing.
    ->For cryptic information on these commands try:
    man ls
    man passwd
    The root account isn't enabled by default. I am not sure if changing the password on root will enable it.

  • How to override the default height of tree component...

    Hi,
    Can anyone please tell me how to override the default height of <af:tree> component.
    Actual Problem:
    I have a PanelBox in which I have a ShowDetail component. ShowDetail contains Tree component. When I click on ShowDetail item the Tree component have to be displayed. But, PanelBox is expanding to TREE default height(27.27 ems) instead of expanding to exact height of Tree.
    How to manage this issue?
    Thanks
    -Sukumar

    Did you already try
               <af:treeTable value="#{bindings.DashProjectPhasesDev.treeModel}"
                                  var="node"
                                  selectionListener="#{bindings.DashProjectPhasesDev.treeModel.makeCurrent}"
                                  rowSelection="none" rowBandingInterval="0"
                             inlineStyle="width:810px; height:1100px;"> Check the last line with inlineStyle...
    Julian

  • One of my kids changed my password, and now i can't access my mail accounts. Any ideas on how to override the password and set up a new one?

    one of my kids changed my password, and now i can't access my mail accounts. Any ideas on how to override the password and set up a new one?

    A mail account password or you login password?
    Which OS by the way?

  • HT1277 I am trying to setup a new email account.  Apple Mail is trying to configure it as an iMAP account but it is actually a POP account.  I cannot figure out how to override that.  What do I need to do?

    I am trying to setup a secondary e-mail account which is a POP account.  However, when I try to setup the new account, Mail detects it as an iMAP account.  Once Mail sets it up as an iMAP account it doesn't work.  I cannot figure out how to override the automatic setup and manually configure it as a POP account.

    Yeah, silly as it seems, OSX is trying to do too much for us, not on 10.8 to test, but try this...
      velocityg4    
    macrumors 68040
    Join Date: Dec 2004 
    Location: Georgia
                I'm not sure why you would want POP over IMAP.  When IMAP is so much more versatile.
    velocityg4
    Anyways if it works like 10.7 Mail.  When adding the account trick it. Do this by just entering some fake email address and password into the boxes and click continue.  It will then say it could not find the correct settings, click continue.  Now you will be given the option to enter everything manually. 
    Now you can choose POP and manually enter the POP and SMTP settings for Yahoo.  Which I believe are pop.mail.yahoo.com, Port 995, SSL and smtp.mail.yahoo.com, port 465, SSL, authentication required. Enter your correct email address now.
    Once added go back to your accounts list and edit it to make sure that it now lists your correct yahoo address and not the fake address in all areas.
    Note: Be sure when entering the fake email address to not use a major provider it likely knows.  So don't choose @gmail, @hotmail, &c instead use something like @weevilfarts.com.
    http://forums.macrumors.com/showthread.php?t=1460262

  • How to override Approve button for list item?

    Hello,
    Is there a way how to override the method that runs after list item is approved / rejected? I know there is a way for the Save button but I can't find how to do it for the Approve button.
    I have a list with approval and workflow. Then I have a page that displays the items from the list in my webpart in a calendar/grid way. The items in the webopart have links leading to the display form with the item ID and Source parameters. Source parameter
    leads back to this page. The background color of the item in the webpart is decided by the approval state of the item.
    When user approves the item and the item form closes user is then sent to the page with the webpart (via the Source parameter) but the workflow takes couple of seconds more to process the aproval so the color is not changed when the webpart renders but if
    the page is refreshed it shows the correct color because the workflow has finished.
    I want to override the Approval method, let it update the item so the workflow can fire and process the approval, delay the form a bit and then continue as usual so when the user is redirected to the webpart page it would render with the correct state.
    I can make a delay page that redirects to the webpart page and change the Source parameter in the items link to go there but it doesn't look that great.
    Or maybe there is a way how to do it in Javascript? I am using it in the new item form using the SP.UI.ModalDialog.showModalDialog(options) function where the dialogReturnValueCallback refreshes the windows after 3 seconds.
    dialogReturnValueCallback: function(dialogResult) {
            if (dialogResult == SP.UI.DialogResult.OK) {
             setTimeout(function(){window.location = "MyPageUrl"}, 3000)
    Thanks for any tips and ideas!

    you can try to achieve this via separate responsibility by personalizing the form by display false on the particular control button..

  • How to override the 'default' partition in composite.xml - urgent

    All,
    Version: 11.1.1.4
    I have created a simple BPEL A which invokes another BPEL B which is deployed to 'default' partition. In the composite.xml of BPEL A I can see the WSDL location of BPEL B as *"http://localhost:7001/soa-infra/services/default/BPELB/BPELB.wsdl"*. I noticed that the name of the partition (i.e in our case its 'default') is hardcoded in the wsdl location. During deployment I want to override to other partition, how I can achieve this?
    thanks
    sen

    If you want to change the partion name at run time then used Token ,value concept and define it in build.xml
    For Example
    <target name="replaceAllValues">
    <input
    message="Please enter full path of the file directory:"
    addproperty="dirPath"/>
    <replace dir="${dirPath}">
    <replacefilter
    token="OldValue."
    value="Newvalue"/>
    </replace>
    </target>
    Call the above target from ant build.xml before you deploying the service.
    Regards,
    Tarak.

  • How to override AD identity template for resource contained in role?

    This is yet another variation on the "I need to compute the container for my AD user, so how do I override the identity template?"
    I have a relatively elegant hack (detailed below)...but it is a hack and I am worried about unintended consequences.
    Details:
    I am running an active sync on a database table representing our HR info. Based on info in the table, I am assigning business roles, such as faculty, staff. Those particular business roles contain an IT role which has an AD resource assigned to it. There are different depths in the tree for students (from the student information system, not HR) vs. employees, so I can't hack it by using AD Department and Division attributes in the identity template.
    Unlike many of the other posts, I am not assigning the AD resource directly. That may not matter, but it feels like that gives it even more opportunity to lose track of the information I might compute on my active sync form.
    I have tried a several things. These were the most promising so far:
    1. Setting accounts[AD].identity in the active sync form. Looking with the IDE debugger, it's there and correct when I leave the active sync form. But by the time the Create User process is invoked, accounts[AD] is nowhere to be found in the user. I see it after I step over the provision task, so I'm looking for it in the right place. (Other attributes, like Description, get set in the active sync form, and are also ignored by the time the user is created.)
    2. Something I thought for sure was going to work: I've mapped distinguishedName in the schema, and set it via a rule in the "Set attribute values" under the resources tab of the role. Then I set the identity template to $distinguishedName$. But that failed because it complained that distinguishedName didn't exist.
    Here's the hack: If I use Description instead of distinguishedName in #2 above, it works: the user is created in the correct AD ou. But Description is abused, and that feels like it's going to be trouble someday. Also, setting the identity template to $Description$ is freaky.
    What's the real way to do this? Do I use the hack except with a custom AD attribute so that Description isn't abused? Do I customize a Create User for my active sync form that sets accounts[AD].identity just prior to the provision task?
    Thanks in advance. -Les

    Steve and Paul: good ideas, and good insight. Thanks!
    For the moment, I am going to pursue the path Steve suggested once I verify that I will be able to assign folks to groups outside of the root container assigned to the different adapter instances. (Employees can enroll in classes, and access to course-related objects is by group, therefore there will a group to assign that's outside of someone's root container...) I don't think this is a problem, though.
    Also, I sort of expected that folks wanted something human-friendly in Division and Department attributes ("Business Office" vs. "buso"). I need to use the department code (not name) in the OU because the name is more likely to change over time, and I don't know how to tell the gateway to move a user between AD containers. I've seen references in the forum of doing that by turning an update into a rename operation, but I don't yet know enough about the product to do anything actionable with that piece of knowledge.
    Thanks again! -Les

  • How to override to_number function?!

    Hi,
    I already tried to find an answer by searching this forum but without success...
    My problem is, that I have a lot of mappings using the to_number() function to convert char into number. Now it turns out, that in some cases - due to the bad data qualtity - fields contain special chars e.g. 1234" Don't ask why ;) Of course the reguIar tu_number() function fails on that. Now I wrote a to_number function that handles the issue by removing all the special chars and then convert. I now want to override oracle's built-in to_number function with my own function.
    Do you have any ideas how that works? As a requirement the solution should be simple... It would be an imense work to edit every mapping. I global solution is preferred. Something like a priority option, to take self written functions first or sth...
    Thanks for any help!
    Cheers Steffen

    Hi,
    you could use OMB to change all occurance of that functino in your project.
    Unfortunately I know OWB allmost only from theory :-( but I remember, that you can set a context to a project or a mapping and all subsequent operations will happen within that horizont.
    As far as I saw, OMB isn't to hard to use, even without days of learning, just by looking for fitting operation, but I know documentation about OMB is pretty poor, almost only syntax reference is available.
    really overriding the pre_build to_number-function might be possible as sys, but I would avoid that or only do in a relly play-instance. I suppose you tried allready simply to run 'create or replace ...' ?
    Thanks for your tip about number checking, but I tried allready many variations functions like that. I never can get it validated:
    I have a function is_number_num, returning 1 for ok, 0 for false, which si working fine on SQL*PLUS, but when I use it splitter-condition, in this variations:
    "IS_NUMBER_NUM"( GRP_IN.ANZAHL,'NLS_NUMERIC_CHARACTERS='',.''') = 1
    I get: PLS-00801 internal error [phdxcsql_canonicalize_sql:state]
    with .... == 1
    I get:
    Line 0, Col 0:
    The expression is not properly formed.
    I have no bloody idea, what that means and what might be wrong in here ? Even google does not return 1 singel page for the error-parameter !
    I tried several versions:
    "IS_NUMBER_NUM"( GRP_IN.ANZAHL,'NLS_NUMERIC_CHARACTERS='',.''') = 1
    also this: "IS_NUMBER_NUM"( GRP_IN.ANZAHL) = 1
    but nothing is accepted !
    Also I made a more easy function for checking for date-format, which works fine in SQL*PLUS, but can't be validated in OWB-splitter.
    Oracle support is playing for time since days !
    thsi function brings same error, depending if I use 1 or 2 "=" !???
    any idea ?
    somehow I have the feeling, I missed 1 easy rule on how to use a splitter-condition correctly ?
    But I can't see anything wrong in my constructions, especially because they are working fine in SQL*PLUS !???
    thanks for any hint, LaoDe

Maybe you are looking for

  • Need version to use with Mac OSX 10.4.11

    My laptop runs OSX 10.4.11. Newer version of FFx downloaded but now can't use it. Where can I find a version that will work.

  • Install oracle 9i on Linux Red Hat 8.0 Professional

    Hi all, i need to install oracle 9i on Linux red hat 8.0 professional. I dont know if this platform is certified by oracle and if there are any problem to install that. Any information will be appreciate. Thanks in advance Regards Giuseppe

  • Hana Data Provisioning Adapter Register Error

    Hi, Please help me solve the issue while registering adapter in data provisioning agent configuration. Thanks in advance, Ugandhar Nandam

  • In JDO, can a foreign key be part of a primary key?

    Hi, it's possible to have a foreing key a part of a primary key in JDO? The JDO checker is complaining about that. It says "Primary key field 'person' cannot declare relationship". For example, if I have an entity 'Person' (id, name) and and entity '

  • Create new client in Solution Manager?

    I finished installing Solution Manager 4.0 sp1 for the first time and have the default clients of 000, 001, and 066. I can log on with the SAP* user.  I'm a little confused about the next step. Do I create an addtional client (For example, 100) just