How to use two arrays together in k-object tag in Kitsune? - arrays

We are calling every dynamic data under location's schema except business updates. Everything is fine except update-details page because, in update details page we have the k-object tag of updates.
When we are moving out from update-details page to any other page, where k-object tag is of location then the k-dl tag of with location is not accessible.
For e.g.
URLs before getting into update-details page.
www.example.com/bhutan/about-us/k._id
URL after getting into update-details page.
www.example.com//about-us/
Please help...

If i understand this question right, you want to access object in another array while you are navigating from one details page to another ?
In this case, Kitsune allows you to access any array in any page. Say you have a page with:
k-object="[[update in Business.updates]]"
in the same page you want to navigate to another page, which is details page of a product, then -
Click Here
Let me know if this answers your question, else do give me code examples for me to give a clearer answer.

Related

adf task flows in page fragments

I have a main page (main.jsff) where the header, footer and the menu is the same for all pages. which changes every navigation is the region.
The other pages I have (.jsff) correspond to fields of research and a table of detail. In search fields (inputText) added a autosugestbehavior. However when I am in one of the pages, eg bookingSearch.jsff and test to see if the autosuggest works it changes the page after you enter a letter.
Always go to the main page.
I checked the code (bookingSearch.java) and not have anything to point to another page. I think the problem is in the tasks flows.
Does anyone know?

AngularJS - how to use a route with dynamic data for template

I'm not sure what I'm fully after really hence this could easily be a duplicate of another topic - if so please direct me :)
Anyway, what I want to do is something like a shopping page, where there is a page listing out all the items. This part I can do fine :)
The issue I have is I only want one page which "details" each item - as they all share the same layout. So in this case, depending on what's selected, it routes to a details page (maybe with corresponding ID of some sort) that displays the details of whatever clicked.
Is this possible? Hope I've explained this well enough - if not please let me know.
TIA
You don't need to use a route for each item. You can use a route for the page itself (with ngView, for example) to present the details page, and then (assuming you have an object with the data) you present the current item's model appropriately.
If you can present some code I can give you a better idea.

cakePHP Paginator::numbers() function does not include a page:1 parameter in the link for the first page

I have been trying to create a component like the Bakery's Paginator Recall that would allow me to save pagination data for CakePHP 2.4 and run into the following issue.
All solutions involve saving the Paginator parameters in the session and then retrieving and applying them upon returning to that same page without specifying any.
This approach would have worked if only the Paginator helper functions like numbers(), first() and previous() would include the page:1 named parameter in the links that they generate for moving to the first page like the corresponding function of the 1.3 version.
Unfortunately all of these functions create URLs without the page parameter when they refer to the first page, so when users click on the first page link, the component does not find any paging info and hence it returns them to the previous position.
There must be some way to work around this, but for the moment I am completely stuck.
NOT including the page number in the link to the first page is by design.
Read the reason on the CakePHP 2.4 Migration guide.
I would suggest to use the same convention. When you do not have pagination information assume is page one, and do not add it to your URLs.
So all you have to do is code this special case when then pagination is missing. And in this special case your "recall" component will simply not add that page.
I believe that I have managed to create a working solution. Thanks to the advice I have received I have now created a working component like the original PaginationRecallCompoent.
I have written all the details in the following blog post.

StaleElementReference Exception

I am struggling with the StaleElementReferenceException problem. I have seen quite a number of discussions on the topic but I haven't been able to find a solution to the issue that I am facing.
The test is to get all the links on the footer of the web page and then verify whether the link is active or not by clicking on it and verifying the title of the page.
First of all, I find & store all the links in an array list. I compare the link name with the values retrieved from the database. Then for each link, I click on it and verify the page title. Then using 'driver.navigate.back()', go back to the original page and continue with the rest of the links.
However, when the control returns back to the page, the StaleElementReferenceException occurs.
Can anyone suggest me a way out of this?
Thanks,
Anuj
When you are storing all the links in the footer you are grabbing those elements as they are at that point in time. Upon navigating to a different page those particular elements no longer exist. When you return to the back these elements have been created anew.
While the elements are the same via identifiers, they are different instances and thus your old elements in your array are 'stale'.
I would suggest storing only the link identifiers (not the link elements themselves) as strings and then search for them each time the page has loaded.
I faced a similar issue, in my case when I type something into a text box it would navigate to another page, so while I come back on the previous page, that object gets stale.
So this was causing the exception, I handled it by again initialising the elements as below -
PageFactory.initElements(driver, Test.class);
So when you navigate back, make sure you are initialising all the elements of that page again, so that the object does not get stale.
You can handle going and coming to new tab as follows:
String baseHandle = driver.getWindowHandle();
Set<String> sr = driver.getWindowHandles();
if (sr.size()>1){
Set<String> sr1 = driver.getWindowHandles();
sr1.remove(baseHandle);
Iterator itr = sr1.iterator();
driver.switchTo().window(itr.next().toString());
System.out.println("Page Title is : " + driver.getTitle());
driver.close();
driver.switchTo().window(baseHandle);

DotNetNuke Switching Between Multple Edit Modules

I have a custom module in DNN 7 that has a data structure where items belong to categories (called "sections", not DNN taxonomy, just a simple list of section names). The module edit screens work so that on the view control you may click on an edit link on each category, which loads the category edit screen (passing the category id). This works great, and when you save I use Globals.NavigateURL() to return to the view screen. This all works as intended.
On each category edit screen I also have a list of the items within that category, each with an edit link. Clicking the edit link opens the item edit screen, passing the correct item id, and allowing me to edit that item. This all works great, until you save. The save works properly, but when I want to send the user back to the edit screen for the category it doesn't work. When I use:
Response.Redirect(EditUrl("SectionId", sectionid.ToString(), "EditSections"), true);
...nothing happens. It simply doesn't redirect anywhere. This is exactly the same URL I'm using to get to the category edit page in the first place:
EditUrl("SectionId", Eval("SectionId").ToString(), "EditSections")
And then I use a similar URL to get to the item edit page:
EditUrl("ItemId", Eval("ItemId").ToString(), "EditItems")
I don't understand why using the same URL to navigate to the same page I already navigated to would simply not do anything. For now I am sending them all the way back to the view, but it's painful if you need to add several items to the same category to have to navigate back into the category and add another item, only to be sent back to the view.
Anyone see anything like this before?
Have you tried to use the overload of NavigateUrl instead of EditUrl?
Globals.NavigateURL(TabId, "EditSections", "mid", ModuleId.ToString(), "SectionId", Eval("SectionId").ToString())
I haven't seen that myself but I would have to assume that somehow the context is being lost with EditURL and you're not getting sent to the proper location due to that.
I would suggest you try one of two things (or both).
Debug the URL that EditURL is returning and see if you can find the
difference.
Use NavigateURL for all your links and pass in MID=## for your
moduleid as a querystring parameter, to ensure that the proper
values are being passed.
UPDATE: If you're trying to have multiple edit views, and move between them, you might look at using a "loader" instead of having separate module definitions for the edit controls. Basically have a single Edit.ascx file defined, and it loads other ASCX files within it, injecting into a Panel. The View control on this module http://dnnsimplearticle.codeplex.com/ does that, but I haven't tried it with an edit control before.

Resources