1

I need to do something like this, since the rendering depends on the id's value which is also available on my DB:

<p:submenu id="id123" rendered="#{mybean.decidedependingof(login.user,component.attributes.get('id'))}">

Actually I can obtain the value of the 'id' attribute and use it in the next way for example:

<p:submenu id="id123" label="#{component.attributes.get('id')}">

which gives me a label with the exact value of the id attribute, but I suppouse that at render time that value is not available yet and the above code is passing a uknown value to the mybean.decidedependingof(..) method.

Any possible solution? Thanks.

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
  • can you get access to this component.attributes.get('id') from mybean? – Maciej Kowalski Jan 31 '17 at 20:43
  • I dont know, but doubt if that would help any way. In the way i'm using it now the component.attributes.get() is called from inside the component and I interpret the 'component' part in an analogous way as I would interpret the 'this' keyword in Java, so it is relative to 'this' component. I really dont know how to get the same from the bean if that is possible, and how could it help in that case.. – imnotthatrobot Jan 31 '17 at 20:53
  • Welcome to Stack Overflow! Please review our [SO Question Checklist](http://meta.stackoverflow.com/questions/260648/stack-overflow-question-checklist) to help you to ask a good question, and thus get a good answer. – Joe C Jan 31 '17 at 21:26
  • OK I get it now.. I'll try some tests later on – Maciej Kowalski Jan 31 '17 at 22:05

0 Answers0