[Logo] OLD FORUM - Use new one: https://www.CaptainCasa.online/forum
  [Search] Search   [Recent Topics] Recent Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
getValidValue(String value) for ValidValuesBinding  XML
Forum Index -> Development
Author Message
levy

Power User

Joined: 12/03/2008 16:38:22
Messages: 308
Location: XpertCenter
Offline

Hi,

Sometimes I would have appreciated a method getValidValue(String value) for the ValidValuesBinding class that returns a ValidValue. Of course I could get the value by iterating, but this wouldn't be efficient. Perhaps you could provide it?

There is already a similar method: removeValidValue(java.lang.String value).

Regards, Daniel
[WWW]
CaptainCasa

Power User
[Avatar]

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

Hi,

the week seems to end with a request that is simple to fulfill for us...!
We will provide this method with the next update.

Thanks + regards!
Björn

Björn Müller, CaptainCasa GmbH
levy

Power User

Joined: 12/03/2008 16:38:22
Messages: 308
Location: XpertCenter
Offline

Hi,

I have tried out the new method getValidValueByName(...) and it doesn't work as I expected.

Could you check?

Regards, Daniel
[WWW]
CaptainCasa

Power User
[Avatar]

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

Hi,

hmmm the methods are:

Code:
     /**
      * Passes back valid value for corresponding value.
      */
     public ValidValue getValidValueByValue(String value)
     {
         for (ValidValue vv: m_validValues)
         {
             if (ValueManager.checkIfStringsAreEqual(value,vv.getValue()) == true)
             {
                 return vv;
             }
         }
         return null;
     }
     
     /**
      * Passes back valid value for corresponding name. In case of multiple values
      * having the same name, the first value will be returned.
      */
     public ValidValue getValidValueByName(String value)
     {
         for (ValidValue vv: m_validValues)
         {
             if (ValueManager.checkIfStringsAreEqual(value,vv.getText()) == true)
             {
                 return vv;
             }
         }
         return null;
     }
         
 


Are you calling the wrong one?

Regards, Björn

Björn Müller, CaptainCasa GmbH
levy

Power User

Joined: 12/03/2008 16:38:22
Messages: 308
Location: XpertCenter
Offline

Hi,

Yes, I used the wrong one. I overlooked the other method. Sorry for incovenience.

Regards, Daniel
[WWW]
 
Forum Index -> Development
Go to:   
Powered by JForum 2.1.6 © JForum Team