I've created a Form, with the following layout:
<fieldset class="form-group subject">
<legend>Subject</legend>
<cms:FormLabel runat="server" ID="lTextBoxControl" Field="TextBoxControl" /><cms:FormErrorLabel runat="server" ID="eTextBoxControl" Field="TextBoxControl" />
<cms:FormControl runat="server" ID="iTextBoxControl" Field="TextBoxControl" FormControlName="TextBoxControl" CssClass="" />
</fieldset>
<fieldset class="form-group message">
<legend>Message</legend>
<cms:FormLabel runat="server" ID="labelMessage" Field="TextAreaControl" /><cms:FormErrorLabel runat="server" ID="messageError" Field="TextAreaControl" />
<cms:FormControl runat="server" ID="iTextAreaControl" Field="TextAreaControl" FormControlName="TextAreaControl" CssClass="" />
</fieldset>
<cms:FormSubmit runat="server" ID="fSubmit" />
I have a localization string for the button label, but can't get that work. Also, when this rendors, it's wrapped in a TABLE tag which is a big issue too.
I can't see anything in the V9 documentation for this control either.
A little more digging and i came up with this : http://devnet.kentico.com/questions/custom-submit-button-text
Forms > General > Submit Button Text
I then used my localization string.
Related
i need to make all component editable when i clicked on h:commandLink
This my code
<p:dataTable styleClass="borderless" id="projectsTable" var="o" value="#{order.orderList}">
<p:column>
<div class="tasks">
<div class="task-item task-success">
<h:form>
<div class="task-text">
<div class="form-group">
<h:outputLabel for="projectName" value="Project Name:" />
<p:inplace effectSpeed="fast" editor="true">
<p:inputText styleClass="form-control" value="#{o.productName}" required="true" label="text" />
</p:inplace>
</div>
<div class="form-group">
<h:outputLabel for="projectURL" value="Project URL:" />
<p:inplace effectSpeed="fast" editor="true">
<p:inputText styleClass="form-control" value="#{o.price}" required="true" label="text" />
</p:inplace>
</div>
</div>
<div class="task-footer">
<div class="pull-left">
<h:commandLink >
<span class="glyphicon glyphicon-ok-circle" aria-hidden="true"></span> EDIT
</h:commandLink>
</div>
<div class="pull-right">
<h:commandLink action="#{order.deleteAction(o)}" >
<span class="glyphicon glyphicon-remove-circle" aria-hidden="true"></span> Delete
</h:commandLink>
</div>
</div>
</h:form>
</div>
</div>
that's link i need to click on it and open all h:inputText
<h:commandLink action="#{order.update(o)}">
<span class="glyphicon glyphicon-ok-circle" aria-hidden="true">
</span> EDIT
</h:commandLink>
Such as linkedIn in editProfile page when click on button appear all editable components
Examples:
Befor click button
After clicked button
First of all, every PrimeFaces component has a javascript representation which is acessible through the widgetVar.
The Inplace's widget has a method called show() that you can use to show the input field for it. Check this code out:
<p:inplace ... widgetVar="myinplace">
<p:inputText ... />
</p:inplace>
<!-- this button's click will show the input -->
<button onclick="myinplace.show()">Click Me</button>
I suggest you to set the widgetVar attribute for the inplace components and call the show method on each one of them inside a function that you can use everywhere you want:
<script>
function showInplaces() {
myinplace1.show();
myinplace2.show();
...
}
Cheers
During my lunchbreak I was curious, so I did have a quick look.
I looked at the generated source in the showcase of the first item:
<span id="j_idt88:basic" class="ui-inplace ui-hidden-container" data-widget="widget_j_idt88_basic">
<span id="j_idt88:basic_display" class="ui-inplace-display" style="display:inline">Edit Me</span>
<span id="j_idt88:basic_content" class="ui-inplace-content" style="display:none">
<input id="j_idt88:j_idt91" name="j_idt88:j_idt91" value="Edit Me" class="ui-inputfield ui-inputtext ui-widget ui-state-default ui-corner-all" role="textbox" aria-disabled="false" aria-readonly="false" type="text" />
</span>
</span>
I noticed the class='ui-inplace-display' class which is on each 'component. The following jquery code selects all inplace components that can be clicked:
$('.ui-inplace-display')
I tried this in the FireFox developer console resulting in the following output:
Object { length: 5, prevObject: Object, context: HTMLDocument → inplace.xhtml, selector: ".ui-inplace-display", 5 more… }
I know you can enable the editing by clicking on an item and so I had to find a way to click on each one. Fortunately, you can give each of them a click by just appending .click() to the selector. It will be applied to each of the components:
$('.ui-inplace-display').click()
And like mentioned, you do not need any jsf button for this, just a plain html one to execute the javascript in an onlclick:
<input onclick="$('.ui-inplace-display').click()" value="Click to edit" type="button">
works perfectly.
As you can see, it pays to learn the basics of webdevelopment before diving into using more complex frameworks since no framework ever solves all of your problems and from time to time (more often then you think), you do need a little low-level javascript
I am new to liferay development.
I have done good work to display the liferay grid by using liferay search container.
But now the requirement is that some of the fields in the grid should have provision to be modified by user.
Is it possible through liferay search container or do I need to follow any other approach to achieve editable liferay grid?
You can use <liferay-ui:search-container-column-jsp tag or directly use <aui-input /> inside the <liferay-ui:search-container-column-text tag.
Example (I have included code comments with the code sample for your understanding):
<liferay-ui:search-container
emptyResultsMessage="no-assets-selected"
iteratorURL="<%= configurationRenderURL %>"
total="<%= assetEntries.size() %>"
>
<liferay-ui:search-container-results
results="<%= assetEntries.subList(searchContainer.getStart(), searchContainer.getResultEnd()) %>"
/>
<liferay-ui:search-container-row
className="com.liferay.portlet.asset.model.AssetEntry"
escapedModel="<%= true %>"
keyProperty="entryId"
modelVar="assetEntry"
>
<aui:form action="doesThisWork?">
<%-- this is the normal way --%>
<liferay-ui:search-container-column-text
name="type"
value="<%= assetRendererFactory.getTypeName(locale, false) %>"
/>
<liferay-ui:search-container-column-date
name="modified-date"
value="<%= assetEntry.getModifiedDate() %>"
/>
<%--
this is the JSP way
You can include anything in the JSP like <input /> fields, textarea, select drop-down etc.
--%>
<liferay-ui:search-container-column-jsp
align="right"
path="/html/portlet/asset_publisher/asset_selection_action.jsp"
/>
<%--
Here is including <input /> field inside the column text field.
Notice I am not using the "value" attribute of this tag, instead I am
writing HTML inside the body of this tag.
--%>
<liferay-ui:search-container-column-text
name="type"
>
<aui:input type="text" name="enterSomething" value="I can enter input here" />
<aui:input type="text" name="enterSomething" value="<%=assetEntry.getTitle %>" />
<aui:input type="hidden" name="enterSomething" value="this is a hidden field of the form" />
</liferay-ui:search-container-column-text>
</aui:form>
</liferay-ui:search-container-row>
<liferay-ui:search-iterator paginate="<%= total > SearchContainer.DEFAULT_DELTA %>" />
</liferay-ui:search-container>
In the above example, there would be a <form> for each row, so you can have a submit button at the end of each row to submit the data for that row.
But you can do it in other ways as well:
You can write the <form> outside the Search-container tag so that you just have one form and can submit all the row data togather
Or else you can have a <form> somewhere down the page and through javascript populate the value in the form and then submit.
Or else you can use ajax and other stuff to accomplish this. Or a combination of several approaches.
I leave this upto you to figure out.
Disclaimer: I have not test this code. But as per my understanding this should work. :-)
I have created a new master page to SharePoint 2010. Right now I'm just trying to make it work. I want to display who modified the page and when. This works great whit this code:
<SharePointWebControls:DateTimeField FieldName="Modified" runat="server" ControlMode="Display"/>
by
<SharePointWebControls:UserField FieldName="Modified By" runat="server" ControlMode="Display"/>
But my problem is that when i Load the SP-page with my master-Page this part of the page stays for 0.5 seconds and then disappears. My question is: Do you know how I can make the modified and modified by content to stay on my site?
Thanks for your help!
The Answer to my Question was that I had to put the cod from the question before this tag:
<asp:ContentPlaceHolder id="PlaceHolderFormDigest" runat="server">
so my finished cod looks like this:
<!-- Footer with Last modified/modified by and date of the day -->
<div class="s4-notdlg" style="clear:both; background-color:white; padding:10px; margin-left:160px;">
<div class="hide">
<div>
Idag är det
<script type="text/javascript">
var date = new Date();
document.write(date.toLocaleDateString());
</script>
</div>
Senast uppdaterat:
<SharePointWebControls:DateTimeField ID="DateTimeField1" FieldName="Modified" runat="server" ControlMode="Display"/> av
<SharePointWebControls:UserField ID="UserField1" FieldName="Modified By" runat="server" ControlMode="Display"/>
</div>
</div>
<SharePoint:DeveloperDashboard ID="DeveloperDashboard1" runat="server"/>
</div>
I have a problem with the widget.paginate position in the extension tx_news, i'm working in TYPO3 v. 6.1 FLUID/EXTBASE.
My problem is that it's showing the widget.paginate by default, inside the Templates/News/list.html in my list show UL tag. and i want it to be outside the UL tags, I have tryed to move it around, but then it make some big changes to my layout, or do not work at all.
see bottom of page - enter link description here
How can I show the paginate links/widget outside the UL and after it ?
My Templates/News/list.html code
{namespace n=Tx_News_ViewHelpers}
<f:layout name="General" />
<!--
=====================
Templates/News/List.html
-->
<f:section name="content">
<f:if condition="{news}">
<f:then>
<div class="news-list-view">
<ul class="cbp_tmtimeline {newsItem.type}{f:if(condition: newsItem.istopnews, then: ' topnews')}">
<f:if condition="{settings.hidePagination}">
<f:then>
<f:for each="{news}" as="newsItem">
<f:render partial="List/Item" arguments="{newsItem: newsItem, settings:settings}" />
</f:for>
</f:then>
<f:else>
<n:widget.paginate objects="{news}" as="paginatedNews" configuration="{settings.list.paginate}">
<f:for each="{paginatedNews}" as="newsItem">
<f:render partial="List/Item" arguments="{newsItem: newsItem, settings:settings}" />
</f:for>
</n:widget.paginate>
</f:else>
</f:if>
</ul>
</div>
</f:then>
<f:else>
<div class="no-news-found">
<f:translate key="list_nonewsfound" />
</div>
</f:else>
</f:if>
</f:section>
You can override the default Paginate Template and define your own Template
Add this to your TS template:
plugin.tx_news.settings.list.paginate.templatePath = YourNewTemplatePath.html
To know how the default template works, check out this Default Template for reference and modify your view accordingly.
If you trying to edit the default News List, change the default news path and write your FLUID template in that file:
plugin.tx_news.view.templateRootPath = YourNewTemplateNews.html
Close your tag before the widget. Of course, you'll have to make a few changes in your CSS to get what you want.
</ul>
<f:else>
<n:widget.paginate>.......
Hi i fix it in the Templates/News/list.html code
with this code.
{namespace n=Tx_News_ViewHelpers}
<f:layout name="General" />
<!--
=====================
Templates/News/List.html
-->
<f:section name="content">
<f:if condition="{news}">
<f:then>
<f:if condition="{settings.hidePagination}">
<f:then>
<f:for each="{news}" as="newsItem">
<f:render partial="List/Item" arguments="{newsItem: newsItem, settings:settings}" />
</f:for>
</f:then>
<f:else>
<n:widget.paginate objects="{news}" as="paginatedNews" configuration="{settings.list.paginate}">
<div class="news-list-view">
<ul class="cbp_tmtimeline {newsItem.type}{f:if(condition: newsItem.istopnews, then: ' topnews')}">
<f:for each="{paginatedNews}" as="newsItem">
<f:render partial="List/Item" arguments="{newsItem: newsItem, settings:settings}" />
</f:for>
</ul>
</div>
</n:widget.paginate>
</f:else>
</f:if>
</f:then>
<f:else>
<div class="no-news-found">
<f:translate key="list_nonewsfound" />
</div>
</f:else>
</f:if>
</f:section>
hi i am using update panel in my project, one page i have file upload control is there, so save the page file upload is not working that time i used post back trigger control (id is button id) now my problem is progress bar is not working , please give me any suggestion. my code is
<asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
</asp:ToolkitScriptManager>
<asp:UpdatePanel ID="up1" runat="server">
<Triggers>
<asp:PostBackTrigger ControlID="IBtnSave" />
<asp:PostBackTrigger ControlID="ddlAgent" />
<asp:PostBackTrigger ControlID="btnSelectCity" />
<asp:PostBackTrigger ControlID="imgBtnAgent" />
<asp:PostBackTrigger ControlID="ImgBtnCancel" />
</Triggers>
progress bar code is
</asp:UpdatePanel>
<asp:UpdateProgress ID="UpdateProgress1" runat="server" AssociatedUpdatePanelID="up1"
DynamicLayout="true">
<ProgressTemplate>
<div id="Progressbar" class="Progressbar" align="center" valign="middle" runat="server">
<asp:Image ID="Image1" Width="75" Height="95" runat="server" ImageUrl="~/images/animation_processing.gif" />
</div>
</ProgressTemplate>
</asp:UpdateProgress>
how to solve that problem, please give me any suggestion
Thank u
hemanth
i can find out the answer it is working
just write the java script like this
<script type="text/javascript">
var updateProgress = null;
function postbackButtonClick() {
updateProgress = $find("<%= UpdateProgress1.ClientID %>");
window.setTimeout("updateProgress.set_visible(true)", updateProgress.get_displayAfter());
return true;
}
</script>
after that
<asp:UpdatePanel runat="server">
<Triggers>
<asp:PostBackTrigger ControlID="IBtnSave" />
</Triggers>
button onclick event just call that function like this
<asp:Button ID="IBtnSave" runat="server" Text="Save" CssClass="art-button"
ClientIDMode="Static" onclick="IBtnSave_Click" OnClientClick="return postbackButtonClick();"/>