Quantcast
Channel: SmartClient Forums
Viewing all articles
Browse latest Browse all 4756

How to synchronize in a SelectItem with a hashtable

$
0
0
in my Dialog i have got this sequence of code...
Code:

final LinkedHashMap<Integer, String> oMapMarketPlaces = new LinkedHashMap<Integer, String>();
    oMapMarketPlaces.put(0, m_oMessages.getNoMarketPlace());
    oMapMarketPlaces.put(1, m_oMessages.getPosterMarketPlace());
    oMapMarketPlaces.put(2, m_oMessages.getW2PMarketPlace());
    oMapMarketPlaces.put(3, m_oMessages.getBothMarketPlace());

   
    final SelectItem oSelectItemPrintShop = new SelectItem("allowedmarketplace");   
    oSelectItemPrintShop.setTitle(m_oMessages.getActivatedPrintMarketplaces());
    oSelectItemPrintShop.setName("allowedmarketplace");  // get the values 0..3           
    oSelectItemPrintShop.setValueMap(oMapMarketPlaces);   
    oSelectItemPrintShop.setDefaultValue(0);
    oSelectItemPrintShop.setTooltip(m_oMessages.getToolTipImgMarketPlacePrint());
    oSelectItemPrintShop.addDataArrivedHandler(new DataArrivedHandler() {     
      @Override
      public void onDataArrived(DataArrivedEvent event)
      {
      ResultSet oResultSet = event.getData();
      int iAllowedMarketPlace = oResultSet.getAttributeAsInt("allowedmarketplace");
      oSelectItemPrintShop.setDefaultValue(iAllowedMarketPlace);
      }
    });

when the data arives from the datasource i would to synchronize and to Show the data frm the hashmap. all in all it's simple, in the dataSource i have onlythe id, but i don't want to show the id i want to show a text. it seems this is not the right way to handle this. even the added handler is not called...
can somebody give me a hint?

Thanks
lmedici

Viewing all articles
Browse latest Browse all 4756

Trending Articles