orbeon autocomplete get selected item - autocomplete

I'm using the fr:autocomplete control for autocompletion of street names. The control itemset is filled by the returned address objects (streetname+number+zip+city) from an http service. I read in the documentation that you can bind only with a single-node value. So only the streetname can be bind to the street node.
The problem is i need to bind over values of the selected address with other nodes, such as number, zip and city, at the same time.
Can you show me please how to achieve that?

This is a high level idea.
You can have a temporary node and have the binding to autocomplete control.
You can write xforms:action on event DOMActivate and have setvalue commands all your address fields.
When user selects an address detail, Assuming address detail is space seperated (Eg: StreetXYZ 123 556277 Tokyo), this value is assigned to temporary node.
In the setvalue commands you can use xpath functions substring-before() and substring-after() to fetch each component.
I will try to give an example later. All the best!

Related

MSAccess Binding a Pulldown combobox to a sub-form

I have a multi-column pulldown combo box (cmb_users) that lists user names on a form (frm_myusers), the data is straight from a table called "dbo.my_users", primary key "pc_user_id", and it is the first column in the pulldown.
I then have a multi-form sub-form embedded into the parent form (frm_myusers) that contain one or more roles for each user. The data source is straight from a table called "dbo.my_users_roles" its primary key is pc_user_id. The relationship between dbo.my_users and dbo.my_users_roles is 1 to many.
The challenge I am having is When I try to bind the combobox to the sub-form I get the "cannot bind to an unbound form error"
So then I tried passing the combobox values to a query (qry_my_users_roles)behind the scenes to drive the sub-form. The criteria for the query was on pc_user_id as =[Forms]![frm_users]!cmb_users.Column(0), and I get the error below. Not sure where to go from here.
Ultimately is there a way to simply bind a pulldown to a sub-form without the need to jump through hoops passing variables to queries and refreshing? Mapping fields to query criteria can be quite cumbersome of the spelling or syntax is not absolutely perfect :(
Thanks in advance.
As the combobox is unbound, add it to the master fields:
sci_cnt_id;NameOfCombobox
and adjust the child fields as well:
sci_cnt_id;sci_own_id
Should you wish to show all records, you must maintain the field count, so use:
sci_cnt_id;sci_cnt_id

ABAP Domain and Data Types Understanding

so my company wants me to learn ABAP for SAP and I have started on the road to learn this. My background is mainly VB.net and sqlserver with T-SQL but also have experience in c#.
With ABAP though I am needing some clarification or confirmation on the understanding of Data Types and Domain. If anyone can help.
My understanding currently is we have a table, in the table we have fields and the fields have data types and lengths if needed. Example: We have a table Customer, I could have a customerNumber field with the data type of char(10). To me this mean in the table customer we have a field called CustomerNumber that will have 10 characters.
However with ABAP we have Domains, Data elements then the field, does this mean we have a field named whatever we want. As the field could mean anything we assign a data element which has the descriptions of the sort of data stored within the field. However to store the format and data type we need to assign the Domain to the Data element.
For example I call a field ZCUSNO, currently this means nothing however if I assign the ZCTNMR (with description of customer number) Data element this tells us that the field ZCUSNO is ZCTNMR so ZCUSNO is a customer number field.
Now within the data elements we would have a domain and for our example ZCTNMR data element (the customer number) we could assign ZCTDOM as the domain which would be what I recognise as the data types so Char 20, Char 100 or integer field etc.
Is my understanding correct on this? and could someone give me a clear indication of what the difference between a Domain > Data Element is against what I would know as data types in sqlserver.
Thanks
I don't know if it's 100% correct, but that's is the way I use, like you say.
You can reuse the Domain, If you don't plan to reuse you can use direct the Data Element and refer this to a built-in-type.
Data Element is to define semantic of the field, like label, translation, etc
Domain is to define techinical info of the field, like Type, conversions, predefined Values,e tc
E.G.
Domain:
DOM_VALUE you define it's 10 position and 2 Decimals
Data Element:
UNIT_VAL you refer it to DOM_VALUE and define label as "Unit Value"
TOTAL_VAL you refer it to DOM_VALUE and define label as "Total Value"
Your understanding is pretty correct and not much can be added here.
You should clearly get the main thing.
Domains store technical data (decimal points, length, type, predefined values and so on)
Data elements store semantic data (labels, texts, search help binding, etc.)
Not every table field has data element (they can possess builtin type) but every field has type (either primitive or wrapped in data element).
If you wanna use your field in screens (Dynpros), ALV grids or other reports, then create data elements that will bear business meaning of your field.
If you use this field just for calculations or other utility internal tasks, then don't bother yourself.
As usual table date field (type of variable) uses data element which uses domain.
When you create fields in table and use predefined types instead of data elements you will have some problems in future, when you'll need to see the data on alv_grid.
Actually, you will see that you have some problems even before this (when you will try to make a maintenance view the header will have something like "+" symbol).
And of course we usually try to create 1 domain for 2 and more Data Elements.
In domain you talk about main logic.
In Data Element I always talk about Field label settings (how it'll show in future and some other things)
Final: Actually, the good practice, as I think to create a domain for data element, it may help you in future.
I hope that it helps you. Good luck!

How to list the #Cities entity values my Bot works with in Watson Conversation Service

I have an Entity
#City = Austin, Providence, London and Boston
I simply want to answer the question what cities does this bot work with?
And then respond with:
Here are the cities this works with $Locations , Which city do you want?
In the dialog, you have access to all the entities that were detected (recognized) in the user input. However, you do not have access to all the defined entities and their possible values.
What you could do is to define a context variable with the allowed values. That variable could even be dynamically populated (see this tutorial for database access from within Watson Assistant). Another option is to hardcode the response. But this only works well with few values and infrequent changes.

Record selection conditional formula

I'm making a conditional formula in Crystal Reports for the record selection. The value of {IDENTITY_ADDRESS.ADDRESS_TYPE} can be either 1 (Present Street Address) or 3 (Present Mailing Address).
There will always be a Street Address (1) but I would prefer to use the Mailing Address (3) if one exists. How can I accomplish this?
You'll probably want to write a custom SQL statement inside Crystal to handle this. Since custom-tooled SQL tables evaluate before the report is even reached, it will do the record selection for you.
I can't see your tables so you'll have to write the logic yourself. But the gist is that you'll want to return a new field, let's call it PreferredAddress which will be a varChar that will:
Check to see if a Present Mailing Address (3) is on file for this record
If yes, return the Present Mailing Address (3) as PreferredAddress
If no, return the Present Street Address (1) as PreferredAddress
if {IDENTITY_ADDRESS.ADDRESS_TYPE} = Present Mailing Address
then true,
else
{IDENTITY_ADDRESS.ADDRESS_TYPE} = Present Street Address

How do I search though related tables in access and have the results displayed in a list box

I have created a form that searches through a table, following the instructions of John Big Booty, as can be seen here: https://access-programmers.co.uk/for...d.php?t=188663. The search form has a list box that has a query run whenever a text box is changed which allows me to search fields in one table but how do I adjust it to allow me to find related records stored in a second table. The database stores widow information and they are looked after by legatees.
The query has the following code in the criteria for each field you want to search Like "" & [forms]![FRM_SearchMulti]![SrchText] & "".
Each legatee is responsible for looking after multiple widows and any widow can be assigned to any legatee but any widow can only one legatee when she is assigned to one.
The search form is called FRM_SearchMulti and it searches through the widow table as I type. I want it so that you can type in a legatee and it will display the widows that have been assigned to that legatee typed in the search box. I seem to have hit a road block and everything I try doesn’t seem to work.
I have uploaded a version of the db with a lot of the information deleted, for privacy reasons, so if it is possible, could you describe to me how to do it and I will update the file with all the information in it please?
Any help would be greatly appreciated.
Thanks,
Dave