I have a PDF order form that lists hundreds of product items (inside read only text fields) and they each have an associated "Quantity" field. Is it possible to dynamically change the binding property of the "Quantity" field from "No data binding" to "Use name" based on whether the user has entered a Quantity? I would like to accomplish this to limit the file size of the XML file that gets submitted from the form.
Changing the binding at runtime will not work unless you rerender/reinitialize the form.
You can however use javascript on field exit events or pre-submit event to create XML data elements for quantities. Or use bindings but remove empty xml nodes before submit if you're trying to limit the XML size.
Check out the XFA scripting guide, in particular xfa.datasets.createNode function for creating XML nodes.
Related
I am trying to make UI by using Thymeleaf template engine. I have a property file, which contains list of messages for validations.
For example: I have a propery customer.collateral.allocated_amount=Entered amount is bigger than your available balance. Balance: {0}
Now this I wanna replace this {0} with value, which I get from server side from database. For example, I query from database and I get 500.50. And what I want to do now, is to display this propery with value. In this example, it would be: Entered amount is bigger than your available balance. Balance: 500.50
I tried to do this, but no luck:
<th class="right" th:inline="text">([[#customer.collateral.allocated_amount]], ${availableAmount})</th>
How could I do this?
Here are the steps you need to follow for a basic set-up to use Thymeleaf messages:
1) Let's assume you have a Thymeleaf template called customers.html.
2) Your properties file must therefore be called customers.properties, and it must be placed in the same directory as the customers.html template.
3) Let's assume your properties file contains this entry:
amountBiggerThanAvailable=Entered amount is bigger than your available balance. Balance: {0}
4) For the placeholder {0} I will assume you have a Java object called account which has a property called availableAmount and which you pass to Thymeleaf in the usual way (i.e. the same way you pass any other data to your Thymeleaf template). Of course, your version may be different.
Here, I will use a <div> for my example - but you can use whatever you want, of course:
5) Use the message in your template like this:
<div th:text="#{customers.amountBiggerThanAvailable(${account.availableAmount})}"></div>
Note that there is no actual content in the div (between the opening <div> and the closing </div>). All the Thymeleaf directives are attributes inside the opening <div>.
The above fragment will generate the following HTML in your web page:
<div>Entered amount is bigger than your available balance. Balance: 123.45</div>
Once you have got this far, there are various enhancement you can make. For example, you can also look into providing localized (translated) messages as described here.
I work with Wonderware software. One of the objects used to perform communication between Wonderware and the PLC is called Suitelink. In it, I have a table defined that has the name of one of my application fields on the left side and the name of the PLC tag providing its value on the right.
Once this saved and activated (deployed) the PLC tags will feed values in the field attributes to Wonderware.
Does anyone know where is this list saved in the system?
I am working at a web page and want to retrieve this list dynamically so I can have the page updated based on the current live value of the PLC tag being used.
I have looked in the database but could not find it.
C:\ProgramData\Wonderware\DAServer
Then within there you'll have several subfolders for your DA Servers. Open the subfolder to find a *.AAcfg file and your contents are in there in what looks like an XML format. You'll be hunting for all the <DeviceItem> tags
When my program displays a SaveDialog to save a file I can use the Filter and Filter Index properties to restrict the files displayed to certain extensions. Also, when I set the DefaultExt property then, as the user types a filename, matching files in the folder are displayed as suggestions in a dropdown box and one can be selected with the mouse.
For example if the filter is set to "*.xml" then only filenames matching that extension appear in the the dialog list of files. But if the user type "Test", then you will get a dropdown list of suggestion files like:
TestA.doc
TestB.xml
Test123.pdf
TestX.xml
(if those files are present in the folder)
But I would like the suggestion list to only contain the files that match the filter, such as *.xml. Is that possible? The problem is that users can hit the wrong suggestion and save their file with the wrong extension.
TSaveDialog internally uses the IFileDialog interface of Windows. That interface doesn't offer any way in which to change how to filter files in suggestion dropdown text box of File Name field.
You can :
Implement own dialog from scratch
Use component like DexExpress which is not free
Check result of save dialog after execution of it and validate the user selection file and show proper message to user if the file is not valid
In my app I have a form for creating new trip. Model Trip has field finish_address. For setup the finish_address in I use select in simple form to select address from user's addressbook. But I want to make a better form: if there isn't necessary address, user can add it using input field.
So I need to make form with to types of setup finish_address. How can I make it?
You have 2 basic options.
You can use autocomplete on a text input, populating a dynamic crop-down with know values.
There are several gems available to get you started in this direction, like https://github.com/crowdint/rails3-jquery-autocomplete.
Alternatively, you can add an "other" option to a select input, populated with your known values. When the "other" item is selected, display a previously hidden text input with the same name below the select input. The "lowest" element will take precedence, for what gets sent to the controller.
In the controller, just do a find_or_create_by, using your provided value.
These options both require javascript, but you can eliminate the need for javascript if you make your select a non-db-backed attribute, and manipulate your params accordingly, as they come in to the model. This might help with validations, as well.
In TFS2010/TFSPowerTools2010/Process Explorer I am creating a custom process template. I define a new work item type (WIT) called "Enhancement" copied from the CMMI "Change Request" WIT.
Then I want to rename the friendly field name of the work item type "System.Title" (called "Title") to "Summary".
When I upload my custom process template to the TFS server and create a team project, and then create a new Enhancement, the info in the required field text still shows :
"TF20012: Field "Title" cannot be empty.
Why ?
(I want to see "TF20012: Field "Summary" cannot be empty.)
What you can do is create a new field and make it required. Call it Summary, etc. Change the Title label and textbox from the stock values and point it to your new field. Do not remove the System.Title field from the field list.
In the work flow, use the Summary value to populate the System.Title field, which is not on the form. Then if they try to save without a Summary, they will get the correct error and System.Title will have a valid value for reporting.
Be sure you account for the System.Title field everywhere it is referenced in the work flow.
You aren't able to rename a system field like System.Title. It's used by other work item types across the team project collection and the server instance. It also has to be filled in by the default rules. You can rename the "label" that gets shown to the end user by going to the layout tab of the work item type editor (in the TFS Power Tools) and find the control and change it's label attribute but leave the field the same.
In Visual Studio I was looking at a WinForm and saving the form I got this error:
Microsoft Visual Studio Save failed.
TF20012: Field 'Title' cannot be empty.
OK
Since its a TF error I closed all the Work Items (even unsaved ones...) and then saving the Winform worked.
I am not sure how VS thought the Work Item was the active code window I saw looking at.