• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 720
  • Last Modified:

How to pass the value to next pages ?

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
Rose_Taylor
Asked:
Rose_Taylor
  • 2
  • 2
1 Solution
 
Sathish David Kumar NCommented:
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
 
Sathish David Kumar NCommented:
Or you can use bean calss .
<form action="....." name="form" method="post">
you can get the value in action class
0
 
Rose_TaylorAuthor Commented:
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
 
prakash_parvathCommented:
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
 
Rose_TaylorAuthor Commented:
good
0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now