Code Monkey home page Code Monkey logo

Comments (3)

mawtex avatar mawtex commented on July 18, 2024

This is a bit tricky to accommodate since the list C1 Users are not always maintained as a C1 Data type - we do ship with a data type IUser which is used to host logins by default, but we can't hard wire this into the data system.

But you can still achieve what you are looking for.

Edit the form markup and replace the textbox

  <TextBox Label="LABEL_HERE" Help="" SpellCheck="true">
    <TextBox.Text>
      <cms:bind source="FIELD_NAME_HERE" />
    </TextBox.Text>
  </TextBox>

with this

  <KeySelector Label="LABEL_HERE" Help="" OptionsKeyField="Key" OptionsLabelField="Label" Required="true">
    <KeySelector.Selected>
      <cms:bind source="FIELD_NAME_HERE" />
    </KeySelector.Selected>
    <KeySelector.Options>
      <ff:StaticMethodCall Type="&lt;t n=&quot;Composite.Plugins.Functions.WidgetFunctionProviders.StandardWidgetFunctionProvider.DataReference.DataReferenceSelectorWidgetFunction`1&quot;&gt;&#xD;&#xA;  &lt;t n=&quot;Composite.Data.Types.IUser&quot; /&gt;&#xD;&#xA;&lt;/t&gt;" Method="GetOptions" Parameters="Composite.Data.Types.IUser" />
    </KeySelector.Options>
  </KeySelector>

from c1-cms-foundation.

DBailey635 avatar DBailey635 commented on July 18, 2024

Thanks Marcus. That's really useful.

from c1-cms-foundation.

burningice2866 avatar burningice2866 commented on July 18, 2024

To make it more robust, the

<ff:StaticMethodCall Type="&lt;t n=&quot;Composite.Plugins.Functions.WidgetFunctionProviders.StandardWidgetFunctionProvider.DataReference.DataReferenceSelectorWidgetFunction`1&quot;&gt;&#xD;&#xA;  &lt;t n=&quot;Composite.Data.Types.IUser&quot; /&gt;&#xD;&#xA;&lt;/t&gt;" Method="GetOptions" Parameters="Composite.Data.Types.IUser" />

should be replaced with a call to a custom method that returns id's based on the UserFacade - thus in turn returning users from custom providers as well. Like this

<ff:StaticMethodCall Type="ConsoleHelpers" Method="GetAllUserIds" />

from c1-cms-foundation.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.