0

in JSF page I the following code:

<h:dataTablevalue="#{rulesCntrl.getTblStati()}" var="stato" rendered="rdrGroupTable( #{rule.actuatorModule.model.type}, #{rule.funzione.chiave})"> 

where type and chiave are two integer. I wold like to pass these numbers to the following javascript function:

<script type='text/javascript'> function rdrGroupTable(moduleType, ruleFunction) { if((moduleType === 97) && (ruleFunction === 1)){ return true; } return false; } </script> 

but I get the message: Error Traced [line: 24] The entity name must immediately follow '&' in the entity reference.

Some help, please? Domenico

3
  • Stefan, currently the solution is the one you suggested but the purpose of the new version (client side) is to reduce network traffic and above all to speed up the response. Thanks for the contribution Commented May 9, 2019 at 8:19
  • 1
    Reduce network traffic by using ajax and partial submit. Moving things pure client-side introduces security risks and makes the application more complex. Commented May 9, 2019 at 8:26
  • Btw, rendered is an attibute which is evaluated at server side, when the HTML gets rendered. You can't use any javascript at this point. Commented May 9, 2019 at 12:41

1 Answer 1

1

I suggest you put the logic in your bean. In JSF page:

... rendered="#{rulesCntrl.isRdrGroupTable(rule.actuatorModule.model.type, rule.funzione.chiave)}" ... 

In RulesCntrl.java:

public boolean isRdrGroupTable(int type, int chiave) { return moduleType === 97 && ruleFunction === 1; } 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.