Topic
  • 2 replies
  • Latest Post - ‏2013-03-14T09:26:12Z by paoloc
paoloc
paoloc
545 Posts

Pinned topic viewRoot.findComponent (still having problems with EGL)

‏2013-03-11T17:47:23Z |
any idea why?
The log:
0
EGL0100E Si è verificato un errore non gestito. Errore: java.lang.NullPointerException.
EGL0002I L'errore si è verificato in spazioDiLavoro3 durante l'elaborazione della funzione vaiadocumenti.
????????????????

The EGL:
function vaiADocumenti()
......
context ServletContext = FacesContext.getCurrentInstance().getExternalContext().getContext() as
ServletContext;
syslib.writeStdout("0 ");
tableEx1 UIData;
tableEx1 = viewRoot.findComponent("form1:tableEx1");
rigSpazio int = tableEx1.getRowIndex() + 1;
syslib.writeStdout("1 "); <----- Never executed !!!!!!
....
end

The jsp:
........
<hx:dataTableEx id="tableEx1"
value="#{spazioDiLavoro3.col}" var="varcol"
styleClass="dataTableEx" headerClass="headerClass"
footerClass="footerClass"
rowClasses="rowClass1, rowClass2"
border="0"
cellpadding="2" cellspacing="0">
<hx:columnEx id="columnEx6">
<hx:panelRowCategory styleClass="panelRowCategory"
id="rowCategory1" value="#{varcol.c01}" binding="#{spazioDiLavoro3.col_c01_Ref}" style="font-size: 12pt">
<h:outputText styleClass="outputText" id="text8"></h:outputText>
</hx:panelRowCategory>
<f:facet name="header"></f:facet>
</hx:columnEx>
<hx:columnEx id="columnEx8">
<hx:requestRowAction id="rowAction1"
*action="#{spazioDiLavoro3.vaiadocumenti}"*></hx:requestRowAction>
<f:facet name="header"></f:facet>
</hx:columnEx>
....................

paoloc
Updated on 2013-03-14T09:26:12Z at 2013-03-14T09:26:12Z by paoloc
  • SystemAdmin
    SystemAdmin
    6195 Posts

    Re: viewRoot.findComponent (still having problems with EGL)

    ‏2013-03-13T07:44:02Z  
    It works as advertised. From the documentation.
    <hx:requestRowAction> provides same functionality as <hx:commandExRowAction>; however, it does so with an HTTP GET request.
    
    It is not a POST action. No view is restored in phase RESTORE_VIEW (you can see that easily if you turn JSF Tracing on). Hence, you are trying to access component from a view that was not restored and that results in a NPE.

    Try using <hx:commandExRowAction> instead.
    Updated on 2014-03-25T04:35:54Z at 2014-03-25T04:35:54Z by iron-man
  • paoloc
    paoloc
    545 Posts

    Re: viewRoot.findComponent (still having problems with EGL)

    ‏2013-03-14T09:26:12Z  
    It works as advertised. From the documentation. <pre class="java dw" data-editor-lang="java" data-pbcklang="java" dir="ltr"><hx:requestRowAction> provides same functionality as <hx:commandExRowAction>; however, it does so with an HTTP GET request. </pre> It is not a POST action. No view is restored in phase RESTORE_VIEW (you can see that easily if you turn JSF Tracing on). Hence, you are trying to access component from a view that was not restored and that results in a NPE.

    Try using <hx:commandExRowAction> instead.
    Thanks,
    This works!