k2 textbox contains a value - k2

I am new to K2, I have textbox which got mapped to receive a value like below:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><results operation="invokeSync">
<resultStatus>OK</resultStatus>
<output>
<content>Error</content>
</output>
</results>
I just want to check if it contains "Error" value.
I treid
if control contains specific value (If control contains Error(specific value))
if control contains a value

You can do it using the rules.
1.You have a rule called if a control contains a value, by using this we can check whether the text-box is having any value.
2. You have another rule saying If a control contains a specific value, by using this rule you can check whether your text-box contain a specific value or not.
You can choose this rule based on where you place your text-box like you may place your text-box on form level or you may place the text-box on view level.
Thank You

Related

access form, opposite of control source

I have a checkbox in a access form which get ticked depending on the control source. (checked if data is "-1", unchecked if 0). This is all working well but I need another checkbox that does the opposite. unchecked if data is -1 and checked if data is 0.
How can I do that?
[edit] I've read in https://support.office.com/en-us/article/IIf-Function-32436ecf-c629-48a3-9900-647539c764e3 that I can use the Iif function. Can I use this, to make a checkbox checked when another checkbox in my form is unchecked and vice versa..? I've tried this as a default value on checkbox2
=IIf([checkbox1.Value]=0, -1, 0)
but it doesn't work
Won't work to set in Default Value property. Expression in Control Source property:
=Not checkbox1
But that will be an UNBOUND control. If you need to save the calculated value to a field that will require code - macro or VBA

Trying to understand a CSS chain

can anybody explain the following code snippet (used in CSS):
[type="checkbox"]:checked
I've tried to find this on various sites, I understand the pseudo class on the end but the square brackets have really got me stumped.
Thanks for reading.
this [type="checkbox"] is an attribute selector
[attr=value]
Represents an element with an attribute name of attr and whose value is exactly "value".
:checked is:
a pseudo class selector represents any radio (<input type="radio">),
checkbox (<input type="checkbox">) or option (<option> in a <select>)
element that is checked or toggled to an on state. The user can change
this state by clicking on the element, or selecting a different value,
in which case the :checked pseudo-class no longer applies to this
element, but will to the relevant one.
Which means you have a checkbox element checked
[type="checkbox"] is an attribute selector.
This specific selector will match any element that has the attribute type and that attribute's value is checkbox. Most would identify this as a selector for and input but is not specific enough to be limited to that element type. Other elements that accept the type attribute are <button> <command>, <embed>, <object>, <script>, <source>, <style> and <menu>.
You'll often see input pre-pended to a selector like the one above, i.e. input[type="checkbox"], when targeting specific types of input.
The square brackets target an attribute such as type for an input elemet.
In your case you're selecting a checked checkbox.

Setting a default list of items in project_attribute in a GNAT GPS Plugin

