dialog list lotus notes in xpages

无人久伴 提交于 2019-12-10 16:24:31

问题


Is there any equivalent for lotus notes Dialog list in xpages? Or, if it's possible, an xpage combobox ''which accepts'' multiple values selected.

Thanks for your time


回答1:


Use a xe:djextListTextBox to collect and show multiple values, use xe:valuePicker to add values from an existing list to ListTextBox and use optionally a button to prompt for a new value and to add it to ListTextBox.

This is an example for xe:djextListTextBox and xe:valuePicker:

   <xe:djextListTextBox
      id="djextListTextBox1"
      multipleSeparator=","
      multipleTrim="true"
      defaultValue="abc,def"
      value="#{viewScope.test}">
   </xe:djextListTextBox>
   <xe:valuePicker
      id="valuePicker1"
      for="djextListTextBox1"
      pickerText="Add">
      <xe:this.dataProvider>
         <xe:simpleValuePicker>
            <xe:this.valueList><![CDATA[#{javascript:
               ["abc","def","ghj","klm","nop","xyz"]
            }]]></xe:this.valueList>
         </xe:simpleValuePicker>
      </xe:this.dataProvider>
   </xe:valuePicker>

I like this approach as it is for the user easy to add and to delete values and it looks good.

An alternative is the combination of xp:inputText and xe:valuePicker:

   <xp:inputText
      id="inputText1"
      multipleSeparator=","
      value="#{viewScope.test}"
      defaultValue="abc,def">
   </xp:inputText>
   <xe:valuePicker
      id="valuePicker1"
      for="inputText1">
      <xe:this.dataProvider>
         <xe:simpleValuePicker>
            <xe:this.valueList><![CDATA[#{javascript:
               ["abc","def","ghj","klm","nop","xyz"]
            }]]></xe:this.valueList>
         </xe:simpleValuePicker>
      </xe:this.dataProvider>
   </xe:valuePicker>

Users can add their own new values as the InputText field is editable. This approach might be a good solution if new values are allowed and users know how to edit values considering the multiple separator.

In case you'd like to have each value in a separate line you can use xe:djTextarea and set multipleSeparator to newline:

   <xe:djTextarea
      id="djTextarea1"
      multipleSeparator="#{javascript:'\n'}"
      value="#{viewScope.test}"
      defaultValue="#{javascript:['abc','def']}"
      cols="30">
   </xe:djTextarea>
   <xe:valuePicker
      id="valuePicker1"
      for="djTextarea1">
      <xe:this.dataProvider>
         <xe:simpleValuePicker>
            <xe:this.valueList><![CDATA[#{javascript:
               ["abc","def","ghj","klm","nop","xyz"]
            }]]></xe:this.valueList>
         </xe:simpleValuePicker>
      </xe:this.dataProvider>
   </xe:valuePicker>

The text box grows and shrinks with the number of selected values automatically.




回答2:


The ValuePicker control in the Extension Library provides the Dialog List functionality, but not with the "Allow values not in list" functionality.



来源:https://stackoverflow.com/questions/23108740/dialog-list-lotus-notes-in-xpages

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!