views:

396

answers:

5

I am following an article that explains how to use the ICustomAttributeDataHandler class.

I am creating a custom column for the inbox screen, but the problem is that the value I set for my custom attribute is not being reflected on the screen.

As a test I am changing the task name to "whoKnows". But this code is not effecting what is output on the screen:

ICustomAttributeRecordSet.setCustomAttributeValue(i, "taskName", "whoKnows");

(I am able to print debug lines from my custom class when the inbox is viewed, so I know my code is being run.)

Someone on the comments of that article wrote:

the user must call the "setCustomAttributesInQuery() method on the dataprovider passing in a string array of the custom attributes

...what does that meen? Could this be my problem?

thanks.

+1  A: 

Hi,

To be honest, I have already used Webtop, but just as an user. I found a post in the dm developer discussion group that can be useful, though:

For creating a custom column in the doclist you dont need to go through this complex procedures. You can use custom attribute datahandlers for this.

  1. First in your object list component xml file add your custom column definition in the "columns" tag. You can even add static columns instead of the documentum attributes.
  2. Now create a class which implements the ICustomAttributeDataHandler.
  3. Implement the default the methods getRequiredAttributes and the getData function.
  4. In getRequiredAttributes add attributes of the object that you are looking for.
  5. In your getdata method retrieve each row and then based on the attribute that you see, just set the value that you want to. 6) Finally define your class in the app.xml file

There is a section in WDK developement guide regarding ICustomAttribuetDataHandlers. Look for the topic named "Adding custom attributes to a datagrid".

I'm not sure if this is the final solution, but I hope it helps!

jbochi
A: 

This may be a non-issue, but based on your code, I can't tell if you're doing this:

ICustomAttributeRecordSet.setCustomAttributeValue(i, "taskName", "whoKnows");

or this:

ICustomAttributeRecordSet rs;
rs.setCustomAttributeValue(i, "taskName", "whoKnows");

You should be calling the setCustomAttributeValue method on the rs object instance, not on the interface.

Gabriel McAdams
Thanks, but I indeed am calling the method on the object instance.
joe
Can you provide more code? The code provided in the article works... We now have to figure out what the differences are in yours and theirs
Gabriel McAdams
A: 

Still working on the problem. I found that if I update the jsp page to explicitly call the custom column, the new data is retrieved. But I am still unable to use non existing custom attributes.

joe
A: 

To answer you question about setCustomAttributesInQuery()

every datagrid in WDK is backed by an underlying data provider. You can get this proivder by using the following code.

Datagrid datagrid = (Datagrid)getControl("doclist_grid",com.documentum.web.form.control.databound.Datagrid.class);
DataProvider dp = datagrid.getDataProvider();

Once you've done that, you can call

dp.setCustomAttributesInQuery(myArr);

I'm not actually sure if this is part of the solution to your problem, but you could try this and see where it gets you.

shsteimer
A: 

hi,

You have to configure the inbox component.

if using classic view, go to inboxlist component and add your custom attribute.

<column>
    <attribute>CustomAttributeName</attribute>
    <label>Custom Attribute Label</label>
    <visible>true</visible>
</column>

Your custom attribute has to be in a custom type that is a sub type of dmi_queue_item, because inboxlist shows only dmi_queue_item objects.

Hope this helps,

Regards, Tejas.