Sitemap

Amicuk Programming Answers

Passing inputText value with command Button

-0001-11-30   Views:3

Advertisement

Hi, As i am new in JSF i dont know how to pass my inputtext value to backing bean with my commandbutton... My JSF code is. <h:form id="form3">           <h:outputLabel for="" id="OL_Select_Case" value="Select Ca

Hi,
As i am new in JSF i dont know how to pass my inputtext value to backing bean with my commandbutton...
My JSF code is.
<h:form id="form3">
          <h:outputLabel for="" id="OL_Select_Case" value="Select Case" style="background-position: 100%; background-repeat: repeat; width: 100%; background-color: Gray"></h:outputLabel>
          <br>
          <h:inputText id="I1_Select_Case" value="#{ComplaintDetailsBean.caseNo}"></h:inputText>          
          <h:commandButton id="C1_Select_Case" value="Select Case" style="background-color: transparent;" action="/Maintanance1.faces"></h:commandButton>
          <br>
          <br>
          <h:inputText id="I2_Select_Owner"></h:inputText>
          <h:commandButton id="C2_Select_Owner" value="Select Owner" style="background-color: transparent ;"></h:commandButton>
          <br>
          <br>
          <h:selectOneMenu id="sel_owner" value="#{OwnerBean.owner}">
          <f:selectItems id="sel_item_owner" value="#{OwnerBean.perInfo}"/>          
          </h:selectOneMenu>
            <h:commandButton id="C3_Assign" value="Assign" style="background-color: transparent;" action="#{OwnerBean.getDetailThree}">
          <f:param name="caseNo_owner" value="#{ComplaintDetailsBean.caseNo}" id="caseNo_owner"/>
          </h:commandButton>
     </h:form>
     I want to pass value of inputtext "I1_Select_Case" with my commandbutton "C3_Assign" to my backing bean i.e. "OwnerBean.java"
I have used here param tag....but its not working ....
Plz suggest me...
Regards.
Shrikant.

The replay answer
Advertisement
No its still not working.My JSF code is....
     <h:form id="form3">
          <h:outputLabel for="" id="OL_Select_Case" value="Select Case" style="background-position: 100%; background-repeat: repeat; width: 100%; background-color: Gray"></h:outputLabel>
          <br>
          <h:inputText id="I1_Select_Case" value="#{OwnerBean.comCaseNo}"></h:inputText>          
          <h:commandButton id="C1_Select_Case" value="Select Case" style="background-color: transparent;" action="/Maintanance1.faces"></h:commandButton>
          <br>
          <br>
          <h:inputText id="I2_Select_Owner"></h:inputText>
          <h:commandButton id="C2_Select_Owner" value="Select Owner" style="background-color: transparent ;"></h:commandButton>
          <br>
          <br>
          <h:selectOneMenu id="sel_owner" value="#{OwnerBean.owner}">
          <f:selectItems id="sel_item_owner" value="#{OwnerBean.perInfo}"/>          
          </h:selectOneMenu>
            <h:commandButton id="C3_Assign" value="Assign" style="background-color: transparent;" action="#{OwnerBean.getDetailThree}">
          <f:param name="caseNo_owner" value="#{OwnerBean.comCaseNo}" id="caseNo_owner"/>
          </h:commandButton>
     </h:form>
     My OwnerBean's code is:-
