0
votes

Here's my situation:

enter image description here

The categorized column is 'Department'. Is there any way for me to select only by 'Software'? Enabling checkbox for the viewColumn and viewColumnHeader don't seem to help. I'm required to have a checkbox next to each value in that column that when checked, select only document from that department.

1

1 Answers

2
votes

I think meeting your need within a ViewPanel is going to be difficult, if not impossible.

What you CAN do is add a combobox above the ViewPanel that is populated with a DbColumn pointing to the categorized column of your view. Then, when this is clicked your view will filter on the value.

  1. Add your combobox as stated above

  2. Add an onChange event to the combobox that sets a viewScope var (for ex. viewScope.category) with the combobox value. Set a partial refresh with the ViewPanel as the target.

    <xp:comboBox id="comboBox1">
    <xp:selectItems>
        <xp:this.value><![CDATA[#{javascript:@Unique(@DbColumn(@DbName(),"Admin",1))}]]></xp:this.value>
    </xp:selectItems>
    <xp:eventHandler event="onchange" submit="true"
        refreshMode="partial" refreshId="viewPanel1">
        <xp:this.action><![CDATA[#{javascript:viewScope.category = getComponent("comboBox1").getValue();}]]></xp:this.action>
    </xp:eventHandler>
    

  3. Finally, in the ViewPanel properties, set it to filter by category name and compute the value to be your viewScope.category value.

Now, when you click the combox and select a value your view will filter on that value.