How to validate CheckBox in Kentico 8.2? - kentico

I am working in Kentico 8.2, and I want the user to have to accept all of the terms and conditions. For this, I am using a check box. If that check box is unchecked then user will not be able to submit the form.
This is not achievable through Kentico help which says that I can achieve it by making the check box multiple choice. I have done this and it works but I want the check box's own validation to work.
I cannot attach a picture here otherwise I would show you guys what I have done so far.
If anyone has a solution then please help.

Do you use the basic Kentico forms module?
You can use Validation on a field.
in the Forms module:
new field "conditions"
check "Required"
default value unchecked
Validation "Add validation rule"
select General condition
Enter text > press edit and in the code tab add the following macro:
{%conditions.Value == 1%}
add an error message
dont forget to press Apply and save the field
This worked in my sample.

Related

How to implement PXFormulaCombo or Formula Builder control?

As per title. I need to customise AM207500 - Configuration Maintenance screen to add another custom field that will allow me to enter formula similar to QtyRequired field.
I got as far as displaying the correct dialog. But its missing the fields selection.
I believe I'm missing the OnRootFieldsNeeded property. But every time I try to edit the ASPX and manually add this. Its being cleared by Acumatica.
Am I in the right direction ? And how do I force this property in my ASPX ?
TIA
A bit unconventional, but have you tried updating the ASPX page on the custom pages and then clicking on the files section to update the file? This will then ensure the file update occurs before publish and hold the configuration

Issue related to Kentico on-line form (bizform) validation

I have created a form using Kentico on-line form and applied the built-in "required" validation on it. Whenever a textbox is empty then a required validation is shown. Now, I have entered a value in the textbox and press tab from the keyboard but the required message does not disappear. I want to remove or hide the message from the form when the user enters a value in the text box before the submit button is clicked.
How to resolve this issue?
I don't recall this being something that Kentico handles out-of-the-box. You'll most likely need to add some custom client-side script for this. Typically - where I work, at Ridgeway - we use custom layouts for forms, as the standard layout is fairly table-rich.

Best practice in dealing with xpages extensions dialog box?

I have an extension pages dialog box that I placed in a custom control. The dialog box is used to search for cost centers and return information such as market, cost center number, cost center name etc.
A "Select" button is pressed and the dialog box appears. The user searches for and selects their cost center. The OK button is pressed and it closes the dialog box and updates the various fields on the xPage.
A couple of questions.
Currently the "Select" button on the CC needs to know and refer to the name of the dialog box control within the CC. Seems to me that this is not the best practice. My end user programmer needs to know the ID of that dialog box control within the CC. Is there any way for my "Select" button could "show" the CC and the CC would actually show the dialog box control?
My CC makes use of custom properties to store the various document fields from the selected cost center. The OK button then uses these properties to set the various fields on the xPage. This again does not seem to be a best practice. If I wanted to use that CC in another application then I might need to edit the code in the OK button. Is there a better way to deal with this? Like I can set properties for a CC when I drop it on my xPage, is there a way I can tell it the code that I want to execute when the OK button is pressed?
One thing I thought was to have properties for the fields that need to be updated by the OK button but that does not seem to be so flexible.
For the issue of needing to know the id not sure if theres a typo but I don't understand why its bad that a select button inside a cc needs to no the id of the dialog to open it? did you mean the select is outside the cc? either way have you tried anything like creating a property on the custom control so that from outside it you can set something maybe
<xc:mycustomControl showDialog="false">
and then when something outside it happens change showDialog and refresh the cc, then inside the cc you can have a before / after page load to determine what happens when showDialog is true / false.
For your second issue it sounds to me like this should be using a domino document structure. Rather than the dialog pulling out each piece and the ok button updating, what I would do is have a domino doc data source on the page. when something is selected through the dialog I would update the document this source is pointing to and have all the fields bound to what ever fields they need to be. This way after something is selected the fields will just update to what ever the document contains, and it will be much more re useable so long as the domino docs have the same field names

<a4j:include> content doesn't get change

This is what i want to achieve. I have navigation panel on left and content panel on right.
when user click links on left navigation panel , ajax calls made and content panel got rendered. With current implementation, content got change based on the link i clicked.
however i found content still don't get change when perform following steps:
1. click "display user", user list got display
2. click "add user" to add one user
3. click "display user", user list got display but content is same as the one in step 1.
i am sure data has been inserted into db.
looks like this view got cached on server. is there anyway to solve this issue?
following are my code and screenshot.
thank you,
i found answer from this link.
basically, use following line to destroy backing-bean, then problem solved.
FacesContext.getCurrentInstance().getExternalContext().getRequestMap().remove("wizardBean");
http://java.dzone.com/articles/jboss-richfaces-spring?page=0,6

Default selection of checkbox group

I wanted to put checkbox in my cognos 8 report based on some condition i.e if condition is true checkbox will appear with click mark and if it is not then without click mark.
I'm assuming you are placing this control on a prompt page...
It's kind of convoluted, but here's the only way I know how to do it. You can place 2 "Value Prompt" controls on your prompt page, and set the "Required" property to "No" on both. Set the "Parameter" property to be the same for both prompts (i.e., they will apply the same filter criteria on your query). For one of the prompts, set the "Default Selections" property so that your default value will be automatically selected on one of the controls. Also, be sure to set the "Select UI" property to "Check Box Group" (even if you only have one value to be checked) so you get a check box control.
Now that your controls are setup, you need to place them on your prompt page and apply a conditional render variable to both controls (you can look it up in Help if you aren't sure how to do this -- it's simple, but too lengthy to describe here). Basically, when your query condition is true, render the one with the check box clicked, otherwise render the one without. I not sure about the version support for the "Render Variable" property, but it works in version 8.4.
There isn't a way to my knowledge to dynamically select a default value on a prompt by linking it directly to a query -- You have to go through the conditional formatting/rendering approach.
yes i completely agree with jamey this is the only known way to do this.
there is another much difficult way to do it is by writing a java code which pretty much does tha same.
so i suggest you stick with jamey's solution.
as far as the version question comes, the 'render variable' property works the same in all versions of cognos 8 i.e. 8.2, 8.3 and 8.4.

Resources