how to add action link to column tag in component.xml
Best Answer
-
actionlink is not visible because you didn't provide required argument - objectId. The correct variant is:
<dmf:celltemplate field='r_object_id'>
<dmf:datagridRowTd nowrap="true" cssclass="doclistfilenamedatagrid">
<dmfx:actionlink action="versions" label="open" showifdisabled="true" showifinvalid="true">
<dmfx:argument name="objectId" datafield="r_object_id"/>
</dmfx:actionlink>
</dmf:datagridRowTd>
</dmf:celltemplate>
<dmf:celltemplate field='r_object_id'>
<dmf:datagridRowTd nowrap="true"
cssclass="doclistfilenamedatagrid">
<dmf:link onclick="showAllversion" label="open">
<dmf:argument name="rObjectid" value="r_object_id" />
</dmf:link>
</dmf:datagridRowTd>
</dmf:celltemplate>That's absolutely incorrect, to write so you should have define either a java-script function showAllversion and set runatclient tag's attrubite to true or method showAllversion in corresponding component and parse arguments by yourself.
0
Answers
-
<column>
<attribute>custom attribute</attribute>
<label>show all</label>
<visible>true</visible>
</column>That part of config just defines what attributes are visible for end-user, to implement you requirement you should edit corresponding jsp, smth. like:
<dmf:celltemplate field='custom_attribute'>
<dmf:datagridRowTd nowrap="true" cssclass="PropListValue doclistfilenamedatagrid">
<dmfx:actionlink action="my_action" datafield="custom_attribute">
<dmfx:argument name="arg1" datafield="column1"/>
<dmfx:argument name="arg2" datafield="column2"/>
</dmfx:actionlink>
</dmf:datagridRowTd>
</dmf:celltemplate>0 -
Thank you for lukng in my problem.
whn i apply actionlink tag i didnt get link in column value.
<dmf:celltemplate field='r_object_id'>
<dmf:datagridRowTd nowrap="true"
cssclass="doclistfilenamedatagrid">
<dmfx:actionlink action="versions" label="open">
<dmf:argument name="rObjectid" value="r_object_id" />
</dmfx:actionlink>
</dmf:datagridRowTd>
</dmf:celltemplate>
inspite of this if i use link tag i got link in column value
<dmf:celltemplate field='r_object_id'>
<dmf:datagridRowTd nowrap="true"
cssclass="doclistfilenamedatagrid">
<dmf:link onclick="showAllversion" label="open">
<dmf:argument name="rObjectid" value="r_object_id" />
</dmf:link>
</dmf:datagridRowTd>
</dmf:celltemplate>
but when i click on link it show wrong num of attribue error??
0 -
actionlink is not visible because you didn't provide required argument - objectId. The correct variant is:
<dmf:celltemplate field='r_object_id'>
<dmf:datagridRowTd nowrap="true" cssclass="doclistfilenamedatagrid">
<dmfx:actionlink action="versions" label="open" showifdisabled="true" showifinvalid="true">
<dmfx:argument name="objectId" datafield="r_object_id"/>
</dmfx:actionlink>
</dmf:datagridRowTd>
</dmf:celltemplate>
<dmf:celltemplate field='r_object_id'>
<dmf:datagridRowTd nowrap="true"
cssclass="doclistfilenamedatagrid">
<dmf:link onclick="showAllversion" label="open">
<dmf:argument name="rObjectid" value="r_object_id" />
</dmf:link>
</dmf:datagridRowTd>
</dmf:celltemplate>That's absolutely incorrect, to write so you should have define either a java-script function showAllversion and set runatclient tag's attrubite to true or method showAllversion in corresponding component and parse arguments by yourself.
0 -
Thank you it is working fine.
But that link option also working fine i have created a method showallversion in respective behaviour class of component
and from that class i call component by setcomponentjump() method
0 -
I want this action link visible only when document has version for that i write precondition...
Precondition is working fine But action link are visible in every case wether has version or not juz for the document has no version action link visible but inactive...
do u know solution for to inc=visible the link in such case?
0 -
Post your code, both jsp and precondition
0 -
my component in which i write action defination
<action id="showallversions">
<params>
<param name="objectId" required="true"/>
</params>
<preconditions>
<precondition class="com.HasVersionsPrecondition">
</precondition>
</preconditions>
<execution class="com.documentum.web.formext.action.LaunchComponent">
<component>showallversions</component>
<container>Downloadversions</container>
</execution>
</action>
and jsp is
<dmf:celltemplate field='r_object_id'>
<dmf:datagridRowTd nowrap="true" cssclass="doclistfilenamedatagrid">
<dmfx:actionlink action="showallversions" label="open" showifdisabled="true" showifinvalid="true" >
<dmfx:argument name="objectId" datafield="r_object_id"/>
</dmfx:actionlink>
</dmf:datagridRowTd>
</dmf:celltemplate>
and
package com.precondition;
public class HasVersionsPrecondition implements IActionPrecondition{
public String[] getRequiredParams() {
// TODO Auto-generated method stub
return null;
}
public boolean queryExecute(String strAction, IConfigElement config, ArgumentList arg, Context context, Component component)
{IDfCollection co=null;
System.out.println("has version precondition");
boolean flag=true;
String objectid=arg.get("objectId");
System.out.println(objectid);
IDfQuery query = new DfClientX().getQuery();
query.setDQL("select r_version_label from dm_document where r_object_id='"+objectid+"'");
try {
co = query.execute(component.getDfSession(), 0 );
while(co.next()){
String version=co.getString("r_version_label");
System.out.println(version);
if(version.equalsIgnoreCase("1.0")){
flag= false;
}
}
}catch (DfException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
System.out.println("flag"+flag);
return flag;
}
}
It give output like
inspite of this i want to invisible those link which are disable.
0 -
What do you mean under "link is visible"? Is it visible but disabled (you can't click on it)? If so set showifdisabled="false" in jsp.
0 -
so if i want to hide the link if no version are available (hide those onle which are inactive) so what should i do??
0 -
<dmf:celltemplate field='r_object_id'>
<dmf:datagridRowTd nowrap="true" cssclass="doclistfilenamedatagrid">
<dmfx:actionlink action="showallversions" label="open" showifdisabled="false" showifinvalid="false" >
<dmfx:argument name="objectId" datafield="r_object_id"/>
</dmfx:actionlink>
</dmf:datagridRowTd>
</dmf:celltemplate>
0
Categories
- All Categories
- 107 Developer Announcements
- 53 Articles
- 104 General Questions
- 141 IM Services
- 43 OpenText Hackathon
- 32 Developer Tools
- 20.6K Analytics
- 4.1K AppWorks
- 8.9K Extended ECM
- 898 Cloud Fax and Notifications
- 76 Digital Asset Management
- 9.3K Documentum
- 29 eDOCS
- 118 Exstream
- 39.8K TeamSite
- 1.7K Web Experience Management