Sa aking on-pagpunta pagtatangka sa pagbibigay ng higit pang mga kapaki-pakinabang na lookup gamit ang haligi BDC, I hit a wall with the BDC picker. If you haven’t see it, the BDC picker is similar to a people picker except that it works with columns of type "business data".
Mong ma-access ang picker sa pamamagitan ng pag-click sa icon na open book ng isang hanay ng data ng negosyo tulad ng ipinapakita:
The above image shows a business data column called "Master Document Id". That column is connected, sa pamamagitan ng BDC, to a web service. The web service returns two columns of information: Document ID and Title. The business purpose here is to provide a "this document is based on" tungkulin. Users select a "master" dokumento at kapag sila ay i-save ang, isang kaganapan receiver kopya meta data mula sa mga patlang ang reference master.
Sa pamamagitan ng default, the BDC picker looks like this when I search for a document whose ID = "38":
Iyon ay kapaki-pakinabang, but not good enough. People don’t think in terms of IDs, they think in terms of titles and/or other meta data. The picker allows you to search on other columns (e.g. Pamagat) ngunit hindi ipapakita ang aktwal na listahan ng mga pamagat na ito natagpuan, lamang DocId kanilang ay tulad ng ipinapakita dito:
(Ang screen shot ay hindi kaya mahusay na ito dahil hindi ko na lang ng paghahanap na nagbabalik ng anumang wastong mga resulta, ngunit maaari mong makita na kung ito ay natagpuan ng ilang mga resulta, Gusto ito lamang ang nagpakita sa DocId ni, Hindi pamagat).
I searched high and low for the answer to this and failed. Ang aking kasamahan, ang mga karapat-dapat sambahin Jonathan Bradshaw, had faced and solved this issue. When I reached out to him for help, siya tulis sa akin sa tamang direksyon.
Configure the picker to show multiple columns via the "ShowInPicker" ari-arian sa ADF:
<Ari-arian Pangalan="ShowInPicker" Uri="System.Boolean">totoo</Ari-arian>
Sa higit pang mga detalye:
<!-- Pamagat -->
<TypeDescriptor TypeName="System.String" Pangalan="Pamagat" >
<LocalizedDisplayNames>
<LocalizedDisplayName LCID="1033">Pamagat</LocalizedDisplayName>
</LocalizedDisplayNames>
<Katangian>
<Ari-arian Pangalan="DisplayByDefault" Uri="System.Boolean">totoo</Ari-arian>
<Ari-arian Pangalan="ShowInPicker" Uri="System.Boolean">totoo</Ari-arian>
</Katangian>
</TypeDescriptor>
Setting this property does introduce a minor problem. As soon as you set it once, you need to set it for every column you want to show. Sa aking kaso, BDC picker showed DocId by default. Gayunman, once I added "ShowInPicker" sa Pamagat, DocId no longer displayed. I solved that by explicitly setting the ShowInPicker property for Doc ID.
Narito ang resulta ng:
(I’ll explain the odd-looking "168 – CamlSchema.xsd" construction in a future blog post. In short, ito ay isang concatenated string na nagbibigay-daan para sa isang bahagyang mas mahusay na karanasan ng gumagamit).
Talaga, pagkakaroon ng nakasulat na ito blog entry, I just did a search for "ShowInPicker" at nakitang maraming mga hit, kabilang ang isang ito: http://msdn2.microsoft.com/en-us/library/ms583986.aspx. It explains the meaning of that property along with some other good BDC stuff.
</dulo>
Mag-subscribe sa aking blog!