Xpages Extension Library - pageTreeNode or basicLeafNode - xpages

With a pageTreeNode I can forward the user to another page in my application, but I cannot take any action beside this.
If I want to do some more actions, I have to use a basicLeafNode and in the action I use (for example):
viewStateBean.restoreState = true;
context.redirectToPage( "someXPage.xsp" );
Is the behavior really the same, or what is recommended to use ?

following explanation I found on http://michelles-universe.blogspot.de/
hope that helps you
xe:basicLeafNode -- Use this to link to any standard URL. You can hard-code or compute the href and label properties. This can be used for links to standard Domino forms or pages, or any other general type of link. For links to another xPage, use the pageTreeNode instead
xe:pageTreeNode -- use this if you want to point to another xPage. All you need to enter is the page name in its simplest form (e.g. demo.xsp) and the text you want displayed. There is no need to compute the entire URL - that's all done for you

Related

crafter-cms: how to create the form using crafter

I am new to crafter, I have use the empty blueprint .and then I have created a page .but i want to design the form .How we can use the element of form like input, radio button, dropdown list, also how to provide the action of the form ,also how to style the page , and how to use the JavaScript. Please
Crafter CMS doesn't restrict your HTML/JS. You can use any framework/tool/markup you like.
You can edit entry.ftl in the templates folder and put whatever markup you want if you're in a hurry.
You should also read the modeling article in the docs to understand how to give power to your content authors: https://docs.craftercms.org/current/developers/content-modeling.html
If you'd like to learn how to best use Crafter CMS, consider taking a class here: https://crafteracademy.teachable.com

Kentico global webpart usage

We're moving from a pure portal to a portal/aspx development model. So I've been working on getting my .Master pages working and so far so good, except i need a way to have a Editable Text webpart applied globally.
Imaging a block of copy that sits in the header and appears on each page.
So, in portal, the copy is entered, and this is used through out the site, regardless of the template. I know i can add static copy to the parent .Master page, but this needs to be editable by an admin.
I've tried registering the Editable Text webpart on the ASPX page, but this doesn't seem to work correctly in the portal.
I believe the way to accomplish this is to create a single page template that has only the editable text webpart on it and does not inherit any other content. Then on your master page, add a page placeholder which uses that editable text webpart page template. This should then display that on every page. I've not done this approach before but hypothetically speaking it should work.
You could set up a Custom Setting.
The Kentico documentation has a great How-To guide for that.
After that, you can then just reference it using a macro like {% Settings.MyCustomSetting %} on each page - this also allows you to then control how the text is rendered on each section, in case some sections have specific markup you need to apply to the text block.
What is the reason of converting to Mixed mode? Is it better control over the basic page markup or something else?
Are you aware that you can customize CMSPages/PortalTemplate.aspx or replace it by your custom base page completely?
You may consider to use this approach, and if you need that because some pages are more complex, so it makes more sense to hardcode them, you can also implement them as some larger custom web parts.

Proper Kentico object for non-user-editable block of static html/javascript

