Problem with hyperlink actions

View: New views
4 Messages — Rating Filter:   Alert me  

Problem with hyperlink actions

by Ted Byers :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Using NetBeans 6.1 (with project created using NetBeans 6.0)

I created some hyperlinks a while ago (when using NB6.0), and this week I added action handlers link the following:

    public String hyperlink3_action() {
        getSessionBean1().setInPeriodSelectionComboboxChange(false);
        getSessionBean1().setPeriodSelected(0);
        return null;
    }


There are about 10 of these hyperlinks with nearly identical handlers.  I put a break point in each handler, and started debugging.  Not one of my handlers was invoked!

If I right-click a hyperlink when in design mode, I see an item called "Edit action", and selecting that action takes me to the java file, where I can provide the content of the handler, such as what I show above.

So then, what is the magic for getting these handlers invoked?

These had been set up initially with an url, and my intent was to have the event handler invoked and then proceed on to the page designated by the provided url.

Thanks

Ted

Re: Problem with hyperlink actions

by Rick Fincher :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Ted,

The _action method only gets called if the url property of the hyperlink
is blank.

The action items are only used for Navigation. That method gets called
and the text it returns is used to navigate to another page just like a
submit button.

Rick

Ted Byers wrote:

> Using NetBeans 6.1 (with project created using NetBeans 6.0)
>
> I created some hyperlinks a while ago (when using NB6.0), and this week I
> added action handlers link the following:
>
>     public String hyperlink3_action() {
>         getSessionBean1().setInPeriodSelectionComboboxChange(false);
>         getSessionBean1().setPeriodSelected(0);
>         return null;
>     }
>
>
> There are about 10 of these hyperlinks with nearly identical handlers.  I
> put a break point in each handler, and started debugging.  Not one of my
> handlers was invoked!
>
> If I right-click a hyperlink when in design mode, I see an item called "Edit
> action", and selecting that action takes me to the java file, where I can
> provide the content of the handler, such as what I show above.
>
> So then, what is the magic for getting these handlers invoked?
>
> These had been set up initially with an url, and my intent was to have the
> event handler invoked and then proceed on to the page designated by the
> provided url.
>
> Thanks
>
> Ted
>  


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Re: Problem with hyperlink actions

by Ted Byers :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Damn!  I hate when my intuition is right!  ;-)  I had a suspicion that I might have to resort to that kind of navigation, but I couldn't find supporting documentation (probably looked in the wrong place - for some reason, with the default complete installation, NetBeans can't find the documentation for the VW controls on my system).

Oh well. I have a lot of hyperlink controls to edit tomorrow, as well as some tedious creation of navigation based on strings returned by these functions.

Thanks

Ted

Hi Ted,

The _action method only gets called if the url property of the hyperlink
is blank.

The action items are only used for Navigation. That method gets called
and the text it returns is used to navigate to another page just like a
submit button.

Rick


Re: Problem with hyperlink actions

by Rick Fincher :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Ted,

It's not so bad once you get used to it.  One thing that might help you
is that you can use wild cards in the navigation.xml file.
I have a web app with User pages and Admin pages.  I start the name of
all my admin pages with "Admin" so a rule like the one below covers them
all.  That won't help you a lot if you have one page with a lot of links
that aren't used by other pages.

 <navigation-rule>
        <from-view-id>/Admin*</from-view-id>
        <navigation-case>
            <from-outcome>SimpleSearch</from-outcome>
            <to-view-id>/AdminSimpleSearch.jsp</to-view-id>
        </navigation-case>
        <navigation-case>
            <from-outcome>AddUser</from-outcome>
            <to-view-id>/AdminAddUser.jsp</to-view-id>
        </navigation-case>
</navigation-rule>

Rick


Ted Byers wrote:

> Damn!  I hate when my intuition is right!  ;-)  I had a suspicion that I
> might have to resort to that kind of navigation, but I couldn't find
> supporting documentation (probably looked in the wrong place - for some
> reason, with the default complete installation, NetBeans can't find the
> documentation for the VW controls on my system).
>
> Oh well. I have a lot of hyperlink controls to edit tomorrow, as well as
> some tedious creation of navigation based on strings returned by these
> functions.
>
> Thanks
>
> Ted
>
> Hi Ted,
>
> The _action method only gets called if the url property of the hyperlink
> is blank.
>
> The action items are only used for Navigation. That method gets called
> and the text it returns is used to navigate to another page just like a
> submit button.
>
> Rick
>
>
>  


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...