Hi ivy team,

I need to wrap ivy composite component by a outputPanel. So in the event postAddToView, i do some thing following:

  1. Scan UI: to get the list of components
  2. Update UI: i loop on that list. Then i get the parent of ivy component, replace ivy component by the new outputLabel and assign ivy component to outLabel's children.

It goes wrong when i add event postAddToView to Address component

Address xhtml

< cc:interface componentType="IvyComponent">
< /cc:interface>
< cc:implementation>
    < h:panelGroup layout="block" styleClass="component-wrapper" id="AddressPanel" >
        < f:event listener="#{logic.processView}" type="preValidate" ></f:event> 
        < f:event listener="#{logic.postValidate}" type="postValidate" ></f:event> 
        < f:event listener="#{logic.initializeView}" type="postAddToView"></f:event>
    < /h:panelGroup>
< /cc:implementation>

Demo xhtml

< h:form id="form">
 < f:event listener="#{logic.preValidate}" type="preValidate" ></f:event>
    < f:event listener="#{logic.postValidate}" type="postValidate" ></f:event>  
    < f:event listener="#{logic.postAddToView}" type="postAddToView"></f:event>
    < p:outputLabel for="firstNameDemo" value="First name" title="Fist tooltip"/>
    < p:inputText id="firstNameDemo" value="#{data.firstNameDemo}"/>
    < ic:.DemoComponent data="#{data.person}" ></ic:DemoComponent>
    < ic:ch.axonivy.fintech.basic.component.AddressComponent
                    startMethod="start" id="abc" value="#{data.address}" ></ic:.AddressComponent>
< /h:form>

wrap

OutputPanel outputPanel = UIComponentUtil.createOutputPanel(param.getFacesContext());
outputPanel.setId(ivyComponent.getId() + UIComponentUtil.PARENT_SUFFIX);
ivyComponent.getParent().getParent().getChildren().set(ivyComponent.getParent().getParent().getChildren().indexOf(ivyComponent.getParent()), outputPanel);
outputPanel.getChildren().add(ivyComponent.getParent());

Error

PermissionDeniedException: Session 1 (Developer) is not allowed to call method public ch.ivyteam.ivy.cm.IContentManagementSystem ch.ivyteam.ivy.cm.internal.ContentManagement.findCms(ch.ivyteam.ivy.application.IProcessModelVersion).
    The session does not fulfill the permission rule SESSION IS SYSTEM
    ProvisionException: Unable to provision, see the following errors:

Stack trace

    org.apache.myfaces.view.facelets.el.ContextAwareELException: javax.el.ELException: ch.ivyteam.ivy.bpm.engine.restricted.error.BpmErrorHandler$UnhandledException: BpmError ivy:error:system
 Unique ID: 1528153199ECF258
 Process Element: postAddToView(PostAddToViewEvent) <1524368C6B07FA9C-f8>
    at org.apache.myfaces.view.facelets.el.ContextAwareTagMethodExpression.invoke(ContextAwareTagMethodExpression.java:108)
    at org.apache.myfaces.view.facelets.tag.jsf.core.EventHandler$Listener.processEvent(EventHandler.java:273)
    at javax.faces.component.UIComponent$EventListenerWrapper.processEvent(UIComponent.java:1624)
    at javax.faces.event.SystemEvent.processListener(SystemEvent.java:40)
    at javax.faces.event.ComponentSystemEvent.processListener(ComponentSystemEvent.java:51)
    at org.apache.myfaces.application.ApplicationImpl._traverseListenerList(ApplicationImpl.java:2595)
    at org.apache.myfaces.application.ApplicationImpl.publishEvent(ApplicationImpl.java:595)
    at javax.faces.application.ApplicationWrapper.publishEvent(ApplicationWrapper.java:328)
    at javax.faces.application.ApplicationWrapper.publishEvent(ApplicationWrapper.java:328)
    at javax.faces.component.UIComponentBase._publishPostAddToViewEvent(UIComponentBase.java:243)
    at javax.faces.component.UIComponentBase._publishPostAddToViewEvent(UIComponentBase.java:262)

Please give me your feedback. Thanks for your support!

asked 26.01.2016 at 08:29

Cuong%20Le's gravatar image

Cuong Le
(suspended)
accept rate: 0%

edited 27.01.2016 at 05:43


link

answered 05.02.2016 at 15:14

Flavio%20Sadeghi's gravatar image

Flavio Sadeghi ♦♦
(suspended)
accept rate: 75%

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×147
×79
×51
×7

Asked: 26.01.2016 at 08:29

Seen: 6,569 times

Last updated: 05.02.2016 at 15:14