Hi everyone, I had a dialog, and an ivyComponent. component is included into dialog When i try to call process in Logic of Dialog like this, it work fine.
But when i try to call componentMethod() in component logic, it show method not found error : method not found example.main.componentMethod(). Update : each dialog had it own ManagedBean, and i fail to call when i use component ManagedBean. Seem like current context is not belong to component, have anyone meet this before ? Thank you :)
This question is marked "community wiki".
asked 06.07.2017 at 09:47 docvominh |
hi @docvominh I have nearly the same case and i can call ivy method by this function:
Here is calling:
but in my experience, we only can call methods if they belong to Main Page (in your example) and can't call method of ComponentProcess component. Because ivy have the mechanism to resolve keyword #data and #logic in correct context (see http://answers.axonivy.com/questions/2549/mechanism-to-resolve-data-and-logic-of-htmluserdialog) So when you evaluate those twos manually, it will take the biggest context (the page). P/S: once i can get the method of sub-component sucessfully but it lead to a lot of issue with security in ivy, so i suggest you should not do that (it look like a hack). You can introduce a managed bean for your component and you can call methods from there. Cheers, answered 06.07.2017 at 23:04 trungdv hi @docvominh That's great when it works for your case. What about exeption case? when something wrong happen in prepareFile, can we stop processing uploadDocument?
(07.07.2017 at 06:33)
trungdv
hi @trungdv, thank for your ideal, i will try it soon and reply to you.
(08.07.2017 at 09:28)
docvominh
hi @trungdv, i add some logic to check if "prepareFile" not done, uploadDocument will not be run :) but i meet some new issue, that i can not add FacesMessage to ivy Component. my code FacesContext context = FacesContext.getCurrentInstance(); context.addMessage(null,new FacesMessage(FacesMessage.SEVERITY_ERROR, "MESSAGE CONTENT", "MESSAGE CONTENT")); warning : There are some unhandled FacesMessages, this means not every FacesMessage had a chance to be rendered. These unhandled FacesMessages are: - MESSAGE CONTENT I afraid that current context is belong to father dialog. Thank you
(10.07.2017 at 03:19)
docvominh
|
Hi @trungdv Thanks for your comment. I really like to do everything in ManagedBean. Fortunately, i found new way to achieve my goal. use actionListener to call ManagedBean method, and action to call ivy method, when managedBean is done, ivy method start to call.
Thank you :) answered 07.07.2017 at 05:32 docvominh |
Once you sign in you will be able to subscribe for any updates here
By RSS:Markdown Basics
Tags:
Asked: 06.07.2017 at 09:47
Seen: 2,825 times
Last updated: 10.07.2017 at 03:19