How to use one commandButton  to execute two task in JSF

I have a form in JSF page which contains different faces components. These faces bind to ADF BC to insert one row in the database when the user press commandButton. Also I need to bind the value of one inputText in that form to managed bean to execute another task in the application when the user press the same commandButton.
The code of the inputText:
<h:inputText value="#{bindings.ProjectNumber.inputValue}"
id="pn"
size="10"
required="#{bindings.ProjectNumber.mandatory}">
The code of commandButton:
<h:commandButton actionListener="#{bindings.Commit.execute}"
value="Save"
disabled="#{bindings.Commit.actionEnabled}"/>
The managed bean is “findInspector”. I tried to insert inputHidden inside commandButton tag and assign the value of the inputText to the inputHidden as follows:
<h:commandButton actionListener="#{bindings.Commit.execute}"
value="Save"
disabled="#{bindings.Commit.actionEnabled}">
<h:inputHidden value="#{bindings.ProjectNumber.inputValue}" binding="#{findInspector.project}"/>
</h:commandButton>
But it was not work
Please how can I write the code to use the value of the inputText more than one time in the JSF(one to insert one row by using ADF BC and another to use the same value to bind to a managed bean) and how to use one commandButton to execute two task in JSF.
Thank you
Waheed

Yes I did
<managed-bean>
<description>The bean for get project No</description>
<managed-bean-name>projectBean</managed-bean-name>
<managed-bean-class>
mcscm.model.ProjectBean
</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
<managed-property>
<property-name>bindings</property-name>
<value>#{bindings}</value>
</managed-property>
</managed-bean>
Also I changed the method in the managed bean as follows:
public String commandButton_action() {
FacesContext fctx = FacesContext.getCurrentInstance();
ValueBinding vb = fctx.getApplication().createValueBinding("#{bindings}");
DCBindingContainer dcb = (DCBindingContainer) vb.getValue(fctx);
OperationBinding operation = (OperationBinding) dcb.get("projectNumber");
operation.execute();
return null;
where projectNumber is my method in the java class of the application module "TaskInformationImpl". I made this method to be accessed from outside of ADF BC.
I just create a sample code for projectNumber method for testing only as:
public void projectNumber (String data){
System.out.print(data);
In the page Pagedef file I added this :
<methodAction id="projectNumber"
InstanceName="TaskInformationDataControl.dataProvider"
DataControl="TaskInformationDataControl"
MethodName="projectNumber" RequiresUpdateModel="true"
Action="999" IsViewObjectMethod="false">
<NamedData NDName="data" NDValue = "#{bindings.ProjectNumber.inputValue}" NDType="java.lang.String"/>
After I did all of this I get a new error like:
javax.faces.FacesException: #{projectBean.commandButton_action}: javax.faces.el.EvaluationException: java.lang.ClassCastException: oracle.adfinternal.view.faces.model.binding.FacesCtrlAttrsBinding cannot be cast to oracle.adf.model.OperationBinding
Is it very difficult to do this in JDeveloper?. yes ADF BC provide me a lot of facilities, but when I want to do a specific task I face a lot of troubles

Similar Messages

  • How to use one commandButton to execute two tasks in JSF

    I have a form in JSF page which contains different faces components. These faces bind to ADF BC to insert one row in the database when the user press commandButton. Also I need to bind the value of one inputText in that form to managed bean to execute another task in the application when the user press the same commandButton.
    The code of the inputText:
    <h:inputText value="#{bindings.ProjectNumber.inputValue}"
    id="pn"
    size="10"
    required="#{bindings.ProjectNumber.mandatory}">
    The code of commandButton:
    <h:commandButton actionListener="#{bindings.Commit.execute}"
    value="Save"
    disabled="#{bindings.Commit.actionEnabled}"/>
    The managed bean is �findInspector�. I tried to insert inputHidden inside commandButton tag and assign the value of the inputText to the inputHidden as follows:
    <h:commandButton actionListener="#{bindings.Commit.execute}"
    value="Save"
    disabled="#{bindings.Commit.actionEnabled}">
    <h:inputHidden value="#{bindings.ProjectNumber.inputValue}" binding="#{findInspector.project}"/>
    </h:commandButton>
    But it was not work
    Please how can I write the code to use the value of the inputText more than one time in the JSF(one to insert one row by using ADF BC and another to use the same value to bind to a managed bean) and how to use one commandButton to execute two tasks in JSF.
    Thank you
    Waheed

    Just dopublic void execute() {
        anotherAction(inputValue);
    I guess those articles might be interesting about passing params and the usage of inputHidden and also about using datatables:
    http://balusc.xs4all.nl/srv/dev-jep-com.html
    http://balusc.xs4all.nl/srv/dev-jep-dat.html

  • How to use one Bex Variable for two purposes in one query?

    Hi,
    I want to prompt for a UOM in a query. Then I want to use that one UOM variable to do 2 tasks in the query:
    1. Perform a UOM conversion on one restricted key figure (no filtering)
    2. Filter in a second restricted key figure (no conversion)
    How would I use a variable (or two?) to do this? I do not want to have 2 UOM prompts.
    Thanks!
    Gregg

    Oh, it all seems so easy now!  Hindsight 20-20...
    Solution was to create a new input ready variable for Unit.
    1. Restrict the key figures which need restricting using new variable
    2. For conversions, in BI backend us T-code RSUOM and create new conversion type associated with new variable. Then for each key figure needing conversion, set the conversion parameter to use the new conversion type.
    Between both 1 & 2 above, the same variable is used & thus prompted only once.
    Solution works perfectly.... as it should. Hope this helps someone else!

  • How to use one form to update two tables

    How can I do that? HTMLDB wizard or form on table doesn't give me an option to use more than one table in a form or I don't know about it. I created new process which redirects the form to another page after submitting the form. On the second page I created new process which uses the same variables from the previous form page. This process runs on page load before header but it is just not working right.
    So, what is the proper way to update two tables with the same form fields?

    Hello Vikas,
    "The Automatic Row Fetch and Automatic DML processes are a pair, you can't have one without the other."
    Are you sure about that? I have a page, which populate some of the items from TableA, using manual select statement, and after the user input, save some of it in TableB, using Automatic DML. No ARF in this process and it seems to work just fine. Come to think of it, what about a simple form, populated entirely by the user input, and then being saved to the db, using Automatic DML? No ARF here also.
    For the problem in hand, if you can't have more then one Automatic DML per page, I think that the simplest solution will be to define a pl/sql process, with two INSERT statement to the two different tables.
    Regards,
    Arie.

  • How can I set up a wi-fi network, using one time capsule and two airport express

    how can I set up a wi-fi network, using one time capsule and two airport express ?
    The time capsule is near the Mac. ok
    The first Airport is on the corridor, ok, works well and the App on the iPad signals so, ok
    But when I plug the next Airport on another room nearby nothing happens, and signals disconected ....
    is the signal so weak that is not able to go to ono room to the other ?

    Well, even if you have the first express set up to extend the network, the second express can only extend from the TimeCapsule.
    Maybe you got walls of sheetrook in the way, or kitchen/bathroom tiles, etc, dampening the signal rapidly.

  • Using one Itunes database across two macs

    Using one itunes database across two macs
    I currently run a 2010 MBP (500gb hd) at home and on the road and a 2013 Imac (1Tb hd) at work. I have a large lossless itunes library of about 300gb and would like to increase the library further.
    My MBP started running slowly and I realised that my iTunes library was choking the whole computer. I started to explore ways to store my library on a remote disk and bought a G drive 1Tb portable drive.
    My efforts to carry out the transfer were only partially successful with most of my library transferring but a significant number of tracks displaying the ! sign which means they couldn't be located.
    I have also got an Imac at work and what I had hoped to achieve was to have my iTunes database on the 1tb portable drive and use the portable disk on both my MBP and iMac.
    Our technical support company are dubious about whether this will work because the local specific itunes library data on each machine will differ and each machine will not operate correctly with the underlying data on the portable drive.
    I am not very technical and I am finding it difficult to follow the various posts on this board and elsewhere. Many seem to comment on splitting their library across multiple disks but I cant really seem to get to the bottom of storing my library on one disk and using it across multiple computers.
    Is what I am trying to achieve practical?
    If it is, can someone point me to an article/post please? Or alternatively could someone explain how I might achieve my goal.
    Thanks in a advance for your help.

    Here you go.
    http://lifehacker.com/software/itunes/ultranewb--how-to-move-your-itunes-library -to-an-external-drive-238296.php

  • Can I use one phone number on two iphones with two apple ids?

    My carrier allows multiple sim cards with the same phone number for usage on different devices. I would like to use a second sim card for my phone number on a second iphone, but with a different apple id.
    Is it possible to use one phone number on two iphones with separate apple ids? How does this affect facetime/imessage?
    I can only find answers to using the same apple id on multiple devices. This works fine, but is not what I want to do here.

    You may be able to change the suspicious account activity message alerts
    in your Gmail settings, and check that side of it, since I can use several
    means of accessing my Gmail and Google Accounts; and in the past had
    shared an account (not google) with another party half a world away when
    her email server went down for a month.
    The Mail software should not know the difference, unless the setup in there
    is not correct; if this is so, then more than what she says would be wrong.
    The Google mail Support help site pages should cover this adequately.
    Gmail Help - Google Help
    https://support.google.com/mail/?hl=en

  • Can I use one iCloud account for two phones without sharing contacts

    Can I use one iCloud account for two phones without sharing contacts

    If so how do I unmerge the two phones?

  • How to use one email adress for multiple recipients

    Hello,
    I'd like to know how to use one email adress for multiple recipients. 
    this would be very useful or projects. for example;
    if i send one mail to [email protected], all people in this project get an email.
    I will add the people in this project myself. 
    I know it is possible, but I don't know how to do it ;-)
    please help me! 

    Hope this help.
    _http://technet.microsoft.com/en-us/library/cc164331(v=exchg.65) .aspx

  • HT204053 Can I use one Apple ID for two Apple IPhones?

    Can I use one Apple ID for two Apple IPhones? I received an answer of yes.
    Now another question.  I have one ICloud Account, Two IPhones.  Can I use Find my IPhone via the one ICloud Account?  Can I see two IPhones on the map at the same time?  or do I need to view the second phone via some other method.
    Message was edited by: Hunter3D

    Yes.
    Cheers,
    GB

  • How to use one report column into the another report in obiee

    How to use one report column into the another report in obiee

    i dont want to use column as a filter for another report it should be report column for another report
    Thanks,
    Vivek

  • Use one store account for two I pads. Get request for security code

    Trying to use one store account for two I pads. One works fine, the other is unable to download a free app, window asks for security code.?.......
    What security code?

    Probably the security code on your credit card

  • Is it ok to use one apple id for two devices ?

    is it ok to use one apple id for two devices ?

    Here's the deal: The SLA permits the "sharing" of content with up to 5 family members in the same household. Any other distribution of content is considered stealing...the SLA does not give you the right to distribute content in any way, shape or form. Its really that simple, and "friend" is NOT a family member living in the same household.

  • TS4268 i use my apple id that i create it for my iphone 4 on my new iphone 5,then i want to activate the imessage but i can't.what should i do?i want to know i can't use one apple id for two iphone 4 & 5?

    i use my apple id that i create it for my iphone 4 on my new iphone 5,then i want to activate the imessage but i can't.what should i do?i want to know i can't use one apple id for two iphone 4 &amp; 5?

    HI
    I was trying to take my Mac air to factory default settings.
    I've done all that it says in the documment i was following, and them during the process it asked me the APPLE ID.
    I put the apple id i have in my iphone. But it's not the one... it's said that i don't have any OSX associated with it... so it can not install the OSX.
    So what can i do?

  • How to link one scroll bar with two dynamic text boxes.

    How to link one scroll bar with two dynamic text boxes.
    If i move scroll bar in one text box,automatically text will
    be moved in another text box.But scroll bar is not visible.
    Can you please help me.
    Thanks in advance.

    See the following article:
    JavaScript - setFocus Method for tabbing to next form field
    And see if iOS can even handle the sample form.
    iOS and android devices are not a powerful as your desktop of laptop computer and have limited support for JavaScript within PDF forms. This limitation for specific apps ranges from none to quite a bit but not all JavaScript.

Maybe you are looking for