I put a <h:messages/> tag at the bottom of the main page and did not see
anything as far as a validation error goes.  The listener and action are
quite simple.  Not sure why it is not hitting it.  It appears that there are
no validation errors and the Listener and Action are not being executed by
the commandLink.  We are using tomahawk 1.5


I also put in immediate="true" in the commandLink which is supposed to
bypass the validation phase, but it will still not hit the Listener or the
action.  The command link works the first time but not the second.  The
commandLink is in a popup section.  The main page code and the popup code
are in the same xhtml file.

       <t:commandLink
                immediate="true"
                actionListener="#{ptGroGroup.chooseGroupListener}"
                action="#{ptGroupAdmin.mainScreenAction}"
                id="idCommandLinkGroupName">
            <h:outputText id="groupName" value="#{row.groupName}"/>
        </t:commandLink>

The chooseGroupListener looks like this:
    /**
     * Is executed when a user hits the group hyperlink to select a group.
     * Sets the selected group.
     */
    public void chooseGroupListener(ActionEvent event)
    {
        System.err.println("--- PtGroGroup.chooseGroupListener() ---");
        GroGroup o_Group = (GroGroup) Go_Table.getRowData();
        o_Group.copyTo(this);
        mUserInfo.setGroupId(getGroupId());
    }

The Action is in another class and looks like this:
    /**
     * This Action is called when a user selects a group from the popup
search results.
     *
     * @return
     */
    public String mainScreenAction() throws Exception
    {
        System.err.println("--- PtGroupAdmin.mainScreenAction() ---");
        closePopup();   // close popup if it is open
        return mMainScreen;  // string of screen mapped in
faces-config-actions-common.xml (navigation case)
    }


I am using <t:saveState> on both classes where both methods are found.  I
never see the println messages in the tomcat log window and the popup window
will not close because it never hits mainScreenAction() - although on the
first round through it works just fine.  It's just that after the second
popup, it will not close again and I must exit the application.






Lisa wrote:
> 
> I have a popup page that displays a list of rows from a table (using
> dataTable).  Each row contains a column that is a commandLink.  When
> clicked it goes to the backend bean Listener and using UITable sets the
> current object selected and then goes to an Action which sets to false a
> rendered flag that should close the popup.
> 
> The first time the page loads, I can do a search and the results popup.  I
> click on the hyperlink and the actionListener and the action get invoked
> properly.  The property gets set and the popup closes.
> 
> However on the second time I hit the commandLink after getting the popup,
> it will never hit the actionListener or the action method in the BB.  I am
> using <t:saveState on all BB's.
> 
> Why would this work the first time but not the second or subsequent times? 
> puzzleing.  I have tried everything to no avail.  The actionListener is a
> method in one BB and the action is a method in another BB.  Both have
> scope as set by <t:saveState on the same page.
> 
> 
> --- The whole example is too complex to post here but the commandLink is
> simple
> 
>    <h:column>
>         <f:facet name="header">
>             <t:commandSortHeader columnName="groupName" arrow="true">
>                 <h:outputText value="Group Name"/>
>             </t:commandSortHeader>
>         </f:facet>
>         <t:commandLink
>                 actionListener="#{ptGroup.chooseGroupListener}"
>                 action="#{ptGroupAdmin.mainScreenAction}"
>                 id="idCommandLinkGroupName">
>             <h:outputText id="groupName" value="#{row.groupName}"/>
>         </t:commandLink>
>     </h:column>
> 
> ---
> Since the actionListener or action, never get invoked the second time
> around, the popup stays there, the page behind the popup is never updated. 
> Weird that it works the first time, but not second.
> 
> 
> Simon
> --
> 

-- 
View this message in context: 
http://www.nabble.com/commandLink-not-working----tf2970681.html#a8367575
Sent from the MyFaces - Users mailing list archive at Nabble.com.

Reply via email to