[Logo] Enterprise Client Community
  [Search] Search   [Recent Topics] Recent Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
CCComboFieldIdText  XML
Forum Index -> Development
Author Message
deftereos

Power User

Joined: 05/05/2011 13:49:24
Messages: 100
Offline

Hello Bjorn,

Using a CCComboFieldIdText control in a grid row, I'm having problem accessing the id of the selected entry of CCComboFieldIdText.

public class GridItem extends FIXGRIDItem implements java.io.Serializable
{
String m_medicineId;
CCComboFieldIdText m_cfMedicine;
public CCComboFieldIdText getCfMedicine() { return m_cfMedicine; }

...
}

...

for(GridItem gi : m_grid.getItems()){
// how do I get the selected id from m_cfMedicine?
//gi.m_cfMedicine.

}

I have seen in demo server your example using the autocomplete CCComboFieldIdText control but there you are accessing the selected id through a global var. If using the control in a grid how this can be done?

Regards,
Makis



Gerasimos Makis Defteraios

[MSN]
CaptainCasa

Power User
[Avatar]

Joined: 21/11/2007 12:23:06
Messages: 5519
Offline

Hi Makis,

you need to pass an implementation of CCComboFieldIdText.ILogic interface into the constructor method - this interface contains all the access functions you need to provide to make the control work - independent if it is inside or outside a grid.

For this interface there are two default implementations: LogicByLoadedList and LogicByResource (which internally extends LogicByLoadedList). Of course you may add any own implementation...

So: you can do somthing like the following:

Code:
 public class GridItem...
 {
     CCCOmboFieldIdText m_cfMedicine;
     ILogic m_logic;
     public GridItem()
     {
         m_logic = ...;
         m_cfMedicine = new ...(m_logic);
     }
     public String getCfMedicineId() { return m_logic.getId(); }
 }
 


Kind regards, Björn

PS: it's a pity that the page bean component does not offer a getter to its ILogic... ;-) - so, we just added this for the next update...

Björn Müller, CaptainCasa GmbH
 
Forum Index -> Development
Go to:   
Powered by JForum 2.1.6 © JForum Team