Dynamic URL link opening in same window!

Hello Gurus,

I’ve created a dynamic page with shows Dataset Query results. The Party Name column links to another Dynamic URL Page based on two parameters from the same row.

To try type ‘state’ as ‘party name’ or ‘313’ as ‘string to search’!

This much is working fine, but the only (and defeating) problem is that the link opens in the same window and user navigates to the new dynamic page.

How can this new dynamic page be set to open in new window?

Thanking in anticipation!

Anupam Dubey

It can be done, if you set the link via code. You then set both the link and target attributes, setting the target to open in another window.

See LinkableMixin - Velo API Reference - Wix.com

Thanks Yoav,

Itried but couldn’t succeed being new novice in coding. Please guide how to use $w.LinkableMixin’, couldn’t find any related example code.

Following is the code am using for ‘title’/‘party name’ search:

export function partySearch_onclick(event) {
let searchValue = $w(‘#partyInput’).value;
wixData.query(‘JudgmentNotes’)
.contains(‘title’, searchValue)
.find()
.then(res =>
{
let foundItems = res.items;

$w(“#resultsTable”).columns = [
{
id: “col1”,
dataPath: “title”,
label: “Party Name”,
width: 150,
visible: true,
type: “string”,
linkPath: “link-JudgmentNotes-_id-title”
//linkPath is set to the dynamic url field in the dataset.
//How can this link value be set to something similar to:

//https://www.daaman.org/JudgmentNotes/{link-JudgmentNotes-_id-title}
//OR
//linkPath: “https://www.daaman.org/JudgmentNotes/{ID}/{Referrence}

//How to set both the link and target attributes to enable it open in new window?
},
{
id: “col2”,
dataPath: “court”,
label: “Court”,
width: 150,
visible: true,
type: “string”
},
{
id: “col3”,
dataPath: “date”,
label: “Date”,
width: 150,
visible: true,
type: “string”
},
{
id: “col4”,
dataPath: “citation”,
label: “Citation”,
width: 150,
visible: true,
type: “string”
},
{
id: “col5”,
dataPath: “held”,
label: “Held”,
width: 467,
visible: true,
type: “string”
},
{
id: “col6”,
dataPath: “_id”,
label: “ID”,
width: 0,
visible: false,
type: “text”
},
{
id: “col7”,
dataPath: “referrence”,
label: “Referrence”,
width: 0,
visible: false,
type: “text”
}
];
$w(‘#resultsTable’).rows = res.items;
});
}
Please help.

Anupam Dubey

I have just checked your site, and it looks to be working.
Have you solve the problem?
Or is there anything else we can help you with?

Thanks Yoav for checking the site,

The problem am struggling with is that the code generated dynamic link from the search result table opens in same window, instead of new window or a popup, because currently when the user navigates to the new link, on returning to the main search page to check other search results, main page gets refreshed and all search results are gone.

How to make this code generated dynamic link in table to open in new window or a popup so that user can have more than one dynamic link open at the same time?

Thanks

Anupam Dubey

I undersatnd the problem and it’s reason but am not sure how to code the solution.
Please help


$w(“#resultsTable”).columns = [
{
id: “col1”,
dataPath: “title”,
label: “Party Name”,
width: 150,
visible: true,
type: “string”,

linkPath: “link-JudgmentNotes-_id-title”

         //linkPath is set to the dynamic url field in the dataset. 

//How can this link value be set to something similar to:

//https://www.daaman.org/JudgmentNotes/{link-JudgmentNotes-_id-title}
//OR
//linkPath: " https://www.daaman.org/JudgmentNotes/{ID}/{Referrence} "

//How to set both the link and target attributes to enable it open in new window or a popup?


Hay Anupam,

Unfortunately, there is no option at this time to open links from a table in a new window. Sorry for that.

Will have an alternate solution soon.

What you can do in the meantime, is store the last search value in session or local storage and re-set the value on page loading (from the $w.onReady function)

Thanks Yoav for guiding,

Will try the way you suggested and let you know.

Thanks again

Storing in session if fine but wondering how to triger a new window from table link…

Yoav…ever come up with solution? Pretty odd logic to have links from repeaters to open in same window. Logically you are going to build a search into a repeater, and with opening in same window, you then lose the search results and have to start all over once you have viewed the dynamic page you clicked to. Very NOT user friendly!

Having same issue. Any recent ideas or solutions for this? thanks

@yoav-wix any alternate solution for this issue now?

Yoav,

Can you explain this a little more:
"What you can do in the meantime, is store the last search value in session or local storage and re-set the value on page loading (from the $w.onReady function) "

I’m trying to bring a user back to the search results after they click on a item link to the dynamic page from the results.