ADF in the house - some tricks for solving common issues, Part I
Well,
after we solved the first issues that arised with our new ADF Framework, we're on track -> with building demo app*s for our ct*s.
A common problem, well known from BC4J development, is about having VO*s for navigation - and use the same definitions, but different instances of them for updating records.
Imagine the following:
When you looked into to ADF Tutorials on OTN there's a nice one, describing how to create an Edit form, with the setCurrentRowWithKey Action Forward.
This action foward does "nothing" more then finding the row you choose with the findByKey method (of oracle.jbo.ViewObject) and sets it current in the VO, the iterator you use is based on. So what's the trick to get this done?
From the UIModel the page uses - this is the setCurrentRowWithKey Action-Binding:
<DCControl
id="setCurrentRowWithKey"
SubType="DCMethodAction"
IterBinding="DepartmentsView1Iterator"
Action="999"
RequiresUpdateModel="true"
DataControl="HRModuleDataControl"
InstanceName="DepartmentsView1Iterator"
MethodName="setCurrentRowWithKey"
ReturnName="HRModuleDataControl.methodResults.setCurrentRowWithKey"
IsLocalObjectReference="true" >
<Contents>
<NamedData
NDName="Arg0"
NDType="java.lang.String"
NDOption="2"
NDValue="%null%" >
</NamedData>
</Contents>
</DCControl>
- So when using this action forward, what's happening?
So the trick to get the row current in another VO, is just creating a new IteratorBinding in your UIModel, that points to the VO instance you want to have the row the current one, and change the InstanceName to this new Iterator, and voila it's done.
Btw. just wanted to thank Steve, our fellow PM for BC4J and other stuff, for explaining me some in depth issues, how our binding model works, that helped for this article :-)
Having questions? Feedback me on this entry ADF in the house, tips 'n' tricks
0 Comments:
Post a Comment
<< Home