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
When going to enter a new customer, you need to hit create, then once a new blank row is generated, you then have to select it and hit update to be able to start entering new information into your table. Is there a way to make the edit screen come up [More]
Mini bridge says "waiting for Bridge" II removed /library/application Support/Adobe/Switchborard folder and alo the switch board preference file in home directory, restarted computer, etc and message changed from "no items found" to &q [More]
Hi *, I'm trying to configure this kind of scenario: 1) user xyz sends a request to a web service, which is exposed by XI via its outbound interface 2) XI performs all the necessary mapping stuff and via the routing procedure identifies the right inb [More]
IPod will not update with cd-rom it came with - this is the first - initial - brand new install of ipod win xp with sp2 installed used cd-rom that came with ipod - followed instructions to the tee - stated it can not update ipod - itunes does not see [More]
I can find no information about a bug or anyone else experiencing this, or the need to manually input lines in .ly files.  I used old 2.12.3 files and new 2.14.2 files.  Simple and complex.  It's getting difficult to stick with Lilypond, but I tried [More]
Dear Gurus, I have to set a type document with increment version alphanumber so the version has to begin with A , B,... so I have to set in Customizing  '* ' in Vers,No. Somebody knows which is the user exit to change increment version number of the [More]
What does a progress bar next to a video file mean? and how can I get rid of it? Thanks!The black checkmark indicates that the song will be part of the next action you perform in iTunes. For more information about that and other symbols in the iTunes [More]
I just upgraded to Leopard after my hard drive crashed and had synced with my Blackberry to get all of my calendars back. In opening today though I noticed a line across this week with a small colored bubble on the end of it (?) but I can't adjust it [More]
Hello,      We recently moved to a new office and currently have three ISPs(DSL, SAT, 4G) because we are unable to get Cable nor Fiber services.  We have anywhere between 7-20 Remote Desktop connections(with lot of file transfers) and 8 VOIP lines.  [More]
Greetings everyone, I am trying to take a select of groups in a certain OU within AD to make SCCM 2012 user collections from. I been playing around with just creating the collections based upon a txt file which would work and is probably easier. Can [More]