Hope you could help me
I am learning JSF and Primesface on my own.
I having trouble implementing the following JSF form, and make it work as I require it
Basically
I need to have one Form, and need to execute AJAX whenever a value change in the Form.
I am not able to make that Once Single Ajax call call for entrie form.
Rather I have to call it for every Data Input I have to call.
Second the Date Picker does not work or loses it formatting after selecting date.
Note I have not any additional Java Script... to the JSF.
Please refer additional image that I have attached
Further is that Possible to provide Single Ajax in case any inputs changes in the FORM, instead of each inputs tags.
What is difference between f:ajax and p:ajax
JSF 2.3 Dynamic Web Module 4.0 Redhat JBOSS 7.2 Java 1.8 Primefaces
7.0
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://xmlns.jcp.org/jsf/html"
xmlns:f="http://xmlns.jcp.org/jsf/core"
xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
xmlns:p="http://primefaces.org/ui">
<h:form styleClass="fill" id="tinputForm">
<div style="color: #FFF; padding-left: 70px"><strong >INPUT PANEL</strong></div>
<hr/>
<h:panelGroup layout="block" styleClass="CustomWell" >
<h:outputLabel value="Server-Class"/>
<h:panelGroup layout="block" styleClass="radio">
<h:selectOneRadio value = "#{sideBarInputsBean.serverClass}" layout="pageDirection" >
<f:selectItem itemValue = "Gateway" itemLabel = "Gateway" />
<f:selectItem itemValue = "Facing Server" itemLabel = "Facing Server" />
<f:selectItem itemValue = "Server Facing" itemLabel = "Server Facing" />
<f:selectItem itemValue = "Central Server" itemLabel = "Central Server" />
<!-- <p:ajax listener="#{sideBarInputsBean.printSelectedCRadioButton()}" /> -->
<f:ajax event="click" listener="#{sideBarInputsBean.printSelectedCRadioButton()}" execute="#form" render="#form :tinputForm" />
</h:selectOneRadio>
</h:panelGroup>
</h:panelGroup>
<h:panelGroup layout="block" styleClass="CustomWell" >
<h:outputLabel value="Choose a Parameter:"/>
<h:panelGroup layout="block" styleClass="radio">
<h:selectOneRadio value = "#{sideBarInputsBean.parameter}" layout="pageDirection" >
<f:selectItem itemValue = "IISLOG" itemLabel = "IIS Log Counter" />
<f:selectItem itemValue = "ASPNET" itemLabel = "ASP DOT Net Counters" />
</h:selectOneRadio>
</h:panelGroup>
</h:panelGroup>
<h:panelGroup layout="block" styleClass="CustomWell" >
<h:outputLabel value="Select a Server:"/>
<h:panelGroup rendered="#{sideBarInputsBean.serverClass == 'Gateway'}">
<h:panelGroup layout="block" >
<h:selectOneMenu id="CLGWServer" value="#{sideBarInputsBean.serverName}" styleClass="mymenu">
<f:selectItem itemLabel="Select One" itemValue="" />
<f:selectItems value="#{dataForSideBarInputBean.clientGatewayList}" />
<f:ajax event="change" listener="#{sideBarInputsBean.printSelectedCRadioButton()}" execute="#form" render="#form :tinputForm" />
</h:selectOneMenu>
</h:panelGroup>
</h:panelGroup>
<h:panelGroup rendered="#{sideBarInputsBean.serverClass == 'Facing Server'}">
<h:panelGroup layout="block" >
<h:selectOneMenu id="CFASServer" value="#{sideBarInputsBean.serverName}" styleClass="mymenu">
<f:selectItem itemLabel="Select One" itemValue="" />
<f:selectItems value="#{dataForSideBarInputBean.clientFacingList}" />
<f:ajax event="change" listener="#{sideBarInputsBean.printSelectedCRadioButton()}" execute="#form" render="#form :tinputForm" />
</h:selectOneMenu>
</h:panelGroup>
</h:panelGroup>
</h:panelGroup>
<h:panelGroup layout="block" styleClass="CustomWell" >
<h:panelGroup layout="block" styleClass="datepick">
<p:outputLabel value="Date:" />
<p:datePicker id="DateSelector" value="#{sideBarInputsBean.selectedDate}" showIcon="true" showTime="true" pattern="dd.MM.yyyy">
<f:ajax event="dateSelect" listener="#{sideBarInputsBean.printSelectedCRadioButton()}" execute="#form" render="#form :tinputForm" />
</p:datePicker>
</h:panelGroup>
</h:panelGroup>
</h:form>
Bean Code.
package cdv.mrdataanalytics.bean;
import java.io.IOException;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import javax.enterprise.context.SessionScoped;
import javax.faces.context.ExternalContext;
import javax.faces.context.FacesContext;
import javax.inject.Named;
#Named("sideBarInputsBean")
#SessionScoped
public class SideBarInputsBean implements Serializable {
private static final long serialVersionUID = 1L;
private String serverClass="Gateway";
private String parameter="IISLOG";
private String serverName="";
private Date selectedDate;
public String getServerClass() {
return this.serverClass;
}
public void setServerClass(String strClass) {
this.serverClass = strClass;
}
public String getParameter() {
return this.parameter;
}
public void setParameter(String strClass) {
this.parameter = strClass;
}
public String getServerName() {
return this.serverName;
}
public void setServerName(String strClass) {
this.serverName = strClass;
}
public Date getSelectedDate() {
return this.selectedDate;
}
public void setSelectedDate(Date date7) {
this.selectedDate = date7;
}
public void printSelectedCRadioButton() throws IOException{
System.out.println("Selected value = "+this.getServerClass());
System.out.println("Parameter value = "+this.getParameter());
System.out.println("ServerName = "+this.getServerName());
System.out.println("SelectedDate = "+this.getSelectedDate());
//ExternalContext ec = FacesContext.getCurrentInstance().getExternalContext();
//ec.redirect(ec.getRequestContextPath() + "/next.xhtml?action=add");
}
}
Related
This question already has an answer here:
Ajax update/render does not work on a component which has rendered attribute
(1 answer)
Closed 6 years ago.
I'm new to JSF and Primefaces and wanted to know what the best solution is to render a component according to radio selection (hiding and showing again)? I posted my ManagedBean and my JSF-Page-Excerpt. Thanks in advance.
My JSF-Page:
<p:dialog widgetVar="komponentErstellenDialogWV" modal="true"
id="komponentErstellenDialog" header="Komponente erstellen">
<h:form>
<p:wizard flowListener="#{userWizard.onFlowProcess}">
<p:tab id="produktAuswahlTab" title="Produkt auswählen">
<p:panel>
<h:panelGrid columns="2" columnClasses="label, value">
<h:outputText value="Produkt:" />
<p:selectOneRadio id="produktAERadio"
value="#{komponenteErstellenWizardController.produktAuswahl}">
<f:selectItem itemValue="1" itemLabel="Neu erstellen" />
<f:selectItem itemValue="2" itemLabel="Aus Liste auswählen" />
<p:ajax event="click" update="produktSelect" />
</p:selectOneRadio>
<p:selectOneMenu id="produktSelect"
rendered="#{komponenteErstellenWizardController.shouldRenderProduktSelect()}"
value="#{komponenteErstellenWizardController.komponente.produkt}">
<f:selectItems
value="#{komponenteErstellenWizardController.findAllProdukt()}"
var="currentProdukt"
itemLabel="#{currentProdukt.hersteller.concat(' ').concat(currentProdukt.name)}"
itemValue="#{currentProdukt.id}" />
</p:selectOneMenu>
</h:panelGrid>
</p:panel>
</p:tab>
</p:wizard>
</h:form>
</p:dialog>
My ManagedBean:
#ManagedBean
#SessionScoped
public class KomponenteErstellenWizardController implements Serializable {
/**
*
*/
private static final long serialVersionUID = 1L;
// Properties
private Komponente komponente = new Komponente();
private String produktAuswahl;
#PostConstruct
public void init() {
produktAuswahl = "1";
}
public String getProduktAuswahl() {
System.out.println("GetProduktAuswahl invoked with returning value: " + produktAuswahl);
return produktAuswahl;
}
public void setProduktAuswahl(String produktAuswahl) {
System.out.println("SetProduktAuswahl invoked with Value: " + produktAuswahl);
this.produktAuswahl = produktAuswahl;
}
public Komponente getKomponente() {
return komponente;
}
public void setKomponente(Komponente komponente) {
this.komponente = komponente;
}
// EJBs
#EJB
KomponenteFacade komponenteFacade;
#EJB
ProduktFacade produktFacade;
#EJB
ProduktArtFacade produktArtFacade;
public List<Produkt> findAllProdukt() {
return produktFacade.findAll();
}
public Boolean shouldRenderProduktSelect() {
System.out.println("Wizard Produktauswahl: " + produktAuswahl);
return "2".equals(produktAuswahl);
}
}
I updated my code according to suggestions:
Replaced faces components by primefaces components
Added a new action method "shouldRenderProduktSelect"
Still not working...
Few things..
1) Add this method to your controller:
public boolean shouldRenderSelect(){
return "2".equals(produktAuswahl);
}
2) Change the rendered attribute:
<h:selectOneMenu id="produktSelect"
rendered="#{komponenteErstellenWizardController.shouldRenderSelect()}"
3) update your html:
<p:selectOneRadio id="produktAERadio"
value="#{komponenteErstellenWizardController.produktAuswahl}">
<f:selectItem itemValue="1" itemLabel="Neu erstellen" />
<f:selectItem itemValue="2" itemLabel="Aus Liste auswählen" />
<p:ajax event="click" update="panelSelect" />
</p:selectOneRadio>
<h:panelGroup id="panelSelect">
<p:selectOneMenu id="produktSelect"
rendered="#{komponenteErstellenWizardController.shouldRenderProduktSelect()}"
...
</p:selectOneMenu>
</h:panelGroup>
The key is to wrap the selectOneMenu within and from ajax update the panelGroup, not the menu.
This question already has answers here:
Understanding PrimeFaces process/update and JSF f:ajax execute/render attributes
(5 answers)
Closed 6 years ago.
I have an selectOneMenu and when Its value at 0, I want to "Add" button does not show up. I have rendered for this situation. Here is code ;
<p:panelGrid id="pnlRegister" columns="6" style="width: 95%" >
<p:inputText id="name" class=" width100" value="#{register.name}" />
<p:selectOneMenu id="numberOfChild" value="#{register.numberOfChild}" >
<p:ajax listener="#{register.listenNumberOfChild()}" update="pnlRegister" />
<f:selectItem itemValue="0" itemLabel="0" />
<f:selectItem itemValue="1" itemLabel="1" />
<f:selectItem itemValue="2" itemLabel="2" />
<f:selectItem itemValue="3" itemLabel="3" />
<f:selectItem itemValue="4" itemLabel="4" />
<f:selectItem itemValue="5" itemLabel="5" />
</p:selectOneMenu>
<p:commandButton id="addPerson" value="Add" actionListener="#{register.openPersonDialog(1)}" rendered="#{register.visibleAddPersonButton}" >
<p:ajax event="dialogReturn" update="pnlPerson" />
</p:commandButton>
And Bean code;
public void listenNumberOfChild() {
if (numberOfChild == 0) {
visibleAddPersonButton = false;
} else {
visibleAddPersonButton = true;
}
System.out.println("ListenerNumberOfChild " + numberOfChild);
}
</panelGrid>
Now problem is, when I change numberOfChild, listener works uptades pnlRegister as expected. However server does not keep inputText values. For example before listener works, I write register.name as "John". After listener works, it does not keep it and it gets as null. I hope I could tell what I'm trying and what is problem. So do you have any suggestion ? Also I tried RequestContext.getCurrentInstance().update but same problem occured.
This is how I made it work:
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://xmlns.jcp.org/jsf/html"
xmlns:f="http://xmlns.jcp.org/jsf/core"
xmlns:p="http://primefaces.org/ui">
<f:view>
<h:head>
<title>pfaces</title>
</h:head>
<h:form>
<p:panelGrid id="pnlRegister" columns="3" style="width: 95%">
<p:inputText id="name" value="#{register.name}"/>
<p:selectOneMenu id="numberOfChild" value="#{register.numberOfChild}">
<p:ajax process="name numberOfChild"
listener="#{register.listenNumberOfChild()}" update="pnlRegister"/>
<f:selectItem itemValue="0" itemLabel="0"/>
<f:selectItem itemValue="1" itemLabel="1"/>
<f:selectItem itemValue="2" itemLabel="2"/>
</p:selectOneMenu>
<p:commandButton id="addPerson" value="Add"
rendered="#{register.visibleAddPersonButton}"/>
</p:panelGrid>
</h:form>
<h:body>
</h:body>
</f:view>
</html>
and the backing bean:
package biz.tugay.jsfexampla;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;
#ManagedBean
#SessionScoped
public class Register {
private boolean visibleAddPersonButton = false;
private int numberOfChild = 0;
private String name;
public boolean isVisibleAddPersonButton() {
return visibleAddPersonButton;
}
public void setVisibleAddPersonButton(boolean visibleAddPersonButton) {
this.visibleAddPersonButton = visibleAddPersonButton;
}
public int getNumberOfChild() {
return numberOfChild;
}
public void setNumberOfChild(int numberOfChild) {
this.numberOfChild = numberOfChild;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public void listenNumberOfChild() {
visibleAddPersonButton = numberOfChild != 0;
System.out.println("ListenerNumberOfChild " + numberOfChild);
}
}
Here, you can see it in action: https://youtu.be/IQN3HAejhcM
I want to take the input from two input fields and simultaneous compute the sum into another input field (total) that must be editable however. I tried like that (I cutted away some code useless to the question):
<p:inputText id="field1"
value="#{ModelBean.object.field1}"
onkeydown="#{BackingBean.updateTotal()}">
</p:inputText>
<p:selectOneMenu id="field2" required="true"
value="#{ModelBean.object.field2}">
<f:selectItem itemLabel="22 %" itemValue="22" />
<f:selectItem itemLabel="10 %" itemValue="10" />
<f:selectItem itemLabel="4 %" itemValue="4" />
<f:selectItem itemLabel="0 %" itemValue="0" />
</p:selectOneMenu>
<!-- TOTAL -->
<p:inputText id="total"
value="#{ModelBean.object.total}">
</p:inputText>
As you can see I delegated tho BackingBean.update() method the compute task. It updates the total value and set it into the total field of the bean. The problem that I saw in debug is that the values of my two fields to sum is null. How I can do to let the model variables filled while I am writing? And What I have to modify to let the result of the compute immediately written in the total input filed?
Rather than this you can use Ajax for this:
<p:inputText id="field1" value="#{ModelBean.object.field1}">
<f:ajax event="change" execute="#this" render="total" listener="#{BackingBean.updateTotal}"></ajax>
</p:inputText>
<p:selectOneMenu id="field2" required="true"
value="#{ModelBean.object.field2}">
<f:selectItem itemLabel="22 %" itemValue="22" />
<f:selectItem itemLabel="10 %" itemValue="10" />
<f:selectItem itemLabel="4 %" itemValue="4" />
<f:selectItem itemLabel="0 %" itemValue="0" />
<f:ajax event="change" execute="#this" render="total" listener="#{BackingBean.updateTotal}"></ajax>
</p:selectOneMenu>
<!-- TOTAL -->
<p:inputText id="total" value="#{ModelBean.object.total}">
</p:inputText>
I think you need to put ajax in both components, because to are getting sum on the basis of values of both. And if you don't want to use "Change" event than you can use some other event of ajax.
create project and include it
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://xmlns.jcp.org/jsf/html"
xmlns:p="http://primefaces.org/ui"
xmlns:f="http://xmlns.jcp.org/jsf/core">
<h:head>
<title>Facelet Title</title>
</h:head>
<h:body>
<h:form>
<h:panelGrid columns="3">
<h:outputText value="Keyup: " />
<p:inputText id="counter2" value="#{listenerView.a}">
<p:ajax event="keyup" update="out" listener="#{listenerView.handleKeyEvent}"/>
</p:inputText>
<p:inputText id="counter" value="#{listenerView.b}">
<p:ajax event="keyup" update="out" listener="#{listenerView.handleKeyEvent}" />
</p:inputText>
<h:outputText id="out" value="#{listenerView.c}" />
</h:panelGrid>
</h:form>
</h:body>
</html>
package org.primefaces.showcase.view.ajax;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ViewScoped;
#ManagedBean
#ViewScoped
public class ListenerView {
private String text;
private int a;
private int b;
private int c;
public String getText() {
return text;
}
public void setText(String text) {
this.text = text;
}
public void handleKeyEvent() {
c=a+b;
}
public int getA() {
return a;
}
public void setA(int a) {
this.a = a;
}
public int getB() {
return b;
}
public void setB(int b) {
this.b = b;
}
public int getC() {
return c;
}
public void setC(int c) {
this.c = c;
}
}
If you want to use the inserted value on the server side to do some calculations, you have to (partially) submit the form first. You may do this via AJAX like this:
<p:inputText id="field1"
value="#{ModelBean.object.field1}">
<p:ajax event="keyup" listener="#{BackingBean.updateTotal}" update="total"/>
</p:inputText>
<p:selectOneMenu id="field2" required="true"
value="#{ModelBean.object.field2}">
<f:selectItem itemLabel="22 %" itemValue="22" />
<f:selectItem itemLabel="10 %" itemValue="10" />
<f:selectItem itemLabel="4 %" itemValue="4" />
<f:selectItem itemLabel="0 %" itemValue="0" />
<p:ajax listener="#{BackingBean.updateTotal}" update="total"/>
</p:selectOneMenu>
<!-- TOTAL -->
<p:inputText id="total"
value="#{ModelBean.object.total}">
</p:inputText>
If all information which is required for the calculation is available on the current view and the calculation is quite easy, like it seems to be here, you may also consider to do the job completely on the client side via plain JavaScript.
This question already has an answer here:
Ajax update/render does not work on a component which has rendered attribute
(1 answer)
Closed 7 years ago.
I have an inputText and a selectOneRadio component, when form load selectOneRadio should be hidden. When user select inputText, I want to show the selectOneRadio component. I have made the selectOneRadio hidden in #PostConstruct, which should be display on select inputText.
<h:panelGrid id="panelgrid">
<p:panel id="panel" >
<h:outputLabel value="Name: " for="name" />
<p:inputText id="name" value="#{userBean.name}" immediate="true">
<p:ajax event="onselect" update="city" listener="#{userBean.showName}" />
</p:inputText>
<p:selectOneRadio id="city" value="#{userBean.city}" layout="grid" columns="3" rendered="#{userBean.displayName}" >
<f:selectItems value="#{userBean.cities}" var="c" itemLabel="#{city}" itemValue="#{city}" />
</p:selectOneRadio>
</p:panel>
</h:panelGrid>
The bean code is like:
#PostConstruct
public void init() {
displayName = false;
}
public boolean isShowName() {
return true;
}
...
But some how this is not working. I'm using JSF2.0 with primefaces 5.2.
I found the solution.
<h:form id="frm">
<h:panelGrid id="panelgrid">
<p:panel id="panel" >
<h:outputLabel value="Name: " for="name" />
<p:inputText id="name" value="#{userBean.name}" immediate="true" onkeypress="#{userBean.showName}">
<p:ajax event="change" update="frm:panelgrid" listener="#{userBean.inputcangeeListener}" />
</p:inputText>
</p:panel>
<p:panel id="p2" rendered="#{userBean.displayName}">
<p:selectOneRadio id="city" value="#{userBean.city}" layout="grid" columns="3">
<f:selectItems value="#{userBean.cities}" var="c" itemLabel="#{city}" itemValue="#{city}" />
</p:selectOneRadio>
</p:panel>
</h:panelGrid>
</h:form>
And my managed bean looks like-
#PostConstruct
public void init() {
displayName = false;
}
public boolean isShowName(){
return displayName;
}
public void inputcangeeListener(javax.faces.event.AjaxBehaviorEvent changeEvent){
setDisplayName(true);
cities = new ArrayList<>();
cities.add("pune");
cities.add("KOL");
}
Thanks for your response.
I have 2 dialogs. In the 1st dialog user writes modulename and I need to pass my modulename to the second dialog and set this modulename value to bean called #{paramController.parameter.modulename}
Please, give me some ideas how to get parameter from one bean and set it to another bean?
</p:inputText>
<p:outputLabel value="Description" for="moduledescription" />
<p:inputTextarea id="moduledescription" rows="4" cols="53" autoResize="false" value="#{modulesController.selected.moduledescription}"/>
<p:outputLabel value="Database Name :" for="moduledbname" />
<p:selectOneMenu id="moduledbname" value="#{modulesController.selected.moduledbname}" style="width:342px">
<f:selectItem itemLabel="Select Connection" itemValue="" noSelectionOption="true" />
<f:selectItems var="con" value="#{sqlserverController.itemsAvailableSelectOne}" itemValue="#{sqlserverController.getSqlserver(conName)}" />
<p:ajax update="#this"/>
</p:selectOneMenu>
<p:outputLabel value="Value :" for="modulevalue" />
<p:inputTextarea id="modulevalue" rows="8" cols="53" autoResize="false" value="#{modulesController.selected.modulevalue}"/>
</p:panelGrid>
<p:commandButton actionListener="#{modulesController.create}" icon="ui-icon-check" value="Save" update="display,:ModulesListForm:datalist,:growl" oncomplete="handleSubmit(args,'ModulesCreateDialog');"/>
<p:commandButton id="btnAdd" value="Add Parameter" icon="ui-icon-plusthick" onclick="PF('dlg1').show();">
</p:commandButton>
<p:commandButton value="Cancel" icon="ui-icon-closethick" onclick="ModulesCreateDialog.hide()"/>
<br/>
</h:panelGroup>
<br/>
<h:form id="ParamForm">
<p:dialog id="AddParamDlg" header="Add Parameter" widgetVar="dlg1" minHeight="40">
<h:panelGroup id="displayParam">
<p:panelGrid columns="2">
<p:outputLabel value="Parameter Name :" for="paramname2" />
<p:inputText id="paramname2" value="#{paramController.parameter.paramname}" style="width:332px" title="#{bundleModules.CreateModulesTitle_modulename}" >
</p:inputText>
<p:outputLabel value="Default Value :" for="defaultvalue2" />
<p:inputText id="defaultvalue2" value="#{paramController.parameter.defaultvalue}" style="width:332px" title="#{bundleModules.CreateModulesTitle_modulename}"/>
<p:outputLabel value="Module Name :" for="parammodulename2" />
<p:selectOneMenu id="parammodulename2" value="#{paramController.parameter.modulename}" style="width:342px">
<f:selectItem itemLabel="Select Module Name" itemValue="" noSelectionOption="true" />
<f:selectItems var="con" value="#{modulesController.itemsAvailableSelectOne}" itemValue="#{modulesController.getModules(paramname)}" />
<p:ajax update="#this"/>
</p:selectOneMenu>
</p:panelGrid>
<p:commandButton action="#{paramController.addNewParameter}" value="Add" update="displayParam, :ModulesCreateForm:ParamForm" onclick="PF('dlg1').hide()" />
</h:panelGroup>
</p:dialog>
</h:form>
</h:form>
First of all you have a nested tag <h:form>.....<h:form> ... </h:form> </h:form>. You need to get rid of this.
SampleManagedBean1.java
#ManagedBean(name="SampleManagedBean1")
#ViewScoped
public class SampleManagedBean1 {
private String mModuleName = "";
public String getModuleName() {
return mModuleName;
}
public void setModuleName(String moduleName) {
this.mModuleName = moduleName;
}
/**
* invoke this API from UI to set value in this bean
*
* #param moduleName
*/
public void setValueOfModuleName(String moduleName) {
this.mModuleName = moduleName;
}
/**
* Invoke this API from UI to get value from this bean
*
* #return
*/
public String getValueOfModuleName() {
return mModuleName;
}
}
SampleManagedBean2.java
#ManagedBean(name="SampleManagedBean2")
#ViewScoped
public class SampleManagedBean2 {
private String mModuleName = "";
public String getModuleName() {
return mModuleName;
}
public void setModuleName(String moduleName) {
this.mModuleName = moduleName;
}
/**
* invoke this API from UI to set value in this bean
*
* #param moduleName
*/
public void setValueOfModuleName(String moduleName) {
this.mModuleName = moduleName;
}
/**
* Invoke this API from UI to get value from this bean
*
* #return
*/
public String getValueOfModuleName() {
return mModuleName;
}
}
From UI
SampleManagedBean2.setValueOfModuleName(SampleManagedBean1.getValueOfModuleName);
As I understood you have two beans, one for dialog 1 and the second for dialog2.
You can pass the "paramController.parameter" (stored in first bean) as a parameter for method (method inside second bean) which shows dialog2.