This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal



Oct 15, 2014, 10:32 PM
13 Posts

Compute combo box value

  • Category: Other
  • Platform: Windows
  • Release: 9.0.1
  • Role: Developer
  • Tags: combobox
  • Replies: 2

I have a combo box with texts in label and numbers in value. I want to compute the values of combo box to save text (labels) with creating my own function library. I am really beginner in xpages Please help me. Thanks in advance.

 

<xp:comboBox id="comboBox2"

   value="#{document1.status}" style="width:76.0px">
    <xp:this.validators>
        <xp:validateExpression
            message="Please select status.">
            <xp:this.expression><![CDATA[#{javascript:!getComponent("comboBox2").getSubmittedValue().equalsIgnoreCase("-select-")}]]></xp:this.expression>
        </xp:validateExpression>
    </xp:this.validators>
    <xp:selectItem
        itemLabel="-Select-">
    </xp:selectItem>
    <xp:selectItem itemLabel="Requested" itemValue="10">
    </xp:selectItem>
    <xp:selectItem
        itemLabel="Next Release" itemValue="20">
    </xp:selectItem>
    <xp:selectItem
        itemLabel="Scheduled" itemValue="30">
    </xp:selectItem>
    <xp:selectItem
        itemLabel="Awaiting Additional Info" itemValue="40">
    </xp:selectItem>
    <xp:selectItem
        itemLabel="In Development" itemValue="50">
    </xp:selectItem>


</xp:comboBox>
Oct 16, 2014, 2:24 PM
453 Posts
Not sure that I fully understand the question

When you say that you want to compute the values for the combo box do you mean that you have a table of values and labels somewhere and want to populate the combo box with them. What I have done is build a multi-value viewScope variable and I build the list to look like this:

Label1|value1

Label2|Value2

etc

Then bind the combo to the viewScope. Compute the values in the beforePageLoads event so it only computes once in the page life. I'm pretty sure the values could also be computed it a JAVA bean and bound to the Combobox but I have never tried that yet. Probably should.

Oct 20, 2014, 8:38 PM
13 Posts
Well....

When I select a label from this combo box the number displays in view panel this is that I don't want I want to display labels in view panel not number. I want to do this by creating my own library.I am really beginner in xpages any help would be very appreciated!

 


This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal