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 live in the sticks...very RURAL...No cable or Broadband available, only Dial-Up for internet connection.... ...Is it possible to connect my iMac with my AT&T cellular 3G iPhone account. I have a cellular signal booster which provides me with a very [More]
Hello, I am facing a strange issue. I created an extended classic PO. It is properly replicated in the backend. But the table BBP_PDBEI is not getting filled. The only details I found in BBP_PD were BE_OBJECT_TYPE as BUS2201 and BE_OBJECT_ID as 1. BB [More]
hi everyone,i have been using OBI EE for the past 2 months.I have been using Oracle 10g database as a data source for OBI EE and it worked just fine and now im trying to use SQL server 2005 as my data source. My ODBC was succesful and i can import fr [More]
Open task manager in XP when booting any Adobe software product.  CPU usage skyrockets and Acro32 just keeps increasing and increasing until I run out of memory.  I have tried all sorts of antivirus, malware, rootkits ... to no avail.  Foxit works to [More]
So I just installed CS5 on a newly formatted PC. I didn't used to have this problem before before I completely formatted on HDD do to a virus + reinstalled Windows7, although now its getting on my nerves. Basically when I zoom in the dodge tool circl [More]
HI guys, in the wizard I am unable to see the tables which I need to use for database adapter. But I do have access to those tables, and able to select from them in SQL worksheet from with in Jdev. I dont own the tables, but my user id have readable [More]
I'm trying to adapt my sql query i use for php in order to return zipcodes using a radial search. This is my query that i use in php: $strSql2 = "SELECT * FROM Zips where (DEGREES(ACOS(SIN(RADIANS(" . $this->lat . ")) * SIN(RADIANS(lat)) [More]
Dear all, We have a senario in which multiple controlling area is defined with multiple currency. Is it feasible to use same operating concern or different. Thanks & Regards, VishalHi As long as the Fiscal Yr Variant is same between the two, you can [More]
Hi, Can anyone tell me how to generate a fmx file... my fmb is in $AU_TOP/forms/US and the fmx file should go to $XXAR_TOP/forms/US This is the command I am using f60gen $AU_TOP/forms/US/ABC.fmb userid/password output_file = $XXAR_TOP/forms/US/ABC.fm [More]
My phone Nokia5228 is lastly updated in 2012 but now i check software update it says all applications are up to date....please help me how to i get the latest updates? Moderator's Note: We have changed the title into a subject-related title. This is [More]