Solved

How to pass the value to next pages ?

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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 last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

707 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now