I have closed "Current Users" portlet from the demo installation and now can't open it back -- there is no such a portlet in a list.
How one can have it back on page?
Thanks.
The "Current Users" portlet is in fact just a "Web Content Display" portlet that's been renamed. So if you add a "Web Content Display" portlet on to your page and set then find the piece of Web Content called: "Welcome Login" (it's ID on mine was 10232, but this may be different for you) and set that as the content to be displayed you'll get it back. Or you can add a new piece of web content with the code below:
<p><style type="text/css"> .loginuser { margin-top:5px; width:100%; display:block; text-decoration:none; padding: 2px; padding-bottom: 10px; } .loginuser h2 { margin:0; font-size:14px; /*text-align:center;*/ } .loginuser a { display:block; padding-left: 20px; margin-left: 95px; margin-top: 2px; } .loginuser img { padding:2px; margin-right: 5px; } .loginuser:hover { background-color: #CED9E2; /*cursor:pointer;*/ } .express_login { background: url("/html/icons/login.png") no-repeat; } .public_pages { background: url("/html/themes/classic/images/common/view_tasks.png") no-repeat; } </style></p>
<form name="loginadmin" method="post" action="/web/guest/home">
<input type="hidden" value="58" name="p_p_id" /> <input type="hidden" value="1" name="p_p_lifecycle" /> <input type="hidden" value="view" name="p_p_mode" /> <input type="hidden" value="maximized" name="p_p_state" /> <input type="hidden" value="/login/login" name="_58_struts_action" /> <input type="hidden" value="bruno#7cogs.com" name="_58_login" /> <input type="hidden" value="bruno" name="_58_password" />
<div title="Login: bruno#7cogs.com, Password: bruno" class="loginuser">
<div style="float: left; padding-right: 4px;" class="user-profile-image"><img width="80" class="avatar" alt="" src="/image/user_portrait?screenName=bruno&companyId=10112&t=1228845375900" /></div>
<h2>Bruno (Admin)</h2>
<div>The admin has full control over the entire portal, allowing modification and creation of users, communitities, and roles. <a class="public_pages" href="/web/bruno">View bruno's public page</a> <a onclick="document.loginadmin.submit();return false;" class="express_login" href="#">Login as bruno</a></div>
</div>
</form>
<form name="loginrich" method="post" action="/web/guest/home">
<input type="hidden" value="58" name="p_p_id" /> <input type="hidden" value="1" name="p_p_lifecycle" /> <input type="hidden" value="view" name="p_p_mode" /> <input type="hidden" value="maximized" name="p_p_state" /> <input type="hidden" value="/login/login" name="_58_struts_action" /> <input type="hidden" value="richard#7cogs.com" name="_58_login" /> <input type="hidden" value="richard" name="_58_password" />
<div title="Login: richard#7cogs.com, Password: richard" class="loginuser">
<div style="float: left; padding-right: 4px;" class="user-profile-image"><img width="80" class="avatar" alt="" src="/image/user_portrait?screenName=richard&companyId=10112&t=1228845375871" /></div>
<h2>Richard Publisher</h2>
<div>Richard has article submission rights for the content management system. <a class="public_pages" href="/web/richard">View richard's public page</a> <a onclick="document.loginrich.submit();return false;" class="express_login" href="#">Login as richard</a></div>
</div>
</form>
<form name="loginmichelle" method="post" action="/web/guest/home">
<input type="hidden" value="58" name="p_p_id" /> <input type="hidden" value="1" name="p_p_lifecycle" /> <input type="hidden" value="view" name="p_p_mode" /> <input type="hidden" value="maximized" name="p_p_state" /> <input type="hidden" value="/login/login" name="_58_struts_action" /> <input type="hidden" value="michelle#7cogs.com" name="_58_login" /> <input type="hidden" value="michelle" name="_58_password" />
<div title="Login: michelle#7cogs.com, Password: michelle" class="loginuser">
<div style="float: left; padding-right: 4px;" class="user-profile-image"><img width="80" class="avatar" alt="" src="/image/user_portrait?screenName=michelle&companyId=10112&t=1228845375823" /></div>
<h2>Michelle Editor</h2>
<div>Michelle has control over the staging and layout of all articles as well as publishing rights for workflow and the content management system. <a class="public_pages" href="/web/michelle">View michelle's public page</a> <a onclick="document.loginmichelle.submit();return false;" class="express_login" href="#">Login as michelle</a></div>
</div>
</form>
<form name="loginjohn" method="post" action="/web/guest/home">
<input type="hidden" value="58" name="p_p_id" /> <input type="hidden" value="1" name="p_p_lifecycle" /> <input type="hidden" value="view" name="p_p_mode" /> <input type="hidden" value="maximized" name="p_p_state" /> <input type="hidden" value="/login/login" name="_58_struts_action" /> <input type="hidden" value="john#7cogs.com" name="_58_login" /> <input type="hidden" value="john" name="_58_password" />
<div title="Login: john#7cogs.com, Password: john" class="loginuser">
<div style="float: left; padding-right: 4px;" class="user-profile-image"><img width="80" class="avatar" alt="" src="/image/user_portrait?screenName=john&companyId=10112&t=1228845375887" /></div>
<h2>John Regular User</h2>
<div>John is a user with minimum rights within the portal.
<div><a class="public_pages" href="/web/john">View john's public page</a> <a onclick="document.loginjohn.submit();return false;" class="express_login" href="#">Login as john</a></div>
</div>
</div>
</form>
Hope this helps!
Related
<form action="/users/student/update" method="POST">
<div class="personal">
<h3 style="padding: 0 22px;">PERSONAL DETAILS</h3>
<hr style="width: 25%; margin-left: 0; border: 1px solid black;">
<label for="name" class="d">Name :</label>
<input id="name" type="text" value= profileInformation.Name name="Name">
<hr>
<label for="email" class="e">Email :</label>
<input id="email" type="email" value="profileInformation.email" name="email">
<hr>
</div>
<hr style="border: 2px solid black;">
<input class="btn" type="submit" value="Submit">
</form>
In this code, profileInformation is a data object, and name and email are variables in it. I want to use them as default values. Right now, it is being printed as ProfileInformation.name and not the value. Please help.
You cannot do that in HTML. You need javascript for that.
document.addEventListener("DOMContentLoaded", function () {
document.getElementById("name").value = profileInformation.name;
document.getElementById("email").value = profileInformation.email;
});
const profileInformation = {
name: "some name",
email: "test#gmail.com"
};
document.addEventListener("DOMContentLoaded", function () {
document.getElementById("name").value = profileInformation.name;
document.getElementById("email").value = profileInformation.email;
});
<form action="/users/student/update" method="POST">
<div class="personal">
<h3 style="padding: 0 22px;">PERSONAL DETAILS</h3>
<hr style="width: 25%; margin-left: 0; border: 1px solid black;">
<label for="name" class="d">Name :</label>
<input id="name" type="text" name="Name">
<hr>
<label for="email" class="e">Email :</label>
<input id="email" type="email" name="email">
<hr>
</div>
<hr style="border: 2px solid black;">
<input class="btn" type="submit" value="Submit">
</form>
I am using Angular 7. I don't know where the error occurs in this form. It always shows form is not a known property of this method. Where did I make a mistake in the below code? I am getting this error.
Can't bind to 'formGroup' since it isn't a known property of 'form'
<form [formGroup]="newClientForm">
<fieldset>
<div class="row" style="text-align:center">
<input type="text" class="st0" placeholder="Enter name" class="form-control" name="name" formControlName="name" #name required="required" />
</div>
<br>
<div class="row" style="text-align:center">
<input type="text" class="st0" placeholder="Enter email" class="form-control" name="email" formControlName="email" #email required="required" pattern="([\w-\.]+#([\w-]+\.)+[\w-]{2,4})?" />
</div>
<br>
<div class="row" style="text-align:center">
<input type="password" class="st0" placeholder="Password" class="form-control" name="password" formControlName="password" #password required="required" pattern=".{6,}"
title="Minimum 6 characters required" autocomplete="off" />
</div>
<br>
<div class="row" style="text-align:center">
<input type="text" class="st0" placeholder="Enter mobile" class="form-control" name="mobile" formControlName="mobile" #mobile required="required" />
</div>
<br>
<div class="row" style="text-align:center">
<!-- <input type="submit" value="Register" /> -->
<button type="submit" class="st1" value="register" (click)="register()">Register</button>
</div>
<br>
<div class="row" style="text-align:center">
<div class="forgot">
Login?
</div>
</div>
<br>
</fieldset>
</form>
Try this stackblitz link reactive form. I have created a similar form using your html code and have run it.
Things i did were very basics:
Imported ReactiveFormsModule from #angular/forms
and have created a formgroup in ts file and added all controls you used in your html.
It runs well.
Let me know if your issue is different from the solution provided.
I am new to Primefaces and I am working on a requirement to open a dialog box when we click on the button.
I could able to open the dialog and submit the form. But here I am facing a new that form behind the modal dialog also get submitted when I am trying to submit the form in the modal. The form behind the modal is a pure html code and modal dialog form is written in primefaces.
Is there any chances to submit the form that is existing in the dialog and skip the form behind the dialog. Could anyone tell me the solution for this?
For clear understanding, I am submitting the code below
<form class="form-horizontal" action="${request.contextPath}/appLogin" role="form" method="POST" h:rendered="true">
<div class="form-group">
<div class="col-sm-12" align="center">
<font color="red"> <h:outputLabel
value="${SPRING_SECURITY_LAST_EXCEPTION.message}" />
</font>
</div>
</div>
<div class="form-group">
<div class="col-sm-12">
<label for="username">Username</label> <input type="text"
class="form-control" name="username" id="username"
placeholder="Enter your username" />
</div>
</div>
<div class="form-group">
<div class="col-sm-12">
<label for="pwd">Password</label> <input type="password"
class="form-control" name="password" id="password"
placeholder="Enter password" />
</div>
</div>
<div class="form-group">
<div class="col-sm-12">
<div class="row">
<div class="col-sm-6">
<input type="checkbox" name="remember" id="remember" />
<h:outputText value=" Remember Me" />
</div>
<div class="col-sm-6" align="right">
<p:commandLink value="Forgot Password?" id="loginforgotpasswordlink"
onclick="clearEmailForgotPasswordPopUp();" />
</div>
</div>
</div>
</div>
</form>
<p:dialog id="emailIdDialog" modal="true" widgetVar="emailIdDialog" width="400"
header="Email Id" appendTo="#(body)" resizable="false">
<ui:include src="/faces/validateEmailId.xhtml" />
</p:dialog>
<div class="form-group">
<p:outputLabel for="emailid1" value="Email" class="col-sm-3 control-label align-right" style="border: 0px solid green;padding-right: 0px;text-align: right;"></p:outputLabel>
<div class="col-sm-9" style="border: 0px solid red;padding-left:0px;">
<p:inputText type="text" id="emailid1"
name="emailid1" required="true" requiredMessage="Please enter an email address"
placeholder="Enter your email id" style="width:100%"/>
</div>
<p:spacer height="10px"></p:spacer>
<div class="text-right" style="padding-left: 0px;">
<p:commandButton value="Submit" update="messages,:emailIdValidation" style="float: right; margin-right: 15px;">
<f:actionListener binding="#{someClassBean.validateEmail()}" />
</p:commandButton>
</div>
</div>
</h:form>
When I am clicking the form submit button in modal dialog the other form also getting submitting.
I have created a view which is rendered in the kendo window. I have the cancel button on the view. I would like to close the window When I click the cancel button. I have written the code to do it. But nothing seems happening.
Please see the code and screen shot below
Kendo window code
$("#contextMenu").kendoContextMenu({
target: "#grid",
alignToAnchor: false,
select: function (e) {
var selectedItem = e.item; // check this item is add or edit and then open the kendo window
if ($(selectedItem).text() == 'Add' || $(selectedItem).text() == 'Edit') {
var accessWindow = $("#addEdit").kendoWindow({
actions: {}, /*from Vlad's answer*/
draggable: true,
height: "700px",
modal: true,
resizable: false,
title: "Add new User",
width: "800px",
visible: false,
}).data("kendoWindow").center().open();
$("#btnCancel").click(function () {
$(this).closest("[data-role=window]").data("kendoWindow").close();
});
$("#language").kendoDropDownList({
filter: "startswith",
dataTextField: "LanguageDescription",
dataValueField: "LanguageCode",
dataSource: language
//dataSource: {
// type: "odata",
// serverFiltering: true,
// transport: {
// read: {
// url: "https://demos.telerik.com/kendo-ui/service/Northwind.svc/Products",
// }
// }
//}
});
$("#country").kendoDropDownList({
filter: "startswith",
dataTextField: "CountryDescription",
dataValueField: "CountryCode",
dataSource: country
//dataSource: {
// type: "odata",
// serverFiltering: true,
// transport: {
// read: {
// url: "https://demos.telerik.com/kendo-ui/service/Northwind.svc/Products",
// }
// }
//}
});
}
}
});
The view that is rendered in the kendo window
<div id="addEdit" style="width 100%; height 100%; background-color #fff;">
<div class="demo-section k-content">
<ul class="fieldlist">
<li>
<label for="simple-input" >Employee Number</label>
<input id="simple-input" type="text" class="k-textbox" style="width: 40%;" />
</li>
<li>
<label for="simple-input">ForeName</label>
<input id="simple-input" type="text" class="k-textbox" style="width: 40%;" />
</li>
<li>
<label for="simple-input">ForeName</label>
<input id="simple-input" type="text" class="k-textbox" style="width: 40%;" />
</li>
<li>
<label for="simple-input">Surname</label>
<input id="simple-input" type="text" class="k-textbox" style="width: 40%;" />
</li>
<li>
<label for="simple-input">Preferred Name</label>
<input id="simple-input" type="text" class="k-textbox" style="width: 40%;" />
</li>
<li>
<label for="simple-input" class="form-horizontal">Language</label>
<input id="language" class="form-horizontal" style="width: 40%;" />
</li>
<li>
<label for="simple-input">Country</label>
<input id="country" style="width: 40%;" />
</li>
<li>
<label for="simple-input">Time Zone</label>
<input id="simple-input" type="text" class="k-textbox" style="width: 40%;" />
</li>
<li>
<label for="simple-input">Domain</label>
<input id="simple-input" type="text" class="k-textbox" style="width: 40%;" />
</li>
<li>
<label for="simple-input">Network Id</label>
<input id="simple-input" type="text" class="k-textbox" style="width: 40%;" />
</li>
<li>
<label for="simple-input">Email Address</label>
<input id="simple-input" type="text" class="k-textbox" style="width: 40%;" />
</li>
<li>
<label for="simple-input">Status</label>
<input id="simple-input" type="text" class="k-textbox" style="width: 40%;" />
</li>
<li>
<button id="btnCancel" class="k-button">Cancel</button>
<button class="k-button k-primary">Save</button>
</li>
</ul>
<style>
.fieldlist {
margin: 0 0 -2em;
padding: 0;
}
.fieldlist li {
list-style: none;
padding-bottom: 2em;
}
.fieldlist label {
display: block;
padding-bottom: 1em;
font-weight: bold;
text-transform: uppercase;
font-size: 10px;
color: #444;
}
</style>
</div>
</div>
This has been resolved. I had to add the following jquery to fix it
$("#btnCancel").click(function () {
$(this).closest("[data-role=window]").data("kendoWindow").close();
});
I'm using Joomla jQuery Registration extension which comes without any kind of botcheck feature and I'd like to add it but I don't know how I'd go about doing that. Here is the extension's code:
<?php
/**
* #title jQuery Dropdown Registration Module
* #version 1.7.2
* #package Joomla
* #author http://www.minitek.gr (Ioannis Maragos)
* #copyright Copyright (C) 2011 Minitek. All rights reserved.
* #license GNU General Public License version 2 or later.
*/
// no direct access
defined( '_JEXEC' ) or die( 'Restricted access' );
?>
<?php JHTML::_('behavior.formvalidation'); ?>
<?php /*<link rel="stylesheet" href="modules/mod_dropdown_registration/css/style.css" type="text/css" /> */?>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js?ver=1.4.2" type="text/javascript"></script>
<script src="modules/mod_dropdown_registration/js/register.js" type="text/javascript"></script>
<?php
$user = JFactory::getUser();
$myID = $user->id;
if ($myID == 0) {
?>
<div id="registerContainer">
<span>Registracija</span><em></em>
<div style="clear:both"></div>
<div id="registerBox">
<form id="member-registration" action="<?php echo JRoute::_('index.php?option=com_users'); ?>" method="post" class="form-validate">
<fieldset id="reg-body" class="userdata">
<div class="reg-field">
<label for="jform_name" id="jform_name-lbl">
Ime i prezime:
</label>
</div>
<div style="float:left;">
<input type="text" maxlength="50" class="inputbox required" value="" size="40" id="jform_name" name="jform[name]"/><br/>
Molimo Vas da unesete stvarno ime i prezime!
</div>
<div style="clear:both;"></div>
<div style="height: 7px;"></div>
<div class="reg-field">
<label for="jform_username" id="jform_username-lbl">
Korisničko ime:
</label>
</div>
<div style="float:left;">
<input type="text" maxlength="25" class="inputbox required validate-username" value="" size="40" name="jform[username]" id="jform_username"/>
</div>
<div style="clear:both;"></div>
<div class="reg-field">
<label for="jform_password1" id="jform_password1-lbl">
Lozinka:
</label>
</div>
<div style="float:left;">
<input type="password" value="" size="40" name="jform[password1]" id="jform_password1" class="inputbox required validate-password"/>
</div>
<div style="clear:both;"></div>
<div class="reg-field">
<label for="jform_password2" id="jform_password2-lbl">
Potvrdite lozinku:
</label>
</div>
<div style="float:left;">
<input type="password" value="" size="40" name="jform[password2]" id="jform_password2" class="inputbox required validate-password"/>
</div>
<div style="clear:both;"></div>
<div class="reg-field">
<label for="jform_email1" id="jform_email1-lbl">
E-mail:
</label>
</div>
<div style="float:left;">
<input type="text" maxlength="100" class="inputbox required validate-email" value="" size="40" name="jform[email1]" id="jform_email1"/>
</div>
<div style="clear:both;"></div>
<div class="reg-field">
<label for="jform_email2" id="jform_email2-lbl">
Potvrdite e-mail:
</label>
</div>
<div style="float:left;">
<input type="text" maxlength="100" class="inputbox required validate-email" value="" size="40" name="jform[email2]" id="jform_email2"/>
</div>
<div style="clear:both;"></div>
<br/>
<font color = "#FF0000">Sva polja su obavezna!</font><br/>
<br/>
<button type="submit" class="button validate">Registracija</button>
<input type="hidden" name="option" value="com_users" />
<input type="hidden" name="task" value="registration.register" />
<?php echo JHtml::_('form.token');?>
</fieldset>
</form>
</div>
</div>
<?php
}
?>
I'm sorry if doesn't come out as a code block but the instructions are unclear. Anyhow - what I'd like to do is add a text field before the Submit button which will have something like a "What is 3 plus 2" label in front of it, and the submit won't work if the answer is incorrect. Is there any way to do this without editing Joomla core files?
You could user jQuery to add your label and input elements to the page. Then bind a .click() listener to the submit button that checks the validity of your answer before the form can be submitted. Do not that this is not a very secure bot checking solution. To add an extra level of security you might consider changing the 2 and 3 to two and three and also perhaps alternate between plus, minus, multiply and divide and store the answers and question combos in your Joomla session instead of calculating it all in JS.