2
votes

I have created an XPage with the following: Started by creating a custom layout control using the Application Layout. I aded the layout control to the xpage and then dropped in a Dynamic Content Control. I configured the control as follows:

<xe:dynamicContent id="dynamicContent1" defaultFacet="GovernanceReviews"
useHash="true">
<xp:this.facets>
<xc:ccViewDocumentTemplates xp:key="DocumentTemplates"></xc:ccViewDocumentTemplates>

<xc:ccViewGovProcurementReviews xp:key="GovProcurementReviews"></xc:ccViewGovProcurementReviews>

<xc:ccViewGovRevReporting xp:key="GovRevReporting"></xc:ccViewGovRevReporting>

<xc:ccViewGovRevWOCompleted xp:key="GovRevWOCompleted"></xc:ccViewGovRevWOCompleted>

<xc:ccViewGovernanceReviews xp:key="GovernanceReviews"></xc:ccViewGovernanceReviews>

<xc:ccViewProfilesByType xp:key="ProfilesByType"></xc:ccViewProfilesByType>

<xc:ccViewProfilesWithTargetCompl xp:key="ProfilesWithTargetCompl"></xc:ccViewProfilesWithTargetCompl>

<xc:ccViewLastUpdated xp:key="LastUpdated"></xc:ccViewLastUpdated>

<xc:ccViewUserGuide xp:key="UserGuide"></xc:ccViewUserGuide>

<xc:ccViewTracking xp:key="Tracking"></xc:ccViewTracking>

</xp:this.facets>

</xe:dynamicContent>

Then I dropped in a navigator control in the left column and created BasicLeafNodes to correspond to the dynamic content control I used the href property and used the #content="" to display the correct content.

This works just fine, but I am having problems figuring out how to make the selections in the navigator highlight when they are selected. I know I need to compute the Selectd property,but I can't figure out how to get the xp:key value so I can compare it to the SubmitValue. I know this is probably something simple, but I can't figure it out.

Can someone please enlighten me.

Thanks,

MJ

ADDED 03/26/2014 - I have a feeling that it has something to do with Using the href property of the Dynamic Content Control to perform the content switching. I know that makes the BasicLeafNodes Links. So, not sure how the Navigator records which link is being executed and how to capture that.

MJ

3

3 Answers

3
votes

Add a value is the submitValue property

enter image description here

And in the onItemClick Event

enter image description here

Assign the submitted value to a viewScope variable

viewScope.Selected=context.getSubmittedValue()

enter image description here And finally check if the viewScope variable equals your item submit value in the selected property. This needs to be calculated

if(viewScope.Selected="byCategory"){
    return true
}else{
    return false
}
0
votes

The following is working for me:

if(viewScope.Selected == "byCategory"){
    return true
} else{
    return false
}

An equality test must be made with two equal symbols (or three). One equal symbol evidently always returns true.

0
votes

I did it by jQuery. Just put the following code to the custom control, which contains navigator.

$( function() {
    if (window.location.hash.length > 0) {
        select()
    }
});

$(window).on('hashchange', function() {
    select();
});
function select() {
    $(".lotusColLeft .lotusMenu .lotusBottomCorner li").removeClass(
            "lotusSelected")
    $(".lotusColLeft .lotusMenu .lotusBottomCorner li a")
            .filter(
                    function() {
                        return window.location.hash.indexOf($(this).attr(
                                'href')) > -1
                    }).parent().addClass("lotusSelected")
}