Solved

How to pass the value to next pages ?

Posted on 2010-09-11
5
702 Views
Last Modified: 2013-11-24
Hi,

I am having list of values in the datatable and click the one row link it will go to another page dropdown as current value and as well as need to send backend for the value.

After that if i change the dropdown value again need to get and send it to back end for retrive the values.

I am using jsf and java1.6.How to do  that ? Could you please give me your sugestions ...
0
Comment
Question by:Rose_Taylor
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 20

Expert Comment

by:Sathish David Kumar N
ID: 33655854
You can use javascript while onchange you can set the value ?
<select id="dropdown" name="dropdown">
you can use this id or name you can get the value in java script
 
0
 
LVL 20

Expert Comment

by:Sathish David Kumar N
ID: 33655861
Or you can use bean calss .
<form action="....." name="form" method="post">
you can get the value in action class
0
 

Author Comment

by:Rose_Taylor
ID: 33658316
I need set the value in dropdown as well as same value send to backend for get more value to display in the frond end.
i am having table with link, if press the link that value current value in the another page dropdown.as well same value for display more values.
How to do that ?
 
0
 
LVL 3

Accepted Solution

by:
prakash_parvath earned 500 total points
ID: 33659802
Hi

You can do the following

Front End : JSP 1
<h:form ... action="yourMethodinManagedBean">

<h:selectOneMenu id="item" value="#{yourManagedBean.selectedItem.item}" title="ItemSelected"
      validator="#{IF_ANY}">
      <f:selectItems id="dob-days" value="#{yourManagedBean.listOfSelectItems}" />
</h:selectOneMenu>

</h:form>


YourManagedBean.java

method: yourMethodinManagedBean() {
      // Select * from YOURTABLE where item <condition> <yourManagedBean.selectedItem.item>
      // Populate above result into yourManagedBean.listOfSelectItemsToBeDisplayed


}

JSP 2:

<h:selectOneMenu id="item" value="#{yourManagedBean.selectedItem2.item}" title="ItemSelected2"
      validator="#{IF_ANY}">
      <f:selectItems id="dob-days" value="#{yourManagedBean.listOfSelectItemsToBeDisplayed}" />
</h:selectOneMenu>
Front End : JSP 1
<h:form ... action="yourMethodinManagedBean">

<h:selectOneMenu id="item" value="#{yourManagedBean.selectedItem.item}" title="ItemSelected" 
	validator="#{IF_ANY}">
	<f:selectItems id="dob-days" value="#{yourManagedBean.listOfSelectItems}" />
</h:selectOneMenu>

</h:form>


YourManagedBean.java

method: yourMethodinManagedBean() {
	// Select * from YOURTABLE where item <condition> <yourManagedBean.selectedItem.item>
	// Populate above result into yourManagedBean.listOfSelectItemsToBeDisplayed


}

JSP 2:

<h:selectOneMenu id="item" value="#{yourManagedBean.selectedItem2.item}" title="ItemSelected2" 
	validator="#{IF_ANY}">
	<f:selectItems id="dob-days" value="#{yourManagedBean.listOfSelectItemsToBeDisplayed}" />
</h:selectOneMenu>

Open in new window

0
 

Author Closing Comment

by:Rose_Taylor
ID: 34294860
good
0

Featured Post

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

I had a project requirement for a displaying a user workbench .This workbench would consist multiple data grids .In each grid the user will be able to see a large number of data. These data grids should allow the user to 1. Sort 2. Export the …
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question