Opening a New window

Opening a New window

  

Hi,

I have the follow scenario:
1. Table records with late_load functionality, containing list of links
2. URL title is show in expression
3. Link property:
Method: Ajax
Extended property: Target: _blank
Destination: MarkItem screen action
screen action will
- remove selected item from entity and list variable
- refresh TR's container…
- …and (suppose to) open the link in a new window)

clicking on the link opens the desired URL, but in the same window, instead of opening in a new window...

I'm sure there is en easier approach out there, just not one I came up with...

Help would be greatly appreciated,

Dror
Hi Dror,

Let me see if I clearly understand what you want to do. You want to have a Tables Records where each link in the table record does the following when clicked:
1 - Opens a popup window;
2 - Calls an Ajax method that refreshes the current TableRecords container.

To do that, I would do the following:
  1. Create a hidden button in each the TableRecords line that executes the screen ajax action that refreshes the Table Records (do not forget to give a name to your button - eg. MarkItemButton)
  2. In your link, add an extended property onclick with a javascript code that first opens the popup and then clicks the hidden button MarkItemButton (this javascript code would look something like "window.open(...<put the window open parameters here>...); $('" + MarkItemButton.Id + '").click(); return false;"
Best Regards,

Daniel Lourenço
OutSystems
Hi Dror,

"Extended property: Target: _blank"
By what I understood you aren't using the richwidgets extension to do this, can you confirm this first of all?

Cheers,
Hermínio Mira
Hi,

I've managed to figure this out in a way similar to Daniel's proposal:

1. on the TR i've used an expression the present the URL title. set up "onclick()" event to open in a new window
2. Link "underneath" the expression will make an Ajax call to screen action which, amongst other, refresh the TR. 

Thanks,

Dror

Hi Dror , I'm glad I could help.

You solution is good - you open the popup window with the onclick javascript, but the ajax screen action is executed simply by associating it with the link - there is no need to have the hidden button called by javascript to execute the action.

Thanks for your answer!

Daniel Lourenço

Hi Daniel,
Following on with this implementation, what of when you are not using a richwidget and simply have a text field that links out to an outside URL i.e to www.outsystems.com and you want this to open in a new web page/tab?

Albert

Hi Albert,
 

In that case you simply want to open the URL destination in a new browser window, you only have to add an extended property named target to your link with the value "_blank".

See more about the HTML link target property at http://www.w3schools.com/TAGS/att_a_target.asp .



Best Regards,

Daniel Lourenço
OutSystems