The order change in orderList has no effect on the list variable. I tried primefaces orderlist not getting updated with the changed order and Primefaces: How to persist reordered data from a p:orderList? and checked multiple other question, however none worked for me. I added process and update the orderList in the submitting command button, I added ajax processing to the command button, immediate to orderList, still nothing.
HTML
<p:dialog id="editDialog" widgetVar="editDialog" header="Editace dokumentu" modal="true" showEffect="fade" width="90%" height="80vh" resizable="true" closable="true" closeOnEscape="true">
<p:outputPanel id="container" widgetVar="container" style="width: 100%; height:100%;">
<h:form id="editTable" widgetVar="editTable">
<p:panelGrid layout="grid" columns="2" columnClasses="label,value" styleClass="ui-panelgrid-blank" rendered="#{documentsInboxView.pdfFileType}">
<p:outputLabel value="Pořadí stránek" for="#next" rendered="#{documentsInboxView.filePagesNumber gt 1}"/>
<h:form rendered="#{documentsInboxView.filePagesNumber gt 1}">
<p:orderList value="#{documentsInboxView.pagesOrder}" var="page" itemValue="#{page}" itemLabel="#{page}" style="width: 100%;" controlsLocation="right" responsive="true" id="pagesOrderOrderList" widgetVar="pagesOrderOrderList" immediate="true">
<p:column>
<h:outputText value="#{page}" />
</p:column>
</p:orderList>
<p:commandButton ajax="true" type="submit" value="Změnit pořadí" onstart="PF('blockUIWidget').show();" oncomplete="PF('blockUIWidget').hide();" actionListener="#{documentsInboxView.changePagesOrder}" immediate="true" update="#widgetVar(container) #widgetVar(pagesOrderOrderList)" process="#this #widgetVar(pagesOrderOrderList)"/>
</h:form>
</p:panelGrid>
</h:form>
</p:outputPanel>
</p:dialog>
Adding ajax to the orderList with processing and updating the orderList solved the issue.
<p:orderList value="#{documentsInboxView.pagesOrder}" var="page" itemValue="#{page}" itemLabel="#{page}" style="width: 100%;" controlsLocation="right" responsive="true" id="pagesOrderOrderList" widgetVar="pagesOrderOrderList" immediate="true">
<p:ajax event="reorder" process="#this" update="#this"/>
<p:column>
<h:outputText value="#{page}" />
</p:column>
</p:orderList>
Related
When browsing for an image from an Image field in Sitecore 7, is it possible to default to the "Browse" tab as opposed to the new "Search" tab?
The new search functionality is great for advanced users, however, my content authors are finding it confusing, especially with multiple languages showing up in the results. Selecting a search result item also yields an error in some cases, so I'd just like to disable it at this point.
on this file \sitecore\shell\Applications\Media\MediaBrowser\MediaBrowser.xml
you need to change order of the tabs :
You will have :
<Tabstrip ID="Tabs" Width="100%" Height="471px">
<Tab ID="MediaLibraryTab" Header="Browse" Height="100%">
<GridPanel Width="100%" Height="100%" Style="table-layout:fixed" Columns="3" GridPanel.Height="100%">
<Scrollbox Height="100%" Class="scScrollbox scFixSize scFixSize8" Background="white" Padding="0px" GridPanel.Height="100%" GridPanel.Width="200" GridPanel.VAlign="top" Style="overflow:auto">
<TreeviewEx ID="Treeview" DataContext="MediaDataContext" Click="SelectTreeNode" DblClick="TreeViewDblClick" ShowRoot="true" ContextMenu='Treeview.GetContextMenu("contextmenu")' Width="100%" />
</Scrollbox>
<VSplitter ID="MediaBrowserLeft" Target="left" GridPanel.Width="4" />
<Scrollbox ID="Listview" Width="100%" Height="100%" Class="scScrollbox scFixSize scFixSize8" Background="white" Padding="0px" GridPanel.Height="100%" GridPanel.Width="100%" GridPanel.VAlign="top" />
</GridPanel>
</Tab>
<Tab ID="MediaTab" Header="Search" Height="100%">
<Frame SourceUri="/sitecore/shell/Applications/Buckets/MediaBrowser.aspx" Width="100%" Height="100%"></Frame>
</Tab>
</Tabstrip>
instead of :
<Tabstrip ID="Tabs" Width="100%" Height="471px">
<Tab ID="MediaTab" Header="Search" Height="100%">
<Frame SourceUri="/sitecore/shell/Applications/Buckets/MediaBrowser.aspx" Width="100%" Height="100%"></Frame>
</Tab>
<Tab ID="MediaLibraryTab" Header="Browse" Height="100%">
<GridPanel Width="100%" Height="100%" Style="table-layout:fixed" Columns="3" GridPanel.Height="100%">
<Scrollbox Height="100%" Class="scScrollbox scFixSize scFixSize8" Background="white" Padding="0px" GridPanel.Height="100%" GridPanel.Width="200" GridPanel.VAlign="top" Style="overflow:auto">
<TreeviewEx ID="Treeview" DataContext="MediaDataContext" Click="SelectTreeNode" DblClick="TreeViewDblClick" ShowRoot="true" ContextMenu='Treeview.GetContextMenu("contextmenu")' Width="100%" />
</Scrollbox>
<VSplitter ID="MediaBrowserLeft" Target="left" GridPanel.Width="4" />
<Scrollbox ID="Listview" Width="100%" Height="100%" Class="scScrollbox scFixSize scFixSize8" Background="white" Padding="0px" GridPanel.Height="100%" GridPanel.Width="100%" GridPanel.VAlign="top" />
</GridPanel>
</Tab>
</Tabstrip>
You just change the order of tag TAB .
If you are using the Media Browser in the new Speak UI (available in Sitecore 7.?) you can accomplish the same thing by doing the following:
In the /App_Config/Include/Sitecore.Speak.config file replace the line:
<override xmlControl="Sitecore.Shell.Applications.Media.MediaBrowser" with="/sitecore/client/applications/Dialogs/SelectMediaDialog" />
with the line:
<override xmlControl="Sitecore.Shell.Applications.Media.MediaBrowser" with="/sitecore/client/applications/Dialogs/SelectMediaViaTreeDialog" />
Thanks Sitecore Support for the instructions.
I have template like here:
http://www.mkyong.com/jsf2/jsf-2-templating-with-facelets-example/
i add menu navigation:
<h:form id="form">
<div id="page">
<div id="header">
<ui:insert name="header" >
<ui:include src="/pages/template/header.xhtml" />
</ui:insert>
<f:ajax render="ContentLoader">
<h:commandLink actionListener="#{contentPage.setPage('/pages/first.xhtml')}" value="About Us" />
<h:commandLink actionListener="#{contentPage.setPage('/pages/login.xhtml')}" value="Contact Us" />
</f:ajax>
</div>
<h:panelGroup id="ContentLoader" >
<div id="content">
<ui:insert name="content" >
<ui:include src="#{contentPage.page}" />
</ui:insert>
</div>
</h:panelGroup>
</div>
</h:form>
links are working fine, but i have problem with redirect content by useing <h:commandButton action="link"> which is in content
how can i fix this problem?
maybe it's something wrong with my layout?
or how to correctly redirect from content to another content, useing buttons which are in contents?
As to your concrete problem, it's likely caused by the combination <ui:include src="#{...}"> and a view scoped bean. This construct works only if you upgrade to at least Mojarra 2.1.18. Otherwise, the view scoped bean will fail to restore and be newly recreated and therefore the default value of #{contentPage.page} will be considered when any form actions inside the page are to be decoded. Upgrading to at least Mojarra 2.1.18 should fix your problem. You can get it at http://javaserverfaces.java.net. It's currently already at 2.1.25.
As to your concrete functional requirement, using command links/buttons for plain page-to-page navigation is a poor practice. You should be using output links/buttons for this.
<h:button value="navigate" outcome="link" />
or
<h:link value="navigate" outcome="link" />
I have this img slideshow that changes when I click.
I would like no effects when the image change, like it used to be in the old jquery-cycle, but instead I get a strange effect of 2 images overlapping each others until the second one finally appear and the first then disappear.
<div class="imgCyclerBody">
<div><img class="sortArrow" src="~/Content/imgs/arrow-left.png" alt="left"/></div>
<div id="slideshow" class="cycle-slideshow" data-cycle-fx="none" data-cycle-hide-non-active="true" data-cycle-prev=".prev" data-cycle-next=".next">
<img alt="Item" src="~/Content/imgs/image1.png" width="30" height="30" />
<img alt="Item" src="~/Content/imgs/image2.png" width="30" height="30" />
<img alt="Item" src="~/Content/imgs/image3.png" width="30" height="30" />
<img alt="Item" src="~/Content/imgs/image4.png" width="30" height="30" />
<img alt="Item" src="~/Content/imgs/Pixels.png" width="30" height="30" />
</div>
<div><img class="sortArrow" src="~/Content/imgs/arrow-right.png" alt="right"/></div>
</div>
Does anybody knows how to avoid this problem?
I moved from the old jquery-cycle to the new one becaue I had a problem with my DIVs format when I used fx: 'none'.
Thanks
Have you tried using the easing plugin?
This doesn't appear to be having an issue on my fiddle.
<div class="cycle-slideshow"
data-cycle-slides="li"
data-cycle-fx='none'
data-cycle-speed='700'
data-cycle-timeout='7000'
data-cycle-pause-on-hover="true"
data-cycle-prev=".prev"
data-cycle-next=".next"
data-cycle-easing="easeOutBack"
>
I need to use editframe to let the front user to modify some checkbox fields
I create a new edit frame button and set only those fields that I want front user to edit. For example : Core DB -> /sitecore/content/Applications/WebEdit/Edit Frame Buttons/(edit button folder)/(field editor button). In the fields to be edited by front user, I have set it to Headline.
In my sublayout, I have this code
<sc:EditFrame ID="EditField" runat="server" Buttons="/sitecore/content/Applications/WebEdit/Edit Frame Buttons/EditFields">
<div id="whatyoumissed">
<asp:ListView ID="ListView1" runat="server">
<LayoutTemplate>
<ul style="list-style-type: none;" >
<asp:PlaceHolder runat="server" ID="itemplaceholder"></asp:PlaceHolder>
</ul>
</LayoutTemplate>
<ItemTemplate>
<li style="float: left;margin-left:20px;">
<sc:FieldRenderer ID="FieldRenderer2" runat="server" FieldName="Headline"
Item="<%# Container.DataItem as Sitecore.Data.Items.Item %>" /> <br />
<sc:FieldRenderer ID="FR3" runat="server" FieldName="cb" Item="<%# Container.DataItem as Sitecore.Data.Items.Item %>" />
</li>
</ItemTemplate>
</asp:ListView>
</div>
</sc:EditFrame>
Code behind
string queryPath = "/bla/bla/bla/bla/bla/bla/bla/bla/bla";
var item = sc.Context.Database.GetItem(queryPath);
var children = item.Children;
ListView1.DataSource = children;
ListView1.DataBind();
When I click on the edit frame in the page editor, the prompted box does not have the field (headline) for me to modify it. Any suggestion?
Answer:
I have google abit of sitecore edit frame datasource and end up with this link
http://blog.jan.hebnes.dk/2011/12/using-sitecore-editframe-with.html
Instead of using the code behind as shown by Martijn Bos, I modify my code from prev to the following.
<asp:ListView ID="ListView1" runat="server">
<LayoutTemplate>
<ul style="list-style-type: none;" >
<asp:PlaceHolder runat="server" ID="itemplaceholder"></asp:PlaceHolder>
</ul>
</LayoutTemplate>
<ItemTemplate>
<sc:EditFrame ID="EditField" runat="server" Buttons="/sitecore/content/Applications/WebEdit/Edit Frame Buttons/EditFields"
DataSource="<%# ((Sitecore.Data.Items.Item)Container.DataItem).Paths.FullPath %>" >
<li style="float: left;margin-left:20px;">
<sc:FieldRenderer ID="FieldRenderer2" runat="server" FieldName="Headline"
Item="<%# Container.DataItem as Sitecore.Data.Items.Item %>" /> <br />
<sc:FieldRenderer ID="FR3" runat="server" FieldName="cb" Item="<%# Container.DataItem as Sitecore.Data.Items.Item %>" />
</li>
</sc:EditFrame>
</ItemTemplate>
</asp:ListView>
Have you tried setting the DatasSource of the Editframe?
e.g. EditField.DataSource = item.Paths.FullPath;
You almost there. Should not use "FullPath". Try this instead
DataSource="<%# ((Sitecore.Data.Items.Item)Container.DataItem).Paths.FullPath %>"
Within a form I have a button that launches a cfwindow, then presents a search screen for the user to make a selection. Once selection is made, the cfwindow closes and the selected content shows in the main page by being bound to a cfdiv. This all works fine in FF but the cfdiv doesn't show at all in IE. In IE, the cfwindow works, the select works, but then no bound page.
I have tried setting bindonload and that made no difference (and I need it to be true if there is content that is pulled in via a query when it loads). All I have been able to find so far regarding this issue is setting bindonload to false and putting the cfdiv outside of the form but that's not possible in my current design.
*4/21 update
This works as expected in FF 3.6.3 and Safari 4, but does not work in multiple IE versions. In IE, the cfwindow works, the select works, but when the window closes and it tries to load the page into the div it just spins.
This is the main page, test.cfm:
<cfajaximport tags="cfwindow, cfform, cfdiv, cftextarea, cfinput-datefield">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
</head>
<body>
<cfset i = 1>
<cfform>
<table>
<cfloop from="1" to="4" index="n">
<tr>
<td class="left" style="white-space:nowrap;">
<cfoutput>#n#</cfoutput>. <cfinput type="button" value="Select #n#" name="x#n#Select#i#" onClick="ColdFusion.Window.create('x#n#Select#i#', 'Exercise Lookup', 'xSelect/xSelect2.cfm?xNameVar=x#n#S#i#&window=x#n#Select#i#&workout=workout#i#', {x:100,y:100,height:500,width:720,modal:true,closable:true,draggable:true,resizable:true,center:true,initshow:true,minheight:200,minwidth:200 })" />
<cfdiv bind="url:xSelect/x2.cfm" ID="x#n#S#i#" tagName="span" bindonload="false" />
<cfinput type="hidden" ID="x#n#s#i#" name="x#n#s#i#" value="#n#" />
</td>
</tr>
</cfloop>
</table>
</cfform>
</body>
</html>
This is the cfwindow, xSelect2.cfm:
<cfparam name="form.xSelected" default="0">
<cfoutput>
1<br />
2<br />
3<br />
4<br />
</cfoutput>
This is the page bound to the cfdiv, x2.cfm:
<cfajaximport tags="cfwindow, cfform, cfdiv, cftextarea, cfinput-datefield">
<cfparam name="url.xName" default="">
<cfparam name="url.xNameVar" default="">
<cfparam name="url.xID" default=0>
<form>
<cfoutput>
<input type="text" id="xName" name="xName" value="#url.xName#" size="27" disabled="true" />
<input type="hidden" id="xNameVar" name="xNameVar" value="#url.xNameVar#" />
<input type="hidden" id="#url.xNameVar#xID" name="#url.xNameVar#xID" value="#url.xID#" />
</cfoutput>
</form>
I am significantly stuck so any help is greatly appreciated.
AND OF COURSE IF ANYONE HAS A BETTER IDEA OF HOW TO ACHIEVE THE SAME FUNCTIONALITY PLEASE SHARE!
Thanks!
The answer was very, very simple. I got the clue from Mathijs' Weblog on whitehorsez.com (thank you!!).
Evidently IE doesn't like nested forms so all I needed to do in the end was remove the form tags from x2.cfm above. It makes that page incorrect, but when read into the cfdiv it works and posts all the correct values to the form. I finished one other rough solution using getElementById which eliminated the extra page but the problem with it was that you had to save before you could change the value if there were multiple options. Here is the new and simple x2.cfm:
<cfoutput>
<input type="text" name="xName" value="#url.xName#" size="27" disabled="true" />
<input type="hidden" name="xNameVar" value="#url.xNameVar#" />
<input type="hidden" name="#url.xNameVar#xID" value="#url.xID#" />
</cfoutput>