Topic
IC4NOTICE: developerWorks Community will be offline May 29-30, 2015 while we upgrade to the latest version of IBM Connections. For more information, read our upgrade FAQ.
3 replies Latest Post - ‏2013-02-21T14:37:06Z by maxmix
SystemAdmin
SystemAdmin
5842 Posts
ACCEPTED ANSWER

Pinned topic Custom field class modification

‏2013-02-14T10:22:36Z |
Hi,
We have one custom class to a field1 .
The field1 value list is displayed based on the data entered in field2.without entering the data in field2 the field1 value list shows zero results….logic is correct.
But when we are using the field1 in the Advanced search window the value list showing zero results.
I think we can display all records in the value list by modifying getlist method of field1 custom class when the Application is on List tab.
Any one can review the below code and tell me this will work out or not….

public class class2 extends class1

public class2(MboValue mbovalue) throws MXException, RemoteException
{
super(mbovalue);
}
public MboSetRemote getList() throws MXException, RemoteException
{
String abc = "com.app.pr.class2.getList()";
StringBuffer a1 = new StringBuffer();
if (this.Logger.isInfoEnabled())
{
this.Logger.info("com.app.pr.class2.getList() : Enter");
}
public MboSetRemote getList() throws MXException, RemoteException
{
if(app.getApp().equalsIgnoreCase("PR") && app.onListTab()){
MboSetRemote currentList=super.getList(nRow,attribute);
currentList.setWhere("SATUS='ACTIVE' and USERID is NOT NULL");
currentList.reset();
return currentList;
}
else

{

MboSetRemote currentList=super.getList(nRow,attribute);

----Code logic to display value list based on another field-----
}
Thanks.........................
Updated on 2013-02-21T14:37:06Z at 2013-02-21T14:37:06Z by maxmix
  • maxmix
    maxmix
    83 Posts
    ACCEPTED ANSWER

    Re: Custom field class modification

    ‏2013-02-15T14:45:25Z  in response to SystemAdmin
    hi,
    an even simpler, xml-only solution to your problem:
    The where of your class is put into a tabledomain and attached to field1.
    On the List tab and/or the advanced search you simply add the attribute and set inputmode="query".
    • SystemAdmin
      SystemAdmin
      5842 Posts
      ACCEPTED ANSWER

      Re: Custom field class modification

      ‏2013-02-18T06:19:24Z  in response to maxmix
      HI Maxmix

      This will not full fill the requirement.

      Actually the problem is:

      We have plantcode(field1) and supervisor(field2).

      Based on the plantcode we entered in field1 the supervisor field pulls the value list(means it displays only the persons who are located at plantcode we entered ).

      Without entering the plantcode the supervisor field value list shows zero results

      The custom class of the field supervisor is written in this way.............

      But when we are using this supervisor field in the advanced search window the value list shows zero results.
      so we want to modify this logic when the supervisor field is on Advanced search window.

      Let me know is there any way to customize the field when it was on the advanced search window.

      for example to customize the field value list when its was on the list tab we use the below code

      if(app.getApp().equalsIgnoreCase("PR") && app.onListTab())
      Is there any way same as above when field was on Advanced search window?

      any help would be greatly appreciated.......
      Thanks.
      • maxmix
        maxmix
        83 Posts
        ACCEPTED ANSWER

        Re: Custom field class modification

        ‏2013-02-21T14:37:06Z  in response to SystemAdmin
        Sorry, I do not know of such a flag for you to follow through w/that coding style.

        You are mosts likely handling this on an mbo level via mbo.getString("") while this will only work in the persistent world of MX.

        You seek help in the QBE part and that is an array or vector you'd need to parse, to see if the key plantcode has a value and insert it into your listwhere.

        Downside of this is (and to me makes this "solution" not worth pursuing) is the inability to determine whether or not you are in the advanced search or not, as the qbe list stays intact all the time.
        I'd give the domain a try, maybe in the default setup they are switching between the qbe and persistent modes according to the inputmode context your dialog is in, at least that's what I'd hope for.

        That said, I am sure that there is a solution to your use-case, however with the straws you provided I am somewhat at a loss:
        the variable app and the getListTab() procedure I know from the beans but I did not see/use them in the mbo context.
        How did you fetch it there? Or is this simply a mixup?