cancel
Showing results for 
Search instead for 
Did you mean: 

The column's header not is displayed

achilles_froes
Champ in-the-making
Champ in-the-making
Hi everybody,

I customized the browse.jsp page to display some custom metadata, so far so good.
However the column's header not is displayed because a conditional that i did.
Like this:

<a:column id="cnpj" style="text-align:left" rendered="#{(BrowseBean.browseViewMode == 'details' || BrowseBean.browseViewMode == 'icons') && r.properties['custom:cnpj_contratante'] != null}">
<f:facet name="header">
<a:sortLink id="cnpj-sort" label="CNPJ" value="custom:cnpj_contratante" styleClass="header" />
</f:facet>
<h:outputText id="cnpj-txt" title="CNPJ" value="#{r.properties['custom:cnpj_contratante']}" />
</a:column>
The last conditional in a rendered property, "r.properties['custom:cnpj_contratante'] != null", makes the header disappear.
Some body have some idea about it?

Best Regards, Achilles Fróes.
6 REPLIES 6

savic_prvoslav
Champ on-the-rise
Champ on-the-rise
(BrowseBean.browseViewMode == 'details' || BrowseBean.browseViewMode == 'icons') && r.properties['custom:cnpj_contratante'] != null}

try to do only r.properties['custom:cnpj_contratante'] != null to see if this works first.

and then add other part.

achilles_froes
Champ in-the-making
Champ in-the-making
Thanks for you reply savic.prvoslav, i tried your suggestion, however happened the same thing.
If i remove the "r.properties['custom:cnpj_contratante'] != null" clause, the column appears, but in all views. This is not the intention.
Actually, i would like to know how make a condition by a custom metadata.
Indeed, looks like that the collection referenced by "r" variable is not filled yet, because i tried put "r.properties['custom:cnpj_contratante'] == null" and then the header appeared, but not the informations.   :?

savic_prvoslav
Champ on-the-rise
Champ on-the-rise
you can overide browse bean and do this conditin in java.
bu adding property resolover inside getcontent method and do something like this:
    List<org.alfresco.web.bean.repository.Node> cont = super.getContent();

for…
{
   cont.get(i).addPropertyResolver("propname", propname);
}

public NodePropertyResolver propname= new NodePropertyResolver() {
   private static final long serialVersionUID = -1280702397805414147L;

   public Object get(Node node) {
if( check your condition) return true; else return false;
   }
    };

and in jsp you acces this with #{r.propname}
this works 100%. hope it helps/.

achilles_froes
Champ in-the-making
Champ in-the-making
Hello savic.prvoslav,

I'm so sorry for the big delay, thank you very much for your help.
However, i don't know how override the BrowseBean class.  Smiley Surprisedops:
There are some tutorial?  Smiley Tongue

One more time, thank you very much.

savic_prvoslav
Champ on-the-rise
Champ on-the-rise
well you need to learn that Smiley Happy
see in SDK you have downloaded example custom Login ( something like that).
in this example LoginBean is being overriden, you shoud do same thing but for BrowseBean.

achilles_froes
Champ in-the-making
Champ in-the-making
Alright. Once again, thanks!  Smiley Happy