public String getCaseNo() { 
return caseNo; 
public void setCaseNo(String caseNo) { 
this.caseNo = caseNo; 
public String getComCaseNo() { 
     return com.getCaseNo(); 
     public void setComCaseNo(String caseNo) { 
     com.setCaseNo(caseNo); 
public String getDetailThree() { 
     FacesContext context = FacesContext.getCurrentInstance(); 
     HttpServletRequest myRequest = (HttpServletRequest)context.getExternalContext().getRequest(); 
     HttpSession mySession = myRequest.getSession();         
     //String caseNo = myRequest.getParameter("case_No");
     setCaseNo(myRequest.getParameter("caseNo_owner"));
     String owner2=getOwner();
     System.err.println(">>>>>>>>>>>>>>>>>BACKING BEAN ENTITYDETAILS>>>"+getComCaseNo()+"||||"+owner2);
     //javax.servlet.RequestDispatcher dispatcher = getServletContext().getRequestDispatcher("/complaintDetailsPop.faces");
     //String custName= request.getParameter("Name");
     //System.out.println("Name = "+custName);
     //request.setAttribute("Customer_Name","Irfan");
     //request.setAttribute("First_Name","Shrikant");
     //dispatcher.forward(request,response);
     //FacesContext fc = FacesContext.getCurrentInstance();
     //ServletContext sc = (ServletContext) fc.getExternalContext().getContext();
     //myRequest.getSession().setAttribute("entity_ID",entityID);
     //sc.getRequestDispatcher("/Assign_Case.faces");          
     //========---------------********************************************************----------------------------------
     return("getdetails"); 
     //String entityID = getFacesParamValue("entityIDParam"); 
     }Plz suggest me....

Go to See the other 15 answers

Passing inputText value with command Button

Category:DefaultRelease time:-0001-11-30Views:130

Hi, As i am new in JSF i dont know how to pass my inputtext value to backing bean with my commandbutton... My JSF code is. <h:form id="form3">           <h:outputLabel for="" id="OL_Select_Case" value="Select Ca[More]

Execute command button after user tabs out of inputtext

Category:DefaultRelease time:-0001-11-30Views:130

All, I have a command button which is used to call a webservice. This works fine. I also have an Inputtext field. What I want is to execute the action when the user tabs out of the inputtext. Does any one have the solution for me ? I've not yet been[More]

Command Button action is bean method.How to pass parameter or reference ID?

Category:DefaultRelease time:-0001-11-30Views:130

JDEV11gR1PS1/ADF A command button action's is bean method, as follows: <af:commandMenuItem id="gbl_cmi_1" action="#{tbBean.action1}"/> Bean code is something like public String action1() throws IOException { if (id.equals.("[More]

How to get the page request parameters in Command Button code

Category:DefaultRelease time:2015-10-11Views:130

Hi everyone, I am new to JSF and working on some Command Buttons. I put my java code via Edit Event, it works fine. But I don't know how to get some parameters from HttpServletRequest. Can anyone give some guidance? It would be much appreciated. Mike[More]

ADF/JSF page loads when any command button is clicked

Category:DefaultRelease time:2015-10-11Views:130

Hello All, I am lost in the ADF/JSF page flow (using Jdev 10.1.3). Following are the tags (in order) in my page; (WHEN THIS PAGE LOADS, IT GOES TO THE DATABASE TO GET VALUES (for the drop down lists that will appear on the page); THIS SHOULD HAPPEN J[More]

How to get the command button component id  in bean class?

Category:DefaultRelease time:-0001-11-30Views:130

Hi All, I'm using adf 11g. I'm having three command button , which have some similar code to use on fire of these buttons. if it possible to catch the component id in bean , i can use the code with little parameter passing .Hi, You can get the comman[More]

HELP using command button in J2ME

Category:DefaultRelease time:-0001-11-30Views:130

Hi I am trying to create a simple code using the command button, but when i try 2 run my program, it gives the following error: java.lang.ClassCastException      at test1.startApp(+81)      at javax.microedition.midlet.MIDletProxy.startApp(+7)      a[More]

ADF: defaultCommand doesn't invoke command button onClick

Category:DefaultRelease time:-0001-11-30Views:130

Given the following: <af:form id="findForm" defaultCommand="findButton">    <af:inputText ... />    <af:commandButton id="findButton" onclick="doFind(); return false;" /> </af:form>Is it a kn[More]

Conditionally Display ADF Command Button

Category:DefaultRelease time:-0001-11-30Views:130

I have an ADF table with a select option. I have a command button that executes a query titled "View Detail". I want the button to display but I only want it enabled when the Item Name column in the selected row of the table appears in a separat[More]

JDev 10 - disable command button depending on which row is selected

Category:DefaultRelease time:-0001-11-30Views:130

I am using JDeveloper 10, and I have a table which has some data columns and a selection facet with View and Edit command buttons. I would like all rows to be viewable. When you click the view event it goes to another .jsp with the view action. It do[More]

Popup Command Button - ActionListener not accessed

Category:DefaultRelease time:-0001-11-30Views:130

Hi there, I'm working with the JDeveloper 11.1.1.6.0. I have a view in a popup. Which creates a new empty row, if there could not be found any data in the database. So far so good. When i know enter some values and then click a command button the val[More]

Hot
I am having problems with sound. My speakers will switch from internal speakers to Apple TV for no reason when I am on a certain wifi network and ask for a password. I do not have an apple TV and in order for the sound to come out on the internal spe [More]
Hello! I am new to javascript and Acrobat 9 Pro. I have multiple documents emailed to me in a day and need to send/track each one individually. Can this be done using the Batch Processing javascript as a Shared Review? I have tried adding a button to [More]
I have been trying to create a large pdf of a manuscript that contains 161 pages. Printer screen says all the pages are there, but when I click on Save as PDF, it breaks the file into 2 pieces. At first it trimmed off the last four pages and put them [More]
after updating to iPhoto9.6 an error occurred and the iPhoto icon says it is downloading. The library seems okPerhaps you need to wait for the download to finish. If it's going on for a long time then cancel it (which you can do in Launchpad) and try [More]
Th icon in the bottom says I have updates {or 6 months now I have clicked on this to no avail). I click, the files download but do not install. Errorcode suggests it cannot find software is looking for past products to verify upgrade updates. The CS5 [More]
Just got my HTC One  I'm running KK with the latest Sense 5.5, stock.  I love the phone and I'm getting used to using BlinkFeed and like it alot.  However, the one thing that has never worked is the Gallery in the Blinkfeed.  I have photos on my phon [More]
Hi, with Photoshop CC, is there any important new development about Bridge CC? I am *mainly* interested in news concerning the final shipping versions available to everybody, not any pre-release versions for insiders. So far, regarding Bridge i colle [More]
I'm using OS X 10.9.2 and no upgrades in the App Store.... When I try to open it, it shows "You can't open the "iPhoto" app because it is not compatible con this type of Mac. Could someone help me? Thx!!What version of iPhoto do you have?  [More]
Hi, Using I/O classes I want to prepare a .doc file in which some text will be there. I want that text to be formatted. Like some text I want to be bold. Some text to be italic. How can I write bold/Italic text to the file using java I/O classes. Tha [More]
(I have by mistake posted this as well on SMB wireless area) Hi Collegues. My  question is very simple - from wich source does the WCS application  inherit the time and daystamps when generation and printing guest user  accounts? I have tried changin [More]