> -----Original Message----- > From: Virtudazo, Dennis (Exchange) [mailto:[EMAIL PROTECTED] > Subject: RE: How Can I make CommandLink support opening in new window > CommandLink already has a "target" attribute. > But I think I understand the problem now. CommandLink > actually submits the form via the onclick javascript. But the > IE "open on new window" > option doesn't trigger the onclick script, it just opens the href url > ("#") on a new window, so the form isn't submitted.
Yeah, I understand your problem and congrats for finding such an interesting case :) I can think of a few approaches to go around, not really fix the problem. You could render an icon after a link to open in a new window (you know those small box icons with a small arrow pointing top-right). Better yet, you could make an extended CommandLink (or hell, just add to the x:commandLink) with an additional attribute "newWindowLink" with default value false, and if set to yes, the component would render the icon with a link for you. Then donate the component to MyFaces and get praise and glory :) That would also save the user the trouble to right-click the link. Another approach would be to render the link with some GET request parameters. If the link is left-clicked those parameters would be ignored and it would do a normal post request, but if the link is right-clicked you could use those parameters to somehow (yes, it would require some more thought) figure out which action the user actually meant. I would consider it a hack but I bet you'd get it to work with something like that. Kalle > -----Original Message----- > From: Heath Borders [mailto:[EMAIL PROTECTED] > Sent: Friday, March 11, 2005 11:09 AM > To: MyFaces Discussion > Subject: Re: How Can I make CommandLink support opening in new window > > > You'd have to do a bit of custom work to get it to go. Here's the > problem: CommandLink needs to submit a form in order to fire > its event. > However, the form tag doesn't have a "target" attribute specified, I > don't think. > > Probably the easiest thing to do would be to override the > commandLinkTag > and commandLinkRenderer to supply a target attribute. > Then, instead of just submitting the form, you could change the form's > target the attribute you specify in the tag, and then submit the form, > and then chage the target back to blank. > > > On Fri, 11 Mar 2005 10:12:17 -0500, Virtudazo, Dennis (Exchange) > <[EMAIL PROTECTED]> wrote: > > No I don't want to do that. I want to give the user the option to > > open in the same window (default) or in a new window. > > > > -----Original Message----- > > From: Bruno Aranda [mailto:[EMAIL PROTECTED] > > Sent: Friday, March 11, 2005 10:06 AM > > To: MyFaces Discussion > > Subject: Re: How Can I make CommandLink support opening in > new window > > > > If it applies, you can use an outputLink with target="_blank". > > > > Regards, > > > > Bruno > > > > On Fri, 11 Mar 2005 10:01:17 -0500, Virtudazo, Dennis (Exchange) > > <[EMAIL PROTECTED]> wrote: > > > CommandLink appears as a regular link on the page, but when you > > > right-click and choose "open in new window" (using IE), > it opens a > > > new > > > > > window on the same page without actually invoking the > action for the > > > > link. > > > > > > Any suggestions how to make this work? > > > > > > > ******************************************************************** > > > ** > > > * > > > Bear Stearns is not responsible for any recommendation, > solicitation, > > > offer or agreement or any information about any transaction, > customer > > > account or account activity contained in this communication. > > > > > > ********************************************************************** > > * > > > > > > > > > > > ********************************************************************** > > * > > Bear Stearns is not responsible for any recommendation, > solicitation, > > offer or agreement or any information about any > transaction, customer > > account or account activity contained in this communication. > > > ************************************************************** > ********* > > > > > > > -- > -Heath Borders-Wing > [EMAIL PROTECTED] > > > ************************************************************** > ********* > Bear Stearns is not responsible for any recommendation, solicitation, > offer or agreement or any information about any transaction, customer > account or account activity contained in this communication. > ************************************************************** > ********* > >