I'm working on a custom GNAT GPS plugin (for GPS 6.1.2).
My plugin XML creates a project attribute "example_list_of_files".
This is a list of strings, that correspond the names of Ada files in the project.
I want to default the entries in that list to "a.adb","b.adb","c.adb". However I've been unable to find the correct syntax for this. Instead i end up with a single string of all the values.
What i want to see is what happens when you manually add three elements, as shown below:
Here is the code for this example:
GPS.parse_xml('<?xml version="1.0" ?>' + """
<my_plugin>
<project_attribute
name="example_list_of_files"
label="example_list_of_files"
description="A description...."
package="MyPackage"
editor_page="MyPage"
editor_section="Build"
hide_in="wizard library_wizard"
omit_if_default="false"
list="true"
base_name_only="true">
<string type="file" filter="project" default="'a.adb','b.adb','c.adb' " />
</project_attribute>
</my_plugin>""");
Notice the string element with the project attribute default. Instead of a list of entries in the project manager it gives me a single entry, containing the string "'a.adb', 'b.adb', 'c.adb'".
Anyone got any ideas? I've also tried multiple string elements, adding brackets, braces, square-brackets, space separators, prefixing with 'array(' with no luck.
thanks
Matt
It seems indeed this is not supported. The standard plug-in projects.py has several list attributes, but all of them have a single value as the default. I'll check what can be done to improve here.
However, your approach might be wrong in the first place. The default you are setting only concerns the project editor. That means that if a user uses a default project (like project default is end default) and never goes through the project editor, your attribute example_list_of_files will in fact not exist (and have a default empty value). So it seems that this should in fact be handled in your plug-in, when you query the value of the attribute (like via GPS.Project.get_attribute_as_list). If that function returns an empty list, then use ("a.adb", "b.adb", "c.adb") instead. That way, things work fine even with a default, unedited project.
From the GPS User's Guide:
The tag accepts the following attributes:
[...]
list (boolean, default false)
If true, the project attribute contains a list of values, as opposed
to a single value. An example is the list of source directories in
standard projects.
In your example:
<string type="file" filter="project" default="'a.adb','b.adb','c.adb' " />
This is a single string value. Instead, you should specify a list of string values, like this:
<string type="file" filter="project" default="a.adb" />
<string type="file" filter="project" default="b.adb" />
<string type="file" filter="project" default="c.adb" />

How to hide the value of a tag in Enterprise Architect documentation

I made a custom template on Enterprise Architect that is a slight modification of the requirements template that came with the program. I edited the template to make it that the value of a specific tag will also be included in the documentation.
"Requirement Type: {Element.valueOf(****)}"**
However, not every element in my document has a value for that specific tag. Is there a way I can have that line show up only when the tag has a value? Or have the documentation say
""Requirement Type: none"
if there is no value?
I am using EA version 8.0.860 from Sparx Systems
If you are using version 10, there is a new feature called Fragment Template. You could move the specific part of the document that you would like to show/hide into a Fragment Template by performing the following steps:
Create a new Fragment Template
Configure the fragment, e.g.
package>
diagram>
element>
Requirement Type: {Element.valueOf(****)}
<element
<diagram
<package
On the Document Options, go to Element Filter tab
Click Add Filter
On the drop-down Search On, choose TagValue
Check the Property, set Condition to "Equal To", and set the value as the Tag name
Check the Value, set Condition to "Equal To", and do not set the value
Check the Required, then press OK button to close Add Filters window. This means that if the Tagged Value has no value, it will not be shown.
Press OK button to close Document Options window
You may create more than one fragment according to your needs.
Import the fragment template into your main template.
But since you are using version 8, IMO the options that you have are:
Adding "Requirement Type:" text into every Tagged Value that has value
OR, adding "none" into every Tagged Value that has no value.
You could create an EA Script to automate number 1 and number 2, because those are repetitive tasks.

Computing repeatControls property of a repeat generate designer error

I am trying to compute the repeatControls property of a repeat but get an error
<?xml version="1.0" encoding="UTF-8"?>
<xp:view xmlns:xp="http://www.ibm.com/xsp/core">
<xp:repeat id="repeat1" rows="30" value="#{javascript:10}">
<xp:this.repeatControls><![CDATA[${javascript:"true"}]]> </xp:this.repeatControls>
</xp:repeat>
</xp:view>
Here is the error
Description Resource Path Location Type
Could not generate a .java file for the page /test.xsp: Could not find the runtime class for the tag xp:repeat, due to a problem invoking com.ibm.xsp.component.xp.XspDataIterator.getJavaClass(class com.ibm.xsp.page.parse.types.FacesInstance). test.xsp test.nsf/XPages line 1 com.ibm.designer.domino.ide.resources.designerproblem
Is this some kind of bug in DDE or am doing it wrong?
I have tried putting the "true" without quotes as well
I am using notes 9 beta 1
The Repeat (xp:repeat) control specifies the following tooltip for the repeatControls property.
Repeat Controls (boolean:repeatControls)
Specifies if the controls should be created multiple times or the single set of controls should be iterated over multiple times.
The repeatControls property accepts boolean values; specifically either "true" or "false". In Domino Designer from the All Properties View despite the presence of the blue diamond (indicating it can be computed), this property should not be computed.
At design time, the repeatControls property value is used to inform how the compiled XPage is generated hence invalid values prevent this from succeeding; this is the error being reported by Domino Designer and has been logged with the team with reference "DEGN95SMPT".