Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    How to override emptyPickListMessage of PcikList interface

    SmartClient version : SmartClient_v90p_2014-03-07_PowerEdition
    Browser(s) and version(s) : Internet Explorer Version 9 and Google Chrome Version 28.0.1500.95 m


    We tried to override the default value of emptyPickListMessage of PickList interface after loading required smart client libraries
    The code is as follows :
    Code:
    isc.PickList.addInterfaceProperties({emptyPickListMessage : "test message"});
    Below is the code to construct the PickList in my jsp:
    Code:
    sc.ListGrid.create({
    	ID:"test",
    	fields:[ {	name:"DEPARTMENT",
    				pickListProperties: {showFilterEditor:true},
    				pickListFields:[{name:"NUM",title:formatText('<fmt:message key="Field.DEP_NUMBER"/>')},
    								{name:"NAME",title:formatText('<fmt:message key="Field.ENGLISH_NAME"/>')}					
    								]
    			 }
    			]
    });
    but when we put the emptyPickListMessage in pickListProperties,it is working fine.
    But we need this customized/overriden value to be appeared/shown in all our pick list menus accross the application.
    so we decided to keep the overriden value in a common file called common.jsp which will be included in all jsp pages.

    #2
    Do not use undocumented APIs (addInterfaceProperties()). If this seems to be necessary, this is a hint that you are doing something wrong.

    If you want to set the pickList message system-wide, you can use the Internationalization system to do this - see the Internationalization overview.

    If you are doing this for some reason other than Internationalization, set the emptyMessage property on the PickListMenu class.

    Comment


      #3
      Actualy I am loading the frameworkMessages_ar.properties language pack in my JSP and I am ok with the default translation of the pickListMenu_emptyMessage. but it seems smartclient is not picking the value of the pickListMenu_emptyMessage from the right language pack.

      Even though I used the below code assuming that will solve the issue but it is not solved
      Code:
       isc.PickListMenu.addClassProperties({emptyMessage :"test"});
      I have gone through the Internationalization overview but nothing there could help

      Comment


        #4
        emptyMessage is not a class property so you use addProperties.

        Comment


          #5
          HI I tried this but it is not working as well
          Code:
           isc.PickListMenu.addProperties({emptyMessage :"test"});
          also I am still wondering why it is not picking the right value directly from the language pack

          Comment


            #6
            Sorry for the confusion of posts here.

            The problem here is that the PickListMenu emptyMessage is overridden for pickLists displayed by ComboBoxItem / SelectItem to pick up the specified "emptyPickListMessage".
            Your call to modify the emptyMessage of the PickListMenu class is probably working, but then being overridden when the pickListMenu instance is created for specific items.

            So your original post was actually basically on the right track, except instead of attempting to use the internal "addInterfaceProperties" API (unsupported and won't work in this case), you should just call addProperties directly on the SelectItem / comboBoxItem class.

            So isc.SelectItem.addProperties({emptyPickListMessage:"test"}); should get this working correctly.

            (Or of course you can set the property on your specific selectItem instance if you aren't trying to set this globally).

            We'll also look into whether there is an issue with the language pack.

            Regards
            Isomorphic Software

            Comment


              #7
              We've made a permanent fix for this in SC 10.0d.

              Comment

              Working...
              X