Solved

How to pass the value to next pages ?

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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Java Options in Zimbra Server 2 54
maven module vs maven project 3 23
jsp insert to database example 2 24
Is there a simpler dropbox system? 10 23
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…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
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.

803 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