How can I prevent a client-side data rule workflow from being executed the first time the screen loads? - aviarc

The problem I have is this: I have a data rule which validates a field against a regex. I've provided both server- and client-side versions of the data rule, and bound them to appropriate dataset events.
The problem is, when I load the screen which contains the record creation form, the field is marked as invalid before the user gets any opportunity to even enter a value. I assume it's something to do with the dataset field being initially bound to the text-edit widget. I only want the validity to be test after the user enters a value, or when the screen is submitted.
How can I prevent the data rule from running when the screen is first loaded?
Update
Here's is my data rule definition:
<data-rule name="{#name}"
factory-class="com.aviarc.framework.datarule.xml.DefaultXMLDataRuleProviderFactoryImpl"
datarule-class="com.aviarc.framework.datarule.workflow.WorkflowDataRule">
<attributes>
<attribute name="field" mandatory="y" type="field"/>
<attribute name="valid-membership-number-regex" default="\d{8}[a-zA-Z\d]" mandatory="n" type="string">
Valid membership number regex:
- \d{8} : match 8 digits
- [a-zA-Z\d] : match any alphanumeric character
</attribute>
</attributes>
<event name="onRowFieldChanged" workflow="workflows/set-membership-number-valid"/>
<event name="onCurrentRowFieldChanged" client-action="actions/set-membership-number-valid"/>
</data-rule>

For field-change events like the ones I'm using, you need explicitly pass through the field that the dataset is bound to, like so:
<event name="onRowFieldChanged" field="{#field}" .../>
<event name="onCurrentRowFieldChanged" field="{#field}" .../>
I think my data rule must have been executing on any field change event, rather than just the field it was bound to.

Related

Set Spring Webflow attribute dynamically

I would like to set an attribute dynamically on a view-state like:
<view-state id="any" view="/some.view.xml">
<attribute name="attr" value="#{true ? 'a' : 'b'}"/>
</view-state>
but the value is just taken as plain text. What ways do I have to change 'attr' based on a value in my model.
Explanation
The tag will not work since it only supports plain strings, not EL expressions.
I found a solution by adding info to the variable temp in an action call and evaluating it in the flow with
<on-entry><set name="viewScope.attr" value="flowScope.temp eq 'X' ? 'aaaa' : 'bbbb'" /></on-entry>

Binding multiple value sets to a single extension element

I'm wondering if there is a way to bind multiple value sets to a single extension element in fhir.
Here's an example of what I'm trying to achieve:
<StructureDefinition xmlns="http://hl7.org/fhir">
...
<snapshot>
...
<element>
<path value="Extension.valueCode"/>
...
<type>
<code value="code"/>
</type>
<binding>
<strength value="required"/>
<valueSetUri value="http://stelar.org/valueSet/const-yesNo"/>
</binding>
<binding>
<strength value="required"/>
<valueSetUri value="http://stelar.org/valueSet/missingData"/>
</binding>
</element>
...
</snapshot>
...
</StructureDefinition>
My reason for wanting to bind multiple is that I'm porting data over from a legacy system in which coded values can either come from a value set which represents collected data, or a separate value set which represents missing data. The reason for the split is that sometimes more is known about why the data is missing.
I don't really want to go an create a composite value set for every combination of the missing value set, and the various other value sets if possible, as this will really minimise the reuseability of the value domains.
I'm not sure if I'm just getting my syntax wrong, but I can't find any mention of multiple bindings in the documentation, and which I upload the file in the above (or below format) to simplifier, it only renders one bound domain, which makes me think it is just accepting the last child.
<binding>
<strength value="required"/>
<valueSetUri value="http://stelar.org/valueSet/const-yesNo"/>
<valueSetUri value="http://stelar.org/valueSet/missingData"/>
</binding>
Is there a way to bind multiple value sets? Is there a better way of handling missing data in fhir?
See http://build.fhir.org/elementdefinition-definitions.html#ElementDefinition.binding - binding can only appear once. Creating multiple bindings has a number of practical consequences, so the expectation is that you'll define a single value set that imports the other 2 value sets you might include. Note that you could create a contained value set in the structure definition that imports the two actual value sets, since it has no real existence or meaning outside the structure definition
We are discussing use cases for multiple bindings right now - but it's complicated. If there's more than one binding, is that 'and' or 'or'?

Binding Null Placeholder not translated in view based NSTableView

I have a view based NSTableView whose content is bound to an array controller. I bind one specific text field using objectValue.title. This works fine. I also have set a null placeholder for that binding which is indeed displayed when the value is null. However, it does NOT use translated values of the null placeholder.
The identifier for the placeholder is je1-iU-XEu.ibShadowedIsNilPlaceholder and the corresponding translation is je1-iU-XEu.ibShadowedIsNilPlaceholder" = "Stationsname";.
If I do the same with a cell based table view, it works. Any idea why this is not working?
I'm having this bug today. Seems that Apple didn't care about fixing it.
If you use localized strings, then you might have to dive in the storyboard code and ensure the object ids are matching.
In your storyboard, you will see an element with key "NSNullPlaceholder", wrapped into another one with id "Ds1-Gj-yzu". (See the code below)
Go to your string file and ensure you have something like
"Ds1-Gj-yzu.ibShadowedIsNilPlaceholder" = "Your translation";
WARNING: each time you will change the placeholder value in the storyboard, a new ID is generated, breaking at the same time the localization.
<connections>
<binding destination="TyA-Z9-mxH" id="Ds1-Gj-yzu" keyPath="objectValue.group" name="value">
<dictionary key="options">
<string key="NSNullPlaceholder">Group</string>
</dictionary>
</binding>
</connections>

URL-encoded form data is not valid

I have a webpage that posts multiple form tags. It's an inline edit page, where I can either post one row at a time or multiple rows. Last night, without making any changes to the code or data, I started getting The URL-encoded form data is not valid error on multiple posts, although single row posts work fine.
The MS KB issue in question is: http://weblogs.asp.net/scottgu/archive/2011/12/28/asp-net-security-update-shipping-thursday-dec-29th.aspx
In a nutshell there is now an upper bound on the number of simultaneous HTTP form elements that may be posted. The default is now 1000 without explicitly changing it with this key in the <appSettings> portion of the web.config:
<add key="aspnet:MaxHttpCollectionKeys" value="some number greater than 1000" />
There was a microsoft update and it may have caused your issue see link.
http://knowledgebase.solarwinds.com/kb/questions/3476/Website+Error%3A+The+URL-encoded+form+data+is+not+valid

Google Reader's Feed Unique ID

I'm building an app using Google Reader's API. The XML for a particularly feed (aka entry) returned by Google Reader looks as follow:
<entry gr:crawl-timestamp-msec="1294812847894">
<id gr:original-id="">tag:google.com,2005:reader/item/fc8597a0dcb83203</id>
<category term="..." scheme="http://www.google.com/reader/" label="read" />
<category term="..." scheme="http://www.google.com/reader/" label="reading-list" />
...
</entry>
Question: is the value of the id element (i.e. "tag:google.com,2005:reader/item/fc8597a0dcb83203") globally unique (i.e. across all subscriptions and all Google Reader users)? If not, what should constitute the globally unique id for a feed?
Yes, the ID is globally unique. This is why Reader generates its own IDs (and keeps the IDs from the original feed (if any) in the gr:original-id element), to ensure that uniqueness.

Resources