Order JDAPI and < SOLVED > block

Hi all

I'm running on the following problem, while the migration of some forms of 6i to 10g with JDAPI: the old game of forms points reference for example blocks of a form that has been stored in the database. I'm changing the forms to reference the same elements of the form that is stored in the file system. The problem is that when I rereference a block (using the method block.setSubclassParent ()) the newly subclassed block is moved to the first position in the block list causing the form to behave unexpectedly.

The problem is easy to fix manually by opening the form in report designer and to move the block newly referenced at the end of the list, but I have a lot of modules to migrate so I was wondering if there is a way to do it using JDAPI? I tried to test the destroy() method, but do not appear to make much progress.

Any ideas?
Laurent

Published by: Laurent Warnett Sep 10, 2008 12:15

Of JDAPI Javadoc:

move

Public Sub move (JdapiObject next)

Rearranges an object with respect to its siblings in the collection it belongs. This is similar to by dragging and dropping in the form of movement of a block Builder in a list. This method is a way to do the same thing programmatically. By example, if you want a block appear immediately before Block5 in a list, you pass the object representing Block5 nextObject argument.

Pass NULL to this method to move the object to the end of the list. If the specified object and the next_object do not share the same owner, or do not have the same type, the method throws an exception.

You cannot use this method to move objects between the parents. For example, it cannot be used to move an element from one block to the next. If you want to move an object from one parent to the other, you will have to do something like:

.. and so on...

Specified by:
move through the JdapiObject interface

Parameters:
nextObject - the object that the object specified must be moved.
Throws:
JdapiException - if you try to move an object next to an object that does not share the same owner or not is not the samme type.

So it would be:

FormModule Test = FormModule.open("c:\test.fmb");
JdapiIterator lBlocksIterator = Test.getBlocks();
while(lBlocksIterator.hasNext())
{

  Block lCurrBlock = (Block) lBlocksIterator.next();
  if(some_cirteria)
    lCurrBlock.move(null); //move it to the last position

}

I have not try, but give it a go...

Tags: Oracle Development

Similar Questions

Maybe you are looking for