on 11-04-2011 7:31 AM
HI,
I have he following requirement:
In the Leave approval application , in the Approver worklist we have the coloumn to display the resuqester's Perner.
The perner starts with leading zeros. We have to remove these leading zeros.
I have refer the following threads:
and wiki document:
but I am not able to create the calculated attribute in the Mapped Node( NWDS is not allowing indicating it is not allowed for mapped nodes.)
Any pointer how I can remove leading Zeros from existing column?
If I create the calculated attribute outside the mapped node then it is taking only the first value of the mapped node.
Please note we do not want to modify the RFC.
_vishal
Create context node under your target node with cardinality 1..1 and singlton = false and creat calculated attributes under that new node
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Thanks for inputs,
Now I created a test application where the original structure is as follows in the View Controller:
1) Context -> Z_Portal_Test_Input (mapped Node/folder) -> IT_Tab_Input(mapped Node/folder) -> Eid(Mapped attribute)
note: this attribute Eid has the values (01, 02,03,04,05)
2)Context -> Z_Portal_Test_Input (mapped Node/folder) -> Output(mapped Node/folder) ->IT_Tab_Input(mapped Node/folder) -> Eid(Mapped attribute)
Now as per your suggestion I created another node like this
Context -> Z_Portal_Test_Input (mapped Node/folder) ->testnode(value node) ->testValue(value attribute)
testnode cardinality is 1..1 and singlton = false
In the Layout
The tablecell editor of one coloumn is mapped to text Z_Portal_Test_Input.testnode.testvalue
It is expected that this will show the values like(1,2,3,4,5) but it is showing value(1,1,1,1,1)
The code of get method is:
public java.lang.String getTestnodeTestvalue(IPrivateTestpernerView.ITestnodeElement element)
{
//@@begin getTestnodeTestvalue(IPrivateTestpernerView.ITestnodeElement)
String msg =wdContext.nodeZ_Portal_Test_Input().nodeOutput().nodeIt_Itab().currentIt_ItabElement().getEid();
return removeLeadingZeroes(msg);
//@@end
}
the functon removeLeadingZeroes(msg) is implemented as per the wiki link.
What wrong I am doing/ missing....
_vishal
It obviously fails because you're not using the ITestnodeElement element argument from the calculated attribute, but instead you used the current lead selection (which in your case has value 1).
In your declared method, you need to use something like:
String msg = ((It_ItabElement)element.node().getParentElement()).getEid()
Hope this explains
Robin
I was merely using it as an example, as I thought you would be able to figure out the exact code yourself
However, what I meant was the element argument being the child element of the element which holds the value you need to trim, you thus need to refer to the parent element of this child element
So,
element.node().getParentElement()
gives you the parent IWDNodeElement, and you need to cast it to the proper type -- I thought it was IIt_ItabElement, but should be the parent element of course -- so you could retrieve the value of Eid:
((IWhateverParentElementYouHave)element.node().getParentElement()).getEid()
User | Count |
---|---|
92 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.