java - JSF ViewHandlerWrapper causes NullPointerException -
I have a small issue with a JSF ViewHandlerWrapper that I've coded it works most of the time, but many At times I will get a null pointer exception from the original center of the Moserra and in this way I am surprised that I have implemented my ViewHandlerWrapper correctly.
Public Square TokenViewHandler Expands ViewHandlerWrapper {Personal ViewHandler Parents; Public TokenViewHandler (seeHandler Parents) {this.parent = parent; } Get @ Override Public Violence () {Return Parents; } @ Override Public Wide Renderview (Facts Contact Reference, UIVUURUT Visual Tornentor) throws IOException, Face Expression {Final String Token = UUID. RundUUd (). Toasting (); Find and modifier (viewer, token, context); GetWrapped () Renderview (reference, viewer); } Private Waste Search EndmodifyForms (Final UIComPonent Component, Final String Token, Final FaceContact CTX) {If (UEFFORM CONTENT EXAMPLES) {HINTH HTML INPHOOD HIDDEN = (HTML inputHyDQ) CTX.Attepation (). Create Compnant (HTMLInputHind ComponentEPE); Hidden.setValue (token); Component.getChildren () add (hidden) } Else {for (UIComponent tempComponent: component.getChildren ()) {findAndModifyForms (tempComponent, token, ctx); The code quickly makes you realize that I have a inputhead with a UUID value for each form - I want to add component> on view As I did not find any good examples for ViewHandlerWrappers I have assumed that it should look like an ExceptionHandlerWrapper, but since I get the occasional NPE using my ViewHandler, I think that Something is wrong and I can not see it
This is related to a bug in partial state savings, see.
The people of Iceface were faced and it has been temporarily fixed by adding the following line:
facesContext.getViewRoot (). AddComponentResource (facesContext, new UIOutput (), "head");
Give it a try Before presenting the view do it.
Comments
Post a Comment