I am trying to add a radio button to my basic asset using following steps in point #15.2.3.10.
I want to include static list of items, so as per documentation I have used OPTIONDESCRIPTIONS parameter:
<PROPERTY NAME="gender" DESCRIPTION="Gender">
<STORAGE TYPE="VARCHAR" LENGTH="4"/>
<INPUTFORM TYPE="RADIO" SOURCETYPE="STRING" OPTIONVALUES="male,female,others" OPTIONDESCRIPTIONS="male,female,others"/>
</PROPERTY>
But when I create new basic asset in Contributor UI, I get error:
Can you please highlight me what I am doing wrong here?
For display radio button in basic asset,You have to use "RBDESCRIPTIONS and RBVALUES" attribute instead using "OPTIONDESCRIPTIONS ,OPTIONVALUES"(used for drop down the list) in your adf xml.
So you should use below in your xml:
<PROPERTY NAME="gender" DESCRIPTION="Gender">
<STORAGE TYPE="VARCHAR" LENGTH="10"/>
<INPUTFORM TYPE="RADIO" SOURCETYPE="STRING" RBVALUES="male,female,others" RBDESCRIPTIONS="male,female,others"/>
</PROPERTY>
Related
Hi i'm create a code generation tool for Odata, so far the odata v4 have been really simple to implement.
Regarding odata V3 i have been having troubles with the metadata because I don't know where actions are defined so far I have been only able to see FunctionImport on metadata but not actions, are FunctionImport an equivalent to actions for OData V3? if not can you point on which node of the metadata are the actions located ?
thanks
Actions can be bound or unbound and can be added to the metadata(EDM) as follows:
builder.Entity<entityname>.Action("actionname").Parameter<type>("paramtername").Returns<type>();
Here, builder can be either ODataBuilder or ConventionalOdataBuilder.
If you want the action to be unbound, you can remove the Entity and directly add it to the builder.
If you wish to add the action to IEdmModel directly, you can add the action as a schemaelement.
Source:https://learn.microsoft.com/en-us/aspnet/web-api/overview/odata-support-in-aspnet-web-api/odata-v3/odata-actions
Edit: Actions are defined in metadata as follows:
<Schema Namespace="Default" xmlns="http://schemas.microsoft.com/ado/2009/11/edm">
<EntityContainer Name="Container" m:IsDefaultEntityContainer="true">
<EntitySet Name="Movies" EntityType="ODataActionsSample.Models.Movie" />
<FunctionImport Name="SetDueDate" ReturnType="ODataActionsSample.Models.Movie" IsBindable="true" EntitySet="Movies" m:IsAlwaysBindable="true">
<Parameter Name="bindingParameter" Type="ODataActionsSample.Models.Movie" />
<Parameter Name="DueDate" Type="Edm.DateTime" Nullable="false" />
</FunctionImport>
<FunctionImport Name="CreateMovie" ReturnType="ODataActionsSample.Models.Movie" EntitySet="Movies">
<Parameter Name="Title" Type="Edm.String" FixedLength="false" Unicode="false" />
</FunctionImport>
</EntityContainer>
I have custom TFS form with a text field comment. I want this field to be readonly for most of the area paths except 4. How can I add condition to set the field as read only?
basically, when the area id is 1,2,3,4 the comment field should not be readonly else it should be readonly.
I tried the following, but it didn't work
<FIELD name="Comment" refname="test.test.comment" type="Integer">
<WHENNOT field="System.AreaId" value="1">
<READONLY />
</WHENNOT>
<WHENNOT field="System.AreaId" value="2">
<READONLY />
</WHENNOT>
<WHENNOT field="System.AreaId" value="3">
<READONLY />
</WHENNOT>
<WHENNOT field="System.AreaId" value="4">
<READONLY />
</WHENNOT>
</FIELD>
I dont want to write when conditions because these 4 are constant and I have about 40 other area ids which keeps increasing.
No, "And" multiple "WHENNOT" conditions doesn't work. See: Work Item state change rules in TFS - Any way to use "AND"s or "OR"s?
So, instead of using work item rules, you need to work with custom work item control. Determine when to set Comment filed to be readonly via using TFS API. Check this link for the details on how to work with custom work item control: https://witcustomcontrols.codeplex.com/
IS there a way to add a metadata xml in your jenkins job plugin that doesnt show up UI but can be populated by going into config.xml ?
I have something like this :
<!--
#author Kuber Kaul
-->
<j:jelly xmlns:j="jelly:core" xmlns:f="/lib/form" xmlns:r="/lib/pib" xmlns:st="jelly:stapler">
<f:section title="${%xxx}">
<f:dropdownList name="details" title="${%xxx}">
<j:forEach var="s" items="${descriptor.artifactoryServers}" varStatus="loop">
<f:dropdownListBlock value="${s.name}" title="${s.url}" selected="${s.name==instance.artifactoryName}">
<f:nested>
<input type="hidden" name="artifactoryName" value="${s.name}"/>
<input type="hidden" name="artifactoryUrl" id="artifactoryUrlDeploy${s.url}" value="${s.url}"/>
<input type="hidden" name="stapler-class" value="dj.pib.productivity.ServerDetails"/>
<f:entry
title="${%Module Name}" name="module" readOnlyTextbox>
pam
</f:entry>
but this read only text box doesn't seem to send "pam" in the backend but null. Any way around it ?
I can't really understand your question. What do you mean by "metadata XML"?
The Jelly setup you're describing will show up in the UI (as a read-only textbox).
If you want the value pam to be hardcoded in a job's configuration, there's no need to place that in your Jelly XML — just hardcode that value in the Java code, where it's required.
In any case, to fix your Jelly, the syntax of this part is not correct:
<f:entry title="${%Module Name}" name="module" readOnlyTextbox>
pam
</f:entry>
readOnlyTextbox is a tag, not an attribute on entry, so it should probably look like this:
<f:entry title="${%Module Name}" field="module">
<f:readOnlyTextbox value="pam" />
</f:entry>
I would like to add proper management for Duplicated bugs.
My plans were to Add new link type "Duplicating" and to prevent move to "Duplicated" in case the new linktype ==0.
Steps Taken:
Add new link type: https://msdn.microsoft.com/en-us/library/dd273716.aspx
preventing:
<FIELD refname="My.DuplicatingBug">
<WHEN field="My.LinkType.Duplicating" value="0">
<COPY from="value" value="0" />
</WHEN>
<COPY from="value" value="Valid Completed Work time" />
<PROHIBITEDVALUES expanditems="true">
<LISTITEM value="0" />
</PROHIBITEDVALUES>
</FIELD>
Yet, when trying to import the new WIT, The following prompts:
Error importing work item type definition:
TF201000: Field reference name My.LinkType.Duplicating conflicts with an existing link type. The name is already in use.
I assume that on your bug work item definition you have defined 2 fields: My.DuplicatingBug and My.LinkType.Duplicating
When you created your custom link you probably defined it as
When you're uploading the new bug definition, the field reference is clashing with the link type reference.
I'm not 100% certain but I don't think there is a way to add a conditional value to a field based on a link type.
Could you perhaps add a new field on the Bug work item called "Duplicate Bug ID" and even a new closed state of "Duplicate" and you can only move into the Duplicate state if you have populated the "Duplicate Bug ID"
I'm using jQuery Mobile (1.2.0) and XPages (8.5.3) and want to disable the Ajax form submission as this appears to be preventing an image being saved (all other text fields are saved successfully).
Can I add data-ajax="false" to the form tag using the following?
<xp:this.attrs>
<xp:attr name="data-ajax" value="false"></xp:attr>
</xp:this.attrs>
I tried using Form in Themes (as per adding styleClass) but nothing was added, I could add the styleClass.
Just add these lines to your theme:
<control mode="override">
<name>Form</name>
<property>
<name>attrs</name>
<complex type="xp_attr">
<property>
<name>name</name>
<value>data-ajax</value>
</property>
<property>
<name>value</name>
<value>false</value>
</property>
</complex>
</property>
</control>
Another alternative to this can be setting the createForm property in XPages to false. This would not generate form tag and allow you to create your own using xp:form. Then you can add your custom attribute using xp:this.attrs just like you did in your query. So you code would look like this:
<?xml version="1.0" encoding="UTF-8"?>
<xp:view xmlns:xp="http://www.ibm.com/xsp/core" createForm="true">
<xp:form id="myForm">
<xp:this.attrs>
<xp:attr name="data-ajax" value="false"></xp:attr>
</xp:this.attrs>
<!-- All the other controls go here -->
</xp:form>
</xp:view>
This would generate the form tag looking something like this:
<form id="view:myForm" method="post" action="/myPath/myDatabase.nsf/xFormAttrs.xsp" class="xspForm" enctype="multipart/form-data" data-ajax="false">