Questions asked by wesinghttps://answers.axonivy.com/questions/asked-by/1017/wesing/?type=rssQuestions asked by <a href="/users/1017/wesing" >wesing</a>enFri, 27 Jul 2018 03:19:19 -0400How to implement Primefaces TreeTable - Selection (CheckboxTreeNode) in Axon Ivy 7.0.1?https://answers.axonivy.com/questions/3369/how-to-implement-primefaces-treetable-selection-checkboxtreenode-in-axon-ivy-7-0-1<p>Hi,</p> <p>I have tried to implement Primefaces TreeTable - Selection (CheckboxTreeNode) The sample code are obtained from <a href="https://www.primefaces.org/showcase/ui/data/treetable/selection.xhtml">https://www.primefaces.org/showcase/ui/data/treetable/selection.xhtml</a> . In Axon Ivy 7.0.1 but it keeps getting the following error when I tried to navigate the tree. </p> <pre><code>ELException: Cannot convert [[Lorg.primefaces.model.TreeNode;@7d8d3a6a] of type [class [Lorg.primefaces.model.TreeNode;] to [class org.primefaces.model.CheckboxTreeNode] ContextAwareELException: javax.el.ELException: Cannot convert [[Lorg.primefaces.model.TreeNode;@7d8d3a6a] of type [class [Lorg.primefaces.model.TreeNode;] to [class org.primefaces.model.CheckboxTreeNode] Error during rendering of html dialog 'trial.TreeDataTryOut' </code></pre> <p>I did some googlings and someone suggested that it is due to PrimeFaces JAR files conflict. I have no idea how to resolve that in Axon Ivy. Could you help?</p> <p>Also, it would be great if there are sample Axon Ivy projects with TreeDataTable - Checkbox for reference?</p>wesingFri, 27 Jul 2018 03:19:19 -0400https://answers.axonivy.com/questions/3369/how-to-implement-primefaces-treetable-selection-checkboxtreenode-in-axon-ivy-7-0-1htmluserdialogHow to access database in a faces Validatorhttps://answers.axonivy.com/questions/3364/how-to-access-database-in-a-faces-validator<p>Hi all, I am new to AXON IVY. Hope you can be patient with me.</p> <p>I am trying to use that code here: <a href="https://answers.axonivy.com/questions/314/using-db-connection-from-pis">https://answers.axonivy.com/questions/314/using-db-connection-from-pis</a> (provided by Ivy Support Team) in a Java class in a CustomValidator class to look up a database table. Somehow I could not resolve the Ivy object. </p> <p>I tried looking up getProcessEngineHook method in <a href="https://developer.axonivy.com/doc/latest/PublicAPI">https://developer.axonivy.com/doc/latest/PublicAPI</a> but the search doesn't return any results.</p> <p>My codes as follows:</p> <pre><code>package trial.facesValidation; import javax.faces.application.FacesMessage; import javax.faces.component.UIComponent; import javax.faces.context.FacesContext; import javax.faces.validator.FacesValidator; import javax.faces.validator.Validator; import javax.faces.validator.ValidatorException; import java.sql.Connection; // To validate if Item Name already existed in Parts table in Database @FacesValidator("trial.facesValidation.CustomItemValidator") public class CustomItemValidator implements Validator { @Override public void validate(FacesContext context, UIComponent component, Object value) throws ValidatorException { //connect to the database Connection dbconnection = ivy.getProcessEngineHook().getDbConnection("TrialDBConn"); try { // execute some sql queries } finally { // close the connection dbconnection.close(); } </code></pre>wesingMon, 23 Jul 2018 23:32:38 -0400https://answers.axonivy.com/questions/3364/how-to-access-database-in-a-faces-validatorjsfdatabase