jsf - getselectednode from another bean (primefaces) -


I have a managed node of nick and other managed bean, where I would like to get from selectNode and getType execute some code But the problem is that I can not get the reason for the selected node every time:

  java.lang.NullPointerException: javax.faces.FacesException: # {dimMan.makeDim ()} : Java.lang.NullPointerException   

And this is my two managed wing:

  @ManagedBean @ViewScoped public class TreeBean applies Serializable {Personal Static Final L Sector serial VERSIONUID = 2417620239014385855 L; Private triode route; Private triode selected node; .....   

And secondly, where I would like to test the type of selected node:

  @ManagedBean (name = "hotman") @ Session-scocked public square DimenssionManaged {@EJB DimensionDaoRemote dimService; @Internet TreeBean Tree selected; Select string; Receive public trebrainTree selected () {Return tree selected; } Selected public zero set (selected tree tree) {this.tree selection = tree selected; } Public Zero MakeDIM () {System.out.println ("Adding"); Fkey = tTable.getSelectedFk (); DimUpdate.setFk_dimension (fkey); DimUpdate.setType_dimension (selectedType); Selection = treeSelected.getSelectedNode () getParent () GetType () .. Println (selection); If (choose == "cube") {CubeBase cub = cubManged.getCubUpdate (); DimUpdate.setCube (cubs); DimService.creat_dimension (dimUpdate); } Else {schemabass sh = shmanged.getSchema (); DimUpdate.setSchema (sh); DimService.creat_dimension (dimUpdate); }}   

I also try to use this annotation @ManagedProperty (value = ***) , but it was not working so What should I do with other managed types of selected node type << p>

? If this happens then once you tribhen has changed its data into its code, it will be removed from @ViewScoped .

Change the tribbeen to @SessionSocked to keep the data even after navigation, but refresh the data / refresh the concern subject to.

Comments

Popular posts from this blog

ios - Adding an SKSpriteNode to SKScene from a child SKSpriteNode -

Matlab transpose a table vector -

c# - Textbox not clickable but editable -