I want to have access from my backing bean to attributes

Hi,
I have a table PERSON with the columns ID (PK), FIRST_NAME, LAST_NAME and SALUTATION_ID (FK).
I have a second table SALUTATION with the columns ID and NAME.
I do use the following lines of code if I want to make changes to the PERSON table and it works fine.
DCBindingContainer dcBind = (DCBindingContainer)getBindings();
DCIteratorBinding iterBind = (DCIteratorBinding)dcBind.get("PersonCollectionIterator");
iterBind.getCurrentRow().setAttribute("FIRST_NAME", "Tobias");
dcBind.getOperationBinding("mergeEntity").execute();
My problem is, that I can't change the SALUTATION_ID of PERSON. I don't have access to that attribute. I did use the following line of code to print out all the available attributes and it only showed ID, FIRST_NAME and LAST_NAME.
iterBind.getCurrentRow().getAttributeNames()
What could I do?
Thank You
Tobias

Hi!
I assume that you use EJBs. Then, you have no foreign keys in your parent entity (Person). Instead you have a mapping to the related entity (Salutation) by which you can access a salutation for a person like this (I'm using EL for simplicity):
Person p = resolve("#{PersonCollectionIterator.currentRow.dataProvider}");
Salutation s = p.getSalutation();
and you can set a salutation by:
p.setSalutation(newSalutation);
where newSalutation is an salutation entity you somehow retrieved from your model. For example, if you enter salutation ID in text box on your page, then in backing bean button action listener you should call findSalutationById method in Fascade which returns a newSalutation entity and then set that new salutation as above. After that, you have a new salutation mapped to person and you can invoke mergeEntity on you Fascade.
Hope this helps.
PaKo

Similar Messages

  • Database access from Managed/Backing bean

    Hi,
    I would like to authenticate web users from a database table, I get the account details
    in the Welcome page, I wish to check if the user exists in the table (from the managed bean), how do I do this?
    Is this good practice to access the db from managed bean? If not how do I do this in model component and pass the value back and forth from managed bean?
    Thanks,
    Jai.

    Hi
    You can get all the information of logged in user from SecurityContext(you can get this either from ADFContext using ADFContext.getCurrent().getSecurityContext() or using EL expression eg. #{securityContext.userName} shows logged in user name)
    API: http://download.oracle.com/docs/cd/E15051_01/apirefs.1111/e10686/oracle/adf/share/security/SecurityContext.html#method_summary
    More details on enabling security: http://download.oracle.com/docs/cd/E12839_01/web.1111/b31974/adding_security.htm#BGBCEDDD
    Sireesha

  • I have been using my husband's apple id in my old PC. When I purchased a MacBook Pro, I created my own. Because I wanted to have access to my old purchases, I changed my husband's original ID's e-mail address to my e-mail address. Now I can't update s/w.

    I have been using my husband's apple id in my old PC (ID A). When I purchased a MacBook Pro, I created my own Apple ID (ID B) and started using my laptop and updating the S/W with this ID.
    Because I wanted to have access to my old purchases, I changed my Apple ID's e-mail to another e-mail that my husband uses (ID B->ID C).
    Then I changed my husband's original Apple ID's e-mail address to my own e-mail address (ID A->ID B).
    Now I can't update any s/w through the Apple Store and I get the message that "Sign in to **********@hotmail.com to update applications for that account.". The e-mail address is ID C. How can I associate my laptop in the AppStore with ID B which is the one that have all my purchased applications and contains my own e-mail address?
    I would appreciate your reply.
    Dimitra

    You are trying to find a loophole to circumvent a basic rule that prohibits the transfer of purchased content from one Apple ID to another.
    Content tied to an Apple ID are bound to that Apple ID forever. You can not merge or trade accounts. Well, not (officially) anyway...

  • Accessing a JSF element from a back bean method

    Hi,
    short question, can I access the JSF element from a back bean method?
    So, for example, if I have the following JSF code:
    <h:panelGroup id="test1" rendered="#{bean.someMethod}">...</h:panelGroup>
    <h:panelGroup id="test2" rendered="#{bean.someMethod}">...</h:panelGroup>
    <h:panelGroup id="test3" rendered="#{bean.someMethod}">...</h:panelGroup>
    Can I found out in some way, which element (esp. which ID) calls the someMethod-method?
    Kind regards
    Matthias

    There are more possibilities as well. If you depend it on for example the User's rights/groups, then you can also do for example:
    rendered="#{user.admin}" // getter = public boolean isAdmin()
    rendered="#{user.groupName == 'admin'}" // getter = public String getGroupName()
    rendered="#{user.groupId > 1}" // getter = public int getGroupId()
    rendered="#{fn:contains(user.groups, 'admin')}" // getter = public String[] getGroups() or public List<String> getGroups()
    etc..I think it's after all just a matter of learning about the capabilities of EL a bit more.

  • I no longer have access to the back up email address I used when I set up my apple ID. I have since forgotten the answers to my security questions and am having a problem making changes to my account. What can I do?

    I no longer have access to the back up email address I used when I set up my apple ID. I have since forgotten the answers to my security questions and am having a problem making changes to my account. What can I do?

    You need to ask Apple to reset your security questions. To do this, click here and pick a method; if that page doesn't list one for your country or you're unable to call, fill out and submit this form.
    They wouldn't be security questions if they could be bypassed without Apple verifying your identity.
    (114957)

  • I wish to download (and use of course) Creative Cloud on my NAS to be able to have access from various locations using my laptop PC and tablet. Does anybody know whether this is possible? So the programm software at the NAS and operate it from there.

    I wish to download (and use of course) Creative Cloud on my NAS to be able to have access from various locations using my laptop PC and tablet. Does anybody know whether this is possible? So the programm software on the NAS and operate it from there.

    OK, thanks
    but EULA ?? what does it stand for? I am pretty new to all this so good to learn something.
    ps. backgroud of my request is, that I purchased LR in a box in 2013. The computer where this is on, is at the end of its life and I have no LR box with License or any reference nr's anymore.
    Copied to my new Laptop, which maybe is not allowed if I understand you correct, it didn't work.
    Pitty, because afterall it is still my legally relatively recent purchased LR version.
    I thought to overcome this problem in future by putting it on my NAS. Safe for many years to come.
    again any knowlegeable feedback is welcome to me.
    Jos

  • Calling servlet from a backing bean

    hi guys i need to call a servlet from a backing bean in JSF. how do i do that ?
    The scenario is i have to call servlet on a different machine from my backing bean . I also need to pass an object to the servlet .
    This object contains data which must be manipulated and inserted in the database by the calling servlet.
    I also want that after insertion in the db the control must be passed to the backing bean .
    Is this all possible???
    Please help

    You may want to investigate the built in java.net.URL class. For advanced needs, Apache has a Java HTTP client library.

  • How to set values in a CoreTable programmatically from a backing bean

    Hi,
    One of the columns in my CoreTable is "af:inputText" field, I need to set the value of inputText field in each row from a backing bean.
    I have bound this table to a component in the bakcing bean and in the setMyCoreTable method I'm also preselecting certain rows. For all the preselected rows I need to set a value in the inputText field.
    Can someone point me to some code samples or give me some ideas to solve this.
    Thanks

    Thanks dvohra,
    I looked at the post you suggested yesterday, but I wasnt sure how I can implement that in my case.
    Since Im programatically preselecting certain rows in the setMyCoreTable method(which is the accessor method), I was hoping I could prepopulate the input text field as well in the same method.
    For your reference below is the code from jspx and the backing bean.
    <af:table value="#{bindings.ProgramComponentList.collectionModel}"
    var="row"
    rows="#{bindings.ProgramComponentList.rangeSize}"
    first="#{bindings.ProgramComponentList.rangeStart}"
    emptyText="#{bindings.ProgramComponentList.viewable ? 'No rows yet.' : 'Access Denied.'}"
    selectionState="#{bindings.ProgramComponentList.collectionModel.selectedRow}"
    selectionListener="#{bindings.ProgramComponentList.collectionModel.makeCurrent}"
    binding="#{backing_EditProgramBean.compsTableComponent}">
    <af:column sortProperty="Name" sortable="true"
    headerText="#{bindings.ProgramComponentList.labels.Name}">
    <af:outputText value="#{row.Name}"/>
    </af:column>
    <af:column sortProperty="Description" sortable="true"
    headerText="#{bindings.ProgramComponentList.labels.Description}">
    <af:inputText value="#{row.Description}" simple="true"
    required="true"
    columns="30"/>
    </af:column>
    <f:facet name="selection">
    <af:tableSelectMany id="tableSelectMany1"/>
    </f:facet>
    </af:table>
    CODE FROM BACKING BEAN ---------
    public void setCompsTableComponent(CoreTable compsTableComp) {
    ManageProgramsServiceImpl serviceImpl =
    (ManageProgramsServiceImpl)JSFUtils.get("#{bindings.ProgramDetailIterator.dataControl.dataProvider}");
    ViewObject searchProgramView = serviceImpl.findViewObject("SearchProgramView");
    Row currProgram = searchProgramView.getCurrentRow();
    ViewObject view = serviceImpl.findViewObject("ProgramComponents");
    view.setWhereClause("ProgramsComponents.PROGRAM_ID = " + currProgram.getAttribute("ProgramId"));
    view.executeQuery();
    view.setRangeSize(view.getRowCount());
    view.executeQuery();
    Row[] programComponents = view.getAllRowsInRange();
    RowKeySet rks = new RowKeySet();
    ViewObject compTypesView = serviceImpl.findViewObject("ProgramComponentList");
    compTypesView.setRangeSize(compTypesView.getRowCount());
    compTypesView.executeQuery();
    Row[] compTypes = compTypesView.getAllRowsInRange();
    for (int i = 0; i < compTypes.length; i++) {
    String code = compTypes.getAttribute("Code").toString();
    for(int j=0; j<programComponents.length; j++){
    String programCode = programComponents[j].getAttribute("ComponentType").toString();
    if(programCode.equalsIgnoreCase(code)){
    rks.getKeySet().add(compTypes[i].getKey());
    compsTableComp.setSelectionState(rks);
    List li = compsTableComp.getChildren();
    System.out.println("****** li : " + li.size());
    //System.out.println("****** row count : " + compsTableComp.getRowCount());
    //System.out.println("****** count : " + compsTableComp.getRows());
    this.compsTableComponent = compsTableComp;
    The table children size(li.size()) comes up as zero and [compsTableComp.getRowCount()] gives an exception. Can you please provide any help. Seems like Im off track with this whole thing.
    Thanks

  • Is it possible to call a custom method in App Module from a backing bean?

    I would like to know if a custom method in App Module can be called from inside a backing bean.
    I am not sure if it is logically right to call, from a backing bean, a custom method in App Module. But would like to know if that makes sense or if it is possible.

    Hi..
    Yes it is possible.You have to add that method for client interface of AppModule.Now you can see that method in Data Controls(Refresh the data control). To call this method using bean it should add as method action to bindings(Click Bindings>+>methodAction>and Create action binding).
    Now you can call this method in bean class.
    Check following example use this concept to execute view criteria
    http://adf-lk.blogspot.com/2011/05/oracle-adf-create-view-criteria-and_4727.html

  • Error when I call a method of AppModule from a backing bean.

    I use Jdeveloper 10.1.3.0.3 EA.
    In my application I have created ApplModule and UsrView(for my table USR).
    I have a login page (login.jsp and the backing login.java) with 2 fields userName and password and an ADF Faces Core command button (cmdCheckPass) and the method cmdCheckPass _action() for the click event .
    The problem is that I can’t call method testPassword(userName, password) which is written in AppModule. (I get error:
    javax.faces.FacesException: #{backing_login.cmdCheckPass_action}: javax.faces.el.EvaluationException: java.lang.NullPointerException) from line:
    answer = app.testPass(st1,st2);
    The code is as follows:
    public String cmdCheckPass_action() {
    String answer="";
    String mes = "";
    String st1=this.getInputText1().getValue().toString();
    String st2=this.getInputText2().getValue().toString();
    AppModuleImpl app = new AppModuleImpl();
    answer = app.testPass(st1,st2);
    if (answer == "OK") {
    return "toMain";
    } else {
    answer = "";
    mes="Invalid username, password !!!";
    FacesContext.getCurrentInstance().addMessage(null,new FacesMessage(mes));
    return answer;}
    I don’t know if theoretically is right to call, from a backing bean, a custom method of AppModule.
    Can I have any help on this?
    Thanks in advance,
    Panos

    Some quick ideas:
    Is the clip the same NTSC/PAL standard as the project you are importing it to?
    Have you tried to rename the offending clip (do NOT rename any clips inside the iMovie /Media folder!!).
    How much free space do you have on the iMovie project volume -- what is the size of the imported clip?

  • The difference in calling an application module from a backing bean

    Hello everybody!
    I don't understand exactly, where is the difference in calling an application module from a backing bean in the following ways.
    Example 1
    FacesContext context = FacesContext.getCurrentInstance();
    ValueBinding vb = context.getApplication().createValueBinding("#{data}");
    BindingContext bc = (BindingContext)vb.getValue(context);
    DCDataControl dc = bc.findDataControl("AppModuleDataControl");
    AppModuleImpl appModule = (AppModuleImpl)dc.getDataProvider();Example 2
    String amDef = "model.services.AppModule";
    String config = "AppModuleLocal";
    AppModuleImpl appModule = (AppModuleImpl)Configuration.createRootApplicationModule(amDef, config);Example 3 (the same like Example 1???)
    String EL = "#{data.AppModuleDataControl.dataProvider}";
    FacesContext fc = FacesContext.getCurrentInstance();
    ValueBinding vb = fc.getApplication().createValueBinding(EL);
    AppModuleImpl appModule = (AppModuleImpl)vb.getValue(fc);Please can anybody explain, what the three examples do? Which example is preferred to call an application-module-method from a backing bean?
    Thanks and regards
    Majo
    Edit: I am using ADF BC 10g in JDev10 :)

    Hi :)
    >
    This could work, but can you describe the use case for which you need to get the ApplicationModule?
    Maybe we can find a better way to implement your functionality.
    >
    Sure, i know a lot of better ways to implement the same functionality too but its a huge project, its not my code and we have no time to reimplement this functions ;)
    Frank, i don't understand the first line of your code.
    DCBindingContainer bindings = ... resolve #{bindings}Where do i get the bindingContainer, if I don't have the "JSFUtils"- or "ADFUtils"-classes?
    Regards
    Majo
    Edit:
    Sorry, i have answer, before i think about it ;)
    FacesContext context = FacesContext.getCurrentInstance();
    Application app = context.getApplication();
    DCBindingContainer bindings = (DCBindingContainer)app.getVariableResolver().resolveVariable(context, "bindings");
    BindingContext bctx = bindings.getBindingContext();
    DCDataControl dc = bctx.findDataControl("AppModuleDataControl");
    AppModuleImpl am = (AppModuleImpl)dc.getDataProvider();or in my backing bean, when i add the property to the faces-config.xml
    DCBindingContainer bindings = this.getBindings();
    BindingContext bctx = bindings.getBindingContext();
    DCDataControl dc = bctx.findDataControl("AppModuleDataControl");
    AppModuleImpl am = (AppModuleImpl)dc.getDataProvider();Is this right?

  • Call a Function From a Backing Bean

    Hello,
    I am trying to call a PL/SQL function from a Backing Bean but i am getting a getDBTransaction error. Here is the example i was trying to do in a backing bean.
    I Am getting the employee ID , sending it to a function that calculates the annual salary and then through a button whose code is in the backing bean, showing a message on the screen with the annual salary.
    I am getting the JBO-25301 error.
    Can't i use getDBTransaction in my backing bean.

    Please have a look at the following thread:
    Stored Procedure

  • Redirect from JSF backing bean to another application

    Hi,
    I need to open another (non-JSF) application in a new window from the backing bean of my JSF application.
    My JSF application is in frames. - heading, menu, content.
    I've a commandlink in the menu frame.
    I tried with
    FacesContext.getCurrentInstance().getExternalContext().redirect(loginUrl);
    This is opening in the menu frame itself.
    I tried using target="new" , but no result.
    I also need to pass the userId to the external application.
    Any ideas?
    ~Thanks.

    Thanks.
    Yes, GET works. I used a <h:outputLink and used target="new" and
    window.open("url?userId=someId")
    But i donot want to pass userid in GET in the url, since that is a sensitive information.
    Please let me know if there's any other way.
    Thanks,

  • How to remove OLD mobile number (I don't have access) from iMessage?

    Hello,
    I have a problem which I could not find a solution for it yet, Please help me if you had an experience on this matter.
    I can not remove the mobile number I DO NOT have now from iMessage.
    I did try to disable/enable iMessage many times but had no luck on it. After activating the iMessage with new number,
    I can still see the old mobile number in the list of [ YOU CAN BE REACHED BY IMESSAGE AT ] in the Setting>iMessage>Send&Receive.
    I don't want to see my old phone number there. I don't have access to this number any more.
    I noticed apple recently created a new tool to de-associate the iMessage from phone number, but this tool will send a text message
    to the number to be able to de-associate it!!! [ Well I don't have that number to be able to get the text ]
    Probably apple did not think about this situation yet and I have to wait for another 10 years for new tool.
    Please help me in this regard.
    Many thanks,

    Kheradmand wrote:
    Hello,
    I have a problem which I could not find a solution for it yet, Please help me if you had an experience on this matter.
    I can not remove the mobile number I DO NOT have now from iMessage.
    I did try to disable/enable iMessage many times but had no luck on it. After activating the iMessage with new number,
    I can still see the old mobile number in the list of [ YOU CAN BE REACHED BY IMESSAGE AT ] in the Setting>iMessage>Send&Receive.
    I don't want to see my old phone number there. I don't have access to this number any more.
    I noticed apple recently created a new tool to de-associate the iMessage from phone number, but this tool will send a text message
    to the number to be able to de-associate it!!! [ Well I don't have that number to be able to get the text ]
    Probably apple did not think about this situation yet and I have to wait for another 10 years for new tool.
    Please help me in this regard.
    Many thanks,
    If a mobile phone number is not used for iMessage for about 45-60 days, it should automatically be removed from association to the Apple ID used for iMessage.

  • I recently backed up my iPad and then I restored it to factory settings. Now, I want to restore it from the back up that I created, but it will not accept my Apple ID password. Is there any way that I can save my data?

    Hi,
    As I have said in the title, I was supposed to do a restore on my iPad for work. I backed up the device and then I restored it to factory settings as I was instructed. Now that all of that is complete, I tried to restore it from the back up point I created and it will not recognize my Apple ID password.  I really hope that I won't lose all of my data, but I don't know what else to do. I have tried entering my password numerous times. I really hope that someone can help me.

    Restoring an iPad from an iTunes-generated backup should not require an Apple ID password.
    Did you encrypt the iPad backup? If so, then trying to restore will require entering the encryption password.

Maybe you are looking for