Solved

How to pass the value to next pages ?

Posted on 2010-09-11
5
709 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

Transaction Monitoring Vs. Real User Monitoring

Synthetic Transaction Monitoring Vs. Real User Monitoring: When To Use Each Approach? In this article, we will discuss two major monitoring approaches: Synthetic Transaction and Real User Monitoring.

Question has a verified solution.

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

INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
This video teaches viewers about errors in exception handling.

724 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