• Refresh of extlib.dijit.PickerCheckbox

    By Ulrich Krause 1 decade ago

    I'm having an issue with refreshing a extlib.dijit.PickerCheckbox. I would like to refresh the valueList according to the value of another component.

    My code is a following

           
                
                
                    
                                                 id="td_role_right_to">
                                                         for="txt_role_right_to" dojoType="extlib.dijit.PickerCheckbox">
                                
                                                                         labelSeparator="|">
                                         return getRightToList(getComponentValue('txt_role_module'));
    } else {
    return getRightToList('BASIC');
    }}]]>

                                    
                                

                                
                            

                        

                        
                                                         value="#{role.RightTo}" multipleSeparator="#{javascript:@NewLine();}"/>
                        

                    

                

            

        
        
        
            
    return getRightToList(getComponentValue('txt_role_module'));
    } else {
    return getRightToList('BASIC')
    }}]]>

        

     

    txt_role_module is the Id of the component that is passed as a parameter to the "getRightToList" function. The funktion returns a list of label| value pairs to populate the ValuePicker.

    I have added a computed text field to test, if the getRightToList(getComponentValue('txt_role_module') workd properly. ( It does!)

    So the problem is that the computed field is refreshed on either a complete or partial refresh, but the ValuePicker is not. (It always returns the list for the BASIC keyword.

    What am I missing?

     

     

    • You need the data to be sent to the server

      By Philippe Riand 1 decade ago

      Either as part of the URL when the name picker calls the service (you'll have to come with your own picker implementation for this), or you need to update the server data when your value changes in the edit box. You can simply do server side event with no refresh, just to get the data uploaded.

      BTW, I would advise you to use the built-in localization capability of XPages rather than a JS array. It will perform better while being easier to maintain.