EPISERVER 6 R2 Selected/not selected default value not working - episerver

I am trying to set default value for Selected/not selected property to true in Episerver>Admin>My page type>Edit property. This should create a checkbox which is checked when creating new pages using My page type. However, after creating a new page, the checkbox is still not checked.
The same issue is with current, not new pages which use My page template.
I have tried setting Selected/not selected property in the code behind and this worked, however, i would like to use built in functionality so i could have more control.
I would appreciate some advise/help. Is it Episerver bug or something i am missing?
p.s i posted the same question on episerver forum but didnt get any replies

Setting the default value to 'True' on the Selected/not selected property should work...
I tested this on a clean install of CMS 6 R2 and it's working fine.

I tried creating a new page using Episerver menu and the checkbox was checked. However, we do create some pages programatically using CreateWritableClone, and the pages are based on another default page, which did not have the checkbox checked. This was the cause of my problem. All i had to do is check it and everything worked.

Existing page instances will not be affected after making changes to page type definition property mandatory settings.
As mentioned - Specifying default value 'True' should be working. Tested on clean installation.
Are you creating page types manually or using PageTypeBuilder?

Related

The wagtail example of using entities isn't working for me

The Wagtail example of using entities as given in this page of documentation isn't working for me. I am following the third example of using Entities which is supposed to create a button for stock price but no button is appearing for me in the rich text field in the admin editor. I have created a minimum reproducible example which demonstrates just this problem. https://github.com/kiwiheretic/stockentity. I am using Wagtail 4.1.1 which I understand is the latest version.
Can anyone help me see what I have missed and why the button doesn't appear as expected?
This or a similar question was asked in the Wagtail Slack. To get the button to appear, it either needs to be included in the features list when you create a new RichTextField OR you need to add it to the default configuration using the WAGTAILADMIN_RICH_TEXT_EDITORS setting.

Using intermediate appPage xpages mobile

I have a simple issue, but I don´t how to solve the problem.
Using XPages Mobile controls, I have a document with some actions, and one of them is "Send to Signature".
The workflow is: select the signer of document (from names) and send to signature.
I need to show for the current user, one field to select the signer (I already have a field with typeahead funcion to select him).
I would like to use an intermediate appPage for this, but when I´m in the new appPage, the currentDocument is gone.
How can I use the same document (opening from a dataView) for solve this problem?
Can I navigate between appPages (inside SinglePageApp) using the currentDocument??
Thanks in advance
It might be worth looking at Mobile Value Picker on OpenNTF. The mobile prefix may need setting in XSP Properties to "Mobile_" (or it could be that I messed around with the development version after the last upload). But it gives code to have a button / link to go to a subsequent appPage to select values from a list. It starts from a DataView, to a document, to the selection page.
The project has not changed for a couple of years, but I've just tested it in Chrome setting user agent to Android and it still seems to work fine on 9.0.1 FP2.

Default values automatically save in database when plugin will be activated

I have used a WordPress Settings API PHP Class framework, that found here http://tareq.wedevs.com/2012/06/wordpress-settings-api-php-class/, to create my first plugin setting page.
Everything is working fine except default option values are not saving in database until I hit "Save" going to setting page. But I would like this to be saved automatically when someone activate the plugin.
I tried using register_activation_hook() but failed. I am not sure how to use that framework with register_activation_hook(). You can check the codes going to the link I mentioned above. I am about to finish my first plugin but stuck on this.

Silverlight 4: Fields disapear in data grid after saving en

When saving a new entity something strange happens...
I have a data grid with a list of 'Depots' populated using a domain data source.
When the user wants to add a new 'Depot' this is what happens:
Depot newDepot = new Depot();
newDepot.Name = "My New Depot";
EditDepot popup = new EditDepot(newDepot); // create the popup and pass the newly created Depot
domainDataSource.DataView.Add(newDepot); // add a new Depot to the datagrid
// handle the popup events
popup.CancelClick += (cancelSender, cancelArgs) =>
{
if (GridDataSource.DataView.Contains(newDepot))
domainDataSource.DataView.Remove(newDepot);
domainDataSource.DomainContext.RejectChanges();
};
popup.Show();
The popup constructor then passes the entity to a viewmodel. The viewmodel constructor then creates a new instance of 'ContactInfo', another entity which is linked to 'Depot' (Depot.ContactInfo). After filling in a few properties, the 'Depot' is assigned to a property in the viewmodel and a dataform is used to edit the data. Once the user is happy with the content they will press save. The Depot is added to the context (Context.Depots.Add....) and then the changes are submitted. (It's also worth noting I have tried added the ContactInfo item to the context too, with no joy). The data is saved to the database (via WCF) and everything appears to have worked correctly. The proplem is the datagrid is not displaying the ContactInfo fields, where as it did before the save. As the user edits the data, you can see the datagrid populated behind the popup. If the user refreshes, the data returns. This problem does not happen when the entity is editied.
Now, to throw another spanner in the works... This doesn't happen on all our machines...
We have a build machine and the output does have this problem, however one machine in the building builds a version which does not have this problem! After some investigation, we have found that it appears to be the version of WCF RIA Services. On my machine, I had V1.0 SP1. I Tried V1.0 SP2 and still had the same problem. Now on the machine that works, WCF RIA Services SP1 Beta was installed. After he unistalled this, and installed SP2, the problem occured on his machine.
So, we are relutant to use a beta version in our final release, but unless we can fix this issue we wont have a choice. Does anyone have any ideas? Has anyone seen this issue before?
I have also tried different version of the WCF toolkit with no joy
EDIT: I've created a simple project to show you whats happening
The project retrieves a load of entities and tries to add one. You'll notice the the 'InnerThing' properties dissapear.
Link to project
the issue was that the key property was being set in the insert method in the service.
it looks like this change was not reflected in the client. Changing other properties in the service after submit other than the key did work however.

Liferay Change theme for mobile device

I need to change the theme (let's say default theme = classic) to the iphone theme (or whatever) when the user has navigated to the liferay portal using a mobile device.
I thought to go about it like this:
- create a hook to gets triggered on a user login event
- check for the device using the User-Agent request header attribute
- if required, set the theme to iphone using LayoutServiceUtil
Probably there is a better approach to implement such a requirement so feel free to offer alternatives.
I'm quite new to liferay so that is probably the reason I could not get this to work.
a. First of all I'm very confused about how themes are handled in liferay; there seem to be various related model objects which are hard to distinguish: Theme, ThemeDisplay, Layout, LayoutSet, ColorScheme, ... . Can someone explain this or know where this is explained?
b. apparently you need to get the ThemeDisplay from the request in order to set a theme on it. However, when the user logs in, the theme attribute (THEME_DISPLAY) has not been set yet (neither in the pre nor post event; it is set when I check during a logout event). Setting the theme during login is an absolute minimum, I was actually hoping I could set the theme before the user logs in but since the attribute is not even known after user logs in...
c. when using LayoutServiceUtil.updateLookAndFeel, you need to give the groupId, themeId, colorSchemeId, css, ... . I was expecting it would be simply telling liferay which theme (name) to use no matter what groupId, ... . Is this not possible?
thanks a lot for any help,
Stijn
P.S. I'm using liferay 6.0.5.
I haven't tried this myself but I'm planning on looking into it:
Milen Dyankov's extensions seem to have a way of letting you select themes based on the user agent all configured in the control panel. You can read his blog about it here.
I could be mistaken but I'm pretty sure the switching happens automatically.
Question a: are you developing your own theme or do you just want to customize it?
Question b: why not set the default themes correctly? Just set it in the settings pannel => layout => dropdown at the bottom
Edit:
I would be wary of using a login.pre hook. While this will update it when you login it means that untill the user actually logs in they may see the wrong theme. I would check it in the default render mode of a portlet on the main page or find a hook that is used on first visiting the page.
A possibility seems to be: servlet.service.events.pre
That way it will be checked every http request. There may be better options. (I am not that familiar with liferay)
And to get the groupId etc you can just use: long groupId = ParamUtil.getLong(actionRequest, "groupId");

Resources