myfaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dan Harmer" <Harme...@ldschurch.org>
Subject Fwd: Anchors, navigation cases, and commandLinks/outputLinks
Date Mon, 21 Nov 2005 16:19:31 GMT
I submitted the email below about a week ago and received no response--perhaps
this isn't the right list to submit a question like this on?  I'd appreciate it
if someone could please direct me to a more appropriate place to pose the
question.  Should I log it in JIRA as a bug/wish list item?  Thanks,
 
Dan

>>> HarmerDR@ldschurch.org 11/14/2005 1:13:28 PM >>>
Hello,
 
I'm trying to accomplish the following scenario and could use some assistance
from someone who's accomplished this seemingly simple task:
 
1) Click on a commandLink on a page
2) Execute code from method binding on commandLink that was just clicked
3) Navigate to a page (possibly the same page) AND SCROLL to an anchor listed
on the page
 
I've tried to accomplish this by having my method binding return a string value
which represents a unique navigation case that has a <to-view-id> of a URL with
an anchor appended on it such as this:
 
     <navigation-rule> 
        <navigation-case> 
            <from-outcome>anAction</from-outcome> 
          <to-view-id>/somePage.jsp#someAnchor</to-view-id> 
          <redirect/> 
        </navigation-case> 
    </navigation-rule> 
 
With an anchor on the page like this:
<f:verbatim><a name="</f:verbatim><h:outputText value="someAnchor"
/><f:verbatim>" /></f:verbatim>
 
This results in the application appending a .jsp extension to the end of the
<to-view-id> URL value (ex: /somePage.jsp#someAnchor.jsp) instead of just
/somePage.jsp#someAnchor
 
I've also tried wrapping a commandLink with an outputLink--hoping to somehow
fire both the navigation to the outputLink value along with the bean.methodName
code:
 
       <h:outputLink value="module.faces##someAnchor"><h:outputText value="Test
Link" />
           <h:commandLink action="#{bean.methodName}">
            <h:outputText value="Bean Backed Test Link"/>
       </h:outputLink>
 
The outputLink works just fine by itself; however, I need a bean method to fire
as well before the navigation takes place.  This seems like a simple task that
would be very common.  I would greatly appreciate some guidance from anyone who
has done this or accomplished the same desired outcome via different means or
techniques.  If this isn't possible, perhaps I should log it as a wish list item
in JIRA?  Thanks,
 
Dan



------------------------------------------------------------------------------
This message may contain confidential information, and is
intended only for the use of the individual(s) to whom it
is addressed.
------------------------------------------------------------------------------

Mime
View raw message