java - JSF SessionScoped Bean Fields become null primefaces -
I have my beans @SessionScoped code for menuController and extends one of my classes menuController and added If I set the value of the id and navigate to the other page, the id valid becomes empty import javax.faces.beans.ManagedBean; Import javax.faces.bean.SessionScoped; @ManagedBean (name = "menuController") applies the session-scanned public class MenuController basepage Serializable {/ ** * * / / Private string ID; Public Menu Controller () {} public string getId () {System.out.println ("Menu Controller ID =" + ID); Return id; } Public Zero Set ID (string id) {this.id = id; }}
Here is the code of Bean that is inheriting the menu controller and setting its id value. This bean has been vacant value of the ID set to meet when the menu has been scanned @ session controller
import javax.faces.bean.ManagedBean; Import javax.faces.bean.SessionScoped; @ManagedBean (name = "channelLeftPanel") @SessionScoped public square ChannelLeftPanel rippled apply MenuController Serializable {public ChannelLeftPanel () {} public string channelEditPage (SelectEvent event) {this.setId (((GenericProduct) event.getObject ()). GetId ()); SetSessionParameter ("Current View", "/includes/content/channel/editChannel.xhtml"); If (isDebugEnable) logger.debug ("Channel ID =" + ((GenericProduct) event.getObject ()). GetId ()); Return "main content area"; }}
The form below which we are updating the ajax call whose listener method establishes the ID in the menuController and the main content form which is basically the center area description
< There are pre-> & lt; H: form id = "left panel" & gt; & Lt; p: DataTable var = "channelDetail" value = "# {channelLeftPanel.channelList}" widgetVar = "cTable" emptyMessage = "found with no channel given criteria" selectionMode = "single" select = "# {channelLeftPanel.selectedChannel} "rowKey =" # {channelDetail.id} "filteredValue =" # {channelLeftPanel.filteredChannels} "styleClass =" datatableLeft "style =" width: 100% "& gt; & Lt; F: Aspect Name = "Header" & gt; & Lt; P: outputPanel & gt; & Lt; H: Output Text Value = "Search All Fields:" /> & Lt; P: Inputtekst id = "Globlfiltr" Onkeyup = "" PF ( 'cTable'). filter () style = "width: 150px" placeholder = "Enter keyword" / & gt; & Lt; / P: outputPanel & gt; & Lt; / Ch: Aspect & gt; & Lt; P: ajax event = "rowSelect" listener = "# {channelLeftPanel.channelEditPage}" update = ": mainAreaContentform" /> & Lt; P: column filter = = "# {channelDetail.name}" filter system = "display: none; visibility: hidden;" Style = "width: 80%" & gt; & Lt; H: outputtext value = "# {channelDetail.name}" /> & Lt; / P: column & gt; & Lt; P: According to column filter = "# {channelDetail.id}" filter system = "display: none: visibility: hidden;" Style = "width: 20%" & gt; [& Lt; H: outputtext value = "# {channelDetail.id}" />] & lt; / P: column & gt; & Lt; / P: DataTable & gt; & Lt; / H: form & gt;
Comments
Post a Comment