Dive into Oracle ADF

Send me a mail
 Dive into Oracle ADF   Click to see the XML version of this web page.   (Updated: 2/3/2008; 9:18:16 PM.)
Tips and tricks from Steve Muench on Oracle ADF Framework and JDeveloper IDE

Search blog with Google:
 

Search BC4J JavaDoc:
 

November 2005
Sun Mon Tue Wed Thu Fri Sat
    1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30      
Oct   Dec

Get Firefox!

Wednesday, November 02, 2005

A customer has a system where some master row has a view-linked detail that will either have one row or zero rows in it. He asked me how you could automatically create a detail row in the case that there wasn't one already there. We sat down and worked out the following code to implement the solution in an overridden processComponentEvents() method of his data page's DataForwardAction class:

  protected void processComponentEvents(DataActionContext ctx)
throws Exception  {
    super.processComponentEvents(ctx);
    DCBindingContainer bc = ctx.getBindingContainer();
    DCIteratorBinding iter = bc.findIteratorBinding("EmpView2Iterator");
/* if current row in detail iterator is null... */
    if (iter.getCurrentRow() == null) {
/* Invoke a "Create" action binding to create a blank one */
      ((JUCtrlActionBinding)bc.findCtrlBinding("Create")).invoke();
    }
  }

10:50:44 AM    



© Copyright 2008 Steve Muench.