The Situation: I've got a mid-sized chunk of html/javascript that contains an authentication script/input (it's a text input, radio control, and a combo box and a few buttons). What it is is less important than the concept that it's a mass of static client side code that the marketing department can pretty easily accidentally the whole thing.
The Desire: I want the users to be able to add it as a whole to a page, but not be able to modify it. When something needs to change, I want to change it in one place and have it be changed on all the pages.
What I've Tried: Widget with a default text. It works, but feels wrong. Users can edit it, and if they do when I fix it one place it doesn't propagate to all the instances. I'm a bit of a Kentico noob, but it seems like there should be a better way to do this.
Also note: I'm using portal engine if that makes a difference.
A widget is the proper usage. What you make your widget inherit from is the key in this case. I'd suggest creating a new widget based on a static HTML webpart. This way you can set the static HTML markup and hide the property from the content editor on the front end. You can do this by going to the Properties tab of the widget and setting the visibility of the field on the form. Don't delete the field, just hide it. It should be a checkbox that says hide on public form or editing form.
** Edit **
As I read through my answer and comments, I realized I meant to say clone the static HTML webpart and set its default text to your javascript. Then create a widget based on that cloned webpart. The text will reside in the web part and will allow you to update it in one place later, if needed.
I will not do it this way because you will be not able to make changes in the future. You can better create a new webpart this can be an empty webpart and then create a custom layout. In this layout you can put you're code. In this way you can always change you're code in the future and then it will be changed on all the places where the widget is placed.
I'd use a new widget based on the Static HTML webpart (make the field read only or hide it as Brenden mentioned), but store the data in a new custom setting.
no coding needed (only a macro to read the custom setting)
able to edit the script on the fly on any instance in the settings module. If you have multiple of these settings you won't need to go through all kinds of widgets to adjust their default setting but find them on a central place.
Cheers!
David
In this case I think it makes sense to create a custom web part to store all your code in it and use it that way. If you want to achieve it without creating a custom web part, you have to store the code in some non-web part and not widget specific object. I like the suggestion of creating a custom setting. You can then access this custom setting via a macro. This macro can be used as a default property of a newly created web part (inherited e.g. from the static text web part, you'd use the text property). You may as well create a widget out of it. Another approach is to use Kentico localization keys as a workaround. you can create a key in the Localization application and access it again, via a macro, e.g. {?customkey.myhtml?}. The approach with a custom setting however sounds cleaner to me.
This syntax should be working to access a custom setting value via macro:
{%Settings.CustomSettings.xxx%}
{%Settings.CustomSettings["xxx"]%}
{%Settings.CustomSettings.GetValue("xxx")%}

In XPages Mobile App / Mobile Control, how to make picklist

I have two pages, one page for input, another page for the options, how to send value form page to another page on xPages Mobile Controls, or is there another way to make like this.
See my sample page:
1. Page 1:User Input
http://i1248.photobucket.com/albums/hh490/dannysumarnach/page_1_form_user_input.jpg
Page 2:Picklist
http://i1248.photobucket.com/albums/hh490/dannysumarnach/page_2_user_choice_PickList.jpg
note: the built-in typeahead not posible
Regards,
Danny
The in built type ahead is missing the dojo tundra.css file when using the single page app control. This file comes with Dojo its just not being included. Import this file to get the type ahead to work.
I'm unsure as to what you mean about passing value from one page to another, you can submit data to a document and open it in another page, add it to a scoped variable, add a parameter to the URL. All of these options will work.
Have a look at my blog post on this topic. There are a couple of gotchas to get around, most notably, ensuring the the page with your document datasource gets recalculated at the correct time. I'm working on a NotesIn9 on it.
Part 3 covers a couple of amendments to get it working with existing documents and includes a sample page that will work in the Extension Library Demo db. Note the extra view that needs to be created and other details in Part Two.
http://www.intec.co.uk/xpages-mobile-controls-and-value-pickers-part-three-client-side-approach-extended/

Change the action when clicking on a list item

I would like to change the destination URL when clicking on a list item / item title so it will no send me to view the item but will send me to a different URL base on the item.
I am not looking to replace the Links list but to use the list title as URL query filter.
Thanks
You will need to do it using the custom Page / Customize the View Page in the SharePoint Designed. Please refer to this article on how you can achieve it using the SPGridView control
I'm not totally clear on what you'd like to do (maybe screenshot mock ups would help?), but here's some general advice.
If you want to change the behaviour of a control then investigate the properties of the control as kusek has suggested. If the properties don't do what you need then try overriding the control to change what is rendered.
If the above doesn't work out or you want to change how these links render no matter where they appear on the page, then you need to look at a page-level solution. The most common are jQuery that can dynamically replace the URLs with JavaScript, or an HTTP module which is much more low level and will actually alter the HTML rendered to the page.
Hope this helps.

Resources