AJAX is not working in child repeater data bind - repeater

i have a Parent repeater and one child repeater which is inside parent repeater.
From a text box i am posting some contents to parent repeater which works with AJAX update panel (without posting back page), but from another text box if i am posting to child repeater, then i checked table the data was inserted but its not displaying in child repeater. Once i will refresh my page then data in child repeater will display.
How can i achieve this without page postback. i.e. i want to do it with client side either AJAX or, java script or jquery. kindly provide the code.

Related

Open a modal from anchor tag but the content is from another page

Is it possible to open a modal from anchor tag but the content is from another page? If yes, can anyone help me on how to do this? Btw I'm using Odoo, there is a default add to cart page in Odoo, so all code there was already default and I can't just get the content of the specific part from add to cart page and load it in my modal which is another page.
You need to write a JS function to achieve this. When clicking on a button, you can listen to button click and show your modal accordingly. Odoo uses jQuery by default so you can call something like this.
$(".button-class").click(function() {
// do some stuff here
// either do jsonRPC to get data from another record.
// add values to the body
// finally show your modal
$(".modal-class").modal("show");
}

Sitecore 8, MVC, Experience Editor: How to make a rendering refresh after a Field Editor Button has been used

We have a rendering listing the selected items in a TreeSelect in the current item. In our case we call them "Tags" (1)
We have added a Field Editor Button to the component to let the editor change selected items. (2) (As described on for example Adding a custom component)
When an editor clicks (2) the editor window (3) it is opened in a dialog. The editor may select different items(called tags in our case) using the TreeSelect.
When the editor presses the ok-button (4) the values are set.
Now to the problem:
The values are actually set as they get stored when the editor presses the Save button but we want our list on the page (1) to immediately reflect the set items when the editor presses the ok-button (4), i.e. before having to actually save the whole item.
How do we achieve that?
(I am in contacts with Sitecore support but so far I have not gotten any answers...)
Update
After a lot of conversation with the support we still have no useful solution.
We tried turning it into a field renderer displaying the links.
What worked was:
The field do get updated when you have edited it in the popup field editor. (but...)
It looks good the first time when page is loaded.
You can make a WebEdit button with commands to edit the field and add it as Custom button to the field (register <command name="webedit:fieldeditor" type="Sitecore.Shell.Applications.WebEdit.Commands.FieldEditor, Sitecore.Client"/> and set Click on the button to webedit:fieldeditor(command={3473DDA1-2983-493C-AF7A-054C75AA7AD3},fields=NameOfField where the guid points to itelf and an "Icon" is set on it.)
What didn't work was:
The field get updated by the raw value, not what I want to display. Server code is involved, but not in the rendering of html-code.
When I want to edit the value in the field editor, the value sent to the field editor is not the raw value but what actually is displayed on the page. (I guess this can be solved somehow)
The issue to the support turned into a feature request to let the server be involved in rendering the field, not just sending a new value to the JavaScript updating it. The server does the first rendering so when it already is involved in updating, it should be allowed to do the rendering the following times too.
We have decided to not spend more time on this right now (we have other things to do too.) and have a bad editor experience as the field not get updated until the editor actually saves the item.
Still we have no suitable solution for this issue. If you want to keep working on it and want a reference to my issue it is 439059.
This may not be useful here. I've done this in normal sites, but not in Sitecore. But, here's one possibility....
This is a situation where you would pass a callback function to the child popup window. This callback will cause the caller / parent window to re-read/re-load the information that was just updated by the child.
Example:
User presses (2) to open Editor Window(3) (Editor window is opened and the Callback function is passed as a parameter)
User presses "OK" button (4). The "OK" button event handler updates the changes, then calls the Callback function which re-loads the now updated information, and closes the popup window.
Once the popup closes, the parent window now displays the information that the popup/editor just updated.
This takes some client side javascript (jquery) development but it is quite do-able normally.

Which is the best approach to get the sitecore item on ajax call

Think about the scenario, where the page has to render the content dynamically when they do some operation on page.
Here basically, page will contain a list of rendering and in each rendering we will be able to get the current item using below statement.
var item = Sitecore.Mvc.Presentation.RenderingContext.Current.Rendering.Item;
Now if i have to show the content on button click, we will do a ajax call to our mvc controller/action, and in our Action we can render the item by following statements.
Item item = SitecoreHelper.GetSCDb().GetItem("{item id}");
or
Item item = SitecoreHelper.GetSCDb().GetItem("item path");
But in both the cases we have to hardcode the id/path.
So can anyone tell me, is there any better approach to do this.
I appreciate your help.
Cheers:)
Something I've done on Sitecore + MVC projects was for content items that are going to be accessed by both Page Editor and by AJAX calls in JavaScript, is creating a new device in that items template _StandardValues, in that I set the query to ?Ajax=true. I then put only the HTML piece (without styles, and JS) as the layout. While the desktop view has what it would look like "after" it's been called by AJAX. This doesn't need any .net coding, it's all done via sitecore.

Umbraco macro - Displaying content in all nodes

I have a navigation bar in which all links are grabbed from Umbraco items (entered by the user). This navigation bar needs to be displayed on all pages. I tried inserting the items into the master template, but the links are not passed down to slave nodes. So, I'm assuming I need some sort of a macro which grabs the content and displays on all pages.
Does anyone have any suggestions?
I answered a question about creating a multi-level XSLT navigation menu a while back:
Create multilevel menu for umbraco using XSLT?
Perhaps that will get you going?
I think the key is that you need to get to the top of the content tree (home), then build the navigation. Otherwise the nav will be based on where in the tree the current page is.

Programmatically create a table of contents in the Parent wiki page with the titles of the child pages as content

I am creating child wiki pages under one single parent page using a python script using confluence cli.
These appear as child pages at the bottom of the parent wiki page.
The requirement is that I need to create a Table of Contents in the parent page. This should contain the titles of the child pages that are being created.
I am not able to find how to add this Table of Contents, any pointer on how to do this please?
I am using confluence CLI for creating the wiki pages as follows:
confluence_cli = confluence.Client()
confluence_cli.add_page(parent-page-title, child-page-title, child-page-data)
What is the way to add a link to the child-page from within the parent-page?
You can add a Children Display macro to the parent page. This will list all children and even sub-children if desired.