on 07-06-2009 10:46 AM
Hi All,
I have a table and the columns of the table are created dynamically(assume I have Colum A & Column B).
The table cell editor is input field. On hitting enter on the input field of the column, I want to get the column name.
But I am getting com.sap.tc.webdynpro.services.exceptions.WDIllegalArgumentException: Parameter col not found.
Where am I going wrong?
In wdModify view I have the following lines of code
retString[] // this array contains the column header names
int j = retString.length;
for(int i=0;i<j;i++)
{
IWDAttributeInfo att_Adjust_value = wdContext.nodeFinalStockTons().getNodeInfo().addAttribute("att_Adjust_value"+i,"ddic:com.sap.dictionary.integer");
IWDAttributeInfo attrib_Adjust = wdContext.nodeFinalStockTons().getNodeInfo().getAttribute("att_Adjust_value "+i);
IWDTableColumn tabColumn_Adjust =(IWDTableColumn)view.createElement(IWDTableColumn.class,"ColumnAdjust"+i);
//Add caption to Column
IWDCaption Cap_Adjust = (IWDCaption)view.createElement(IWDCaption.class,"CapTonsAdjust"+i);
Cap_Adjust.setText(retString<i>);
tabColumn_Adjust.setHeader((IWDCaption)Cap_Adjust);
//Table cell editor is of type Input field
IWDInputField Input_Field_Adjust = (IWDInputField)view.createElement(IWDInputField.class,"Input_Field_Adjust"+i);
Input_field_Adjust.bindValue(attrib_Adjust);
tabColumn_Adjust.setTableCellEditor((IWDTableCellEditor)Input_Field_Adjust);
table_adjust =(IWDTable)view.getElement("AdjustTable" ); // get Table
table_adjust.addColumn(tabColumn_Adjust); //bind column
//Creating action
IPrivateFINAL_STOCK_View.WDActionEventHandler adjustActHandler= IPrivateFINAL_STOCK_View.WDActionEventHandler.ON_HIT_ENTER;
IWDAction genericEventAction=wdThis.wdCreateAction(adjustActHandler, "onActiononHitEnter");
wdThis.wdGetOnHitEnterAction();
genericEventAction.setEnabled(true);
IWDInputField inputField =
(IWDInputField)((IWDTableColumn)(table_adjust.getView().getElement("ColumnAdjust"i))).getView().getElement("Input_Field_Adjust"i);
inputField.setOnEnter(wdThis.wdGetHITAction());
inputField.mappingOfOnEnter().addSourceMapping("col",retString<i>); // source name, new name
}
public void onActionHitEnter(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent, java.lang.String col)
{
}
Edited by: Shilpa KG on Jul 6, 2009 11:47 AM
To get the column ID in the action handler for the input field's "onEnter" event, you have to add a parameter "col" to your action and action handler, and you have to define a parameter mapping like this:
IWDTableColumn column = ...;
inputField.mappingOfOnEnter().addParameter("col", column.getId()); /* use setString() in newer releases */
Armin
P.S: Please edit your message and put code-tags around your code.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi All,
Thanks for the reply.
My issue got solved.
colName = retString<i> ;
inputField.mappingOfOnEnter().addParameter("col",colName);
Regards,
Shilpa.
Edited by: Shilpa KG on Jul 7, 2009 8:57 AM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
// Table cell editor is of type Input field
IWDInputField Input_Field_Adjust = (IWDInputField)view.createElement(IWDInputField.class,"Input_Field_Adjust"+i);
Input_field_Adjust.bindValue(attrib_Adjust);
Input_Field_Adjust.setOnEnter(wdThis.wdGetOnHitEntertAction());
tabColumn_Adjust.setTableCellEditor((IWDTableCellEditor)Input_Field_Adjust);
table_adjust =(IWDTable)view.getElement("AdjustTable" ); // get Table
table_adjust.addColumn(tabColumn_Adjust); //bind column
Edited by: Jean Carlo Abreu on Jul 6, 2009 12:24 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You will have the line number displayed next to the error message "com.sap.tc.webdynpro.services.exceptions.WDIllegalArgumentException: Parameter col not found.
".
Could you check the line number and tell which line of code is that? That would be easy to find what is missing.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
82 | |
10 | |
10 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.