UIX/XML BC4J - Controlling page flow in event handlers

We have an event handler that executes some data processing using bc4j tags, and need to redirect the flow to another page, based on the value of some parameters. For example, we have a checkbox Prepare for another insert, and we want to check for its state in the event handler to determine which page to display.
We tried the following code
UIX page event handler:
<event name="saveEvent" >
     <bc4j:findRootAppModule name="TipoPunteggioViewAppModule" >
          <bc4j:findViewObject name="TipoPunteggioView" >
               <bc4j:findRow name="CreateTipoPunteggioView" >
                    <bc4j:setPageProperty name="keyTipoPunteggio" >
                         <bc4j:stringKey />
                    </bc4j:setPageProperty>
                    <bc4j:setAttribute name="FlgObsoleto" />
                    <bc4j:setAttribute name="Firma" />
                    <bc4j:setAttribute name="TitTipoPunteggio" />
                    <bc4j:insertRow/>
                    <bc4j:commit/>
                    <bc4j:executeQuery/>
                    <ctrl:method class="com.websiteitalia.valutazioni.handlers.Handlers"
                         method="anotherInsertEventHandler" />
               </bc4j:findRow>
          </bc4j:findViewObject>
     </bc4j:findRootAppModule>
</event>
Java method event handler:
public static EventResult anotherInsertEventHandler(BajaContext bCtx,
                                   Page page,
                                   PageEvent event) {
     // AnotherInsert is the name of the checkbox on the page
if ("on".equals(event.getParameter("AnotherInsert"))) {
          return new EventResult(page);
     } else {
          return new EventResult(new Page("ListPage"));
When we return the same page, things work fine, but when we return another page we get an ArrayIndexOutOfBoundException. We have also noticed that if we return a simple page, without data scopes and bc4j tags, we get the correct result. We are probably wrong in the manner we do the redirect inside of a java event handler, because seems that the page we return is not completely processed.
Can anyone explain the available techniques to control the page flow, using UIX XML tags or Java APIs alone or both of these together? For example, how can be replicated the <ctrl:go> behavior using Java APIs?

The UIX page works correctly if loaded directly, the error takes place only when we redirect in this manner from a page that has a different application module / view object scopes. In fact, when we redirect to a page that have the same scopes of the first (or when the second page has not scopes at all the simple page) the error doesnt occur. Thats why we suppose that some step of the page rendering process arent executed correctly, it seems that the new page still finds some of the old page (the scopes)..
To redirect to a page from a java event handler we have returned an event result with the next page (see above post for a code snippet), is this the correct way? Can we simulate the ctrl:go tag from the java code (with the redirect=true option)? There are any other?

Similar Messages

  • UIX XML BC4J Choice

    Adam, In a previous thread In cactus, it has problem to generate report you mentioned that in order to implement a Choice within UIX/XML/BC4J one would have to write some code to do it. Specifically,
    1. Implement the oracle.cabo.ui.data.DataObjectList interface to wrap up the results of a BC4J query ...
    2. Write a MethodDataProvider ....
    3. Access the Method and display the Choices.
    Can you JDEV guys post a WORKING example of how to do it?
    An "EDIT.UIX" page where the USER makes a selection from the drop-down-list (Choice) and then updates the record with that selection would be nice.
    Bill G...

    Beautiful!
    I'll will look at implementing this over the weekend. I made a decision to temporarily go with UIX-JSP since I did not know how to implement a "UIX XML BC4J Choice".
    Now that you've delivered it I should be able to convert some of my UIX-JSP apps to UIX/XML.
    Thank You Good Buddy! (Think truck driver accent)
    Bill G...

  • UIX-XML BC4J Question regarding event handling

    How can I use/access Application Module, defined in UIX-XML page (using <bc4j:registryDef>), in my event handler method ???

    Sorry for the confusion. I figured out what you were asking.
    The right way is this.
    First, in your UIX XML page, declare your handler like this:
    <event name="%myEvent%" >
    <bc4j:findRootAppModule name="%ModuleName%" >
    <method class="%eventclass%" method="%eventmethod%" />
    </bc4j:findRootAppModule>
    </event>
    the strings in the % have to be replaced with your own particular names. %ModuleName% should be the same as the name of the module in the registry.
    Then in the event handler %eventclass%.%eventmethod% you can use this to find the Application Module:
    oracle.jbo.ApplicationModule mymodule
    = oracle.cabo.data.servlet.bind.ServletBindingUtils.getApplicationModule(context);
    "context" is passed in to your event handler as a BajaContext. ServletBindingUtils has several other methods for getting BC4J stuff, you should look at its definition.
    Joe

  • UIX-XML BC4J - Unexpected errors using paths and DeltaTree on a particular UIX page

    We are using a PageDescription to dynamically change a UIX tree using the DeltaTree technique described in the Dynamic Structure for For UIX Pages chapter of the UIX Developers Guide.
    We search for a particular node using PathUtils.FindPathWithNodeID(RenderingContext context, UINode from, java.lang.String nodeID), but this fails when the page contains nested ViewObjectScopes.
    The method throws a NullPointerException, and the render fails:
    29/08/02 9.08 Valutazioni: java.lang.NullPointerException
         oracle.cabo.ui.data.DataObjectList oracle.cabo.ui.collection.DataObjectListNodeList.getDataObjectList(oracle.cabo.ui.RenderingContext)
         int oracle.cabo.ui.collection.DataObjectListNodeList.size(oracle.cabo.ui.RenderingContext)
         int oracle.cabo.ui.BaseUINode.getIndexedChildCount(oracle.cabo.ui.RenderingContext)
         boolean oracle.cabo.ui.path.PathUtils._findPath(oracle.cabo.ui.RenderingContext, oracle.cabo.ui.path.PathImpl, oracle.cabo.ui.UINode, oracle.cabo.ui.path.PathUtils$Finder)
         boolean oracle.cabo.ui.path.PathUtils._findPath(oracle.cabo.ui.RenderingContext, oracle.cabo.ui.path.PathImpl, oracle.cabo.ui.UINode, oracle.cabo.ui.path.PathUtils$Finder)
         boolean oracle.cabo.ui.path.PathUtils._findPath(oracle.cabo.ui.RenderingContext, oracle.cabo.ui.path.PathImpl, oracle.cabo.ui.UINode, oracle.cabo.ui.path.PathUtils$Finder)
         boolean oracle.cabo.ui.path.PathUtils._findPath(oracle.cabo.ui.RenderingContext, oracle.cabo.ui.path.PathImpl, oracle.cabo.ui.UINode, oracle.cabo.ui.path.PathUtils$Finder)
         boolean oracle.cabo.ui.path.PathUtils._findPath(oracle.cabo.ui.RenderingContext, oracle.cabo.ui.path.PathImpl, oracle.cabo.ui.UINode, oracle.cabo.ui.path.PathUtils$Finder)
         boolean oracle.cabo.ui.path.PathUtils._findPath(oracle.cabo.ui.RenderingContext, oracle.cabo.ui.path.PathImpl, oracle.cabo.ui.UINode, oracle.cabo.ui.path.PathUtils$Finder)
         boolean oracle.cabo.ui.path.PathUtils._findPath(oracle.cabo.ui.RenderingContext, oracle.cabo.ui.path.PathImpl, oracle.cabo.ui.UINode, oracle.cabo.ui.path.PathUtils$Finder)
         boolean oracle.cabo.ui.path.PathUtils._findPath(oracle.cabo.ui.RenderingContext, oracle.cabo.ui.path.PathImpl, oracle.cabo.ui.UINode, oracle.cabo.ui.path.PathUtils$Finder)
         boolean oracle.cabo.ui.path.PathUtils._findPath(oracle.cabo.ui.RenderingContext, oracle.cabo.ui.path.PathImpl, oracle.cabo.ui.UINode, oracle.cabo.ui.path.PathUtils$Finder)
         boolean oracle.cabo.ui.path.PathUtils._findPath(oracle.cabo.ui.RenderingContext, oracle.cabo.ui.path.PathImpl, oracle.cabo.ui.UINode, oracle.cabo.ui.path.PathUtils$Finder)
         boolean oracle.cabo.ui.path.PathUtils._findPath(oracle.cabo.ui.RenderingContext, oracle.cabo.ui.path.PathImpl, oracle.cabo.ui.UINode, oracle.cabo.ui.path.PathUtils$Finder)
         boolean oracle.cabo.ui.path.PathUtils._findPath(oracle.cabo.ui.RenderingContext, oracle.cabo.ui.path.PathImpl, oracle.cabo.ui.UINode, oracle.cabo.ui.path.PathUtils$Finder)
         oracle.cabo.ui.path.Path oracle.cabo.ui.path.PathUtils._findPath(oracle.cabo.ui.RenderingContext, oracle.cabo.ui.UINode, oracle.cabo.ui.path.PathUtils$Finder)
         oracle.cabo.ui.path.Path oracle.cabo.ui.path.PathUtils.findPathWithNodeID(oracle.cabo.ui.RenderingContext, oracle.cabo.ui.UINode, java.lang.String)
         oracle.cabo.ui.UINode com.websiteitalia.wsdk.uix.pageflow.PageFlowManager.getRootUINode()
         oracle.cabo.ui.UINode oracle.cabo.servlet.ui.UINodePageDescriptionProxy.getRootUINode()
         oracle.cabo.ui.UINode oracle.cabo.servlet.ui.UINodePageRenderer.getRootUINode(oracle.cabo.servlet.BajaContext, oracle.cabo.ui.RenderingContext, oracle.cabo.servlet.Page)
         oracle.cabo.ui.UINode oracle.cabo.servlet.ui.HTMLUINodePageRenderer.getRootUINode(oracle.cabo.servlet.BajaContext, oracle.cabo.ui.RenderingContext, oracle.cabo.servlet.Page)
         void oracle.cabo.servlet.ui.UINodePageRenderer.renderPage(oracle.cabo.servlet.BajaContext, oracle.cabo.servlet.Page)
         void oracle.cabo.servlet.AbstractPageBroker.renderPage(oracle.cabo.servlet.BajaContext, oracle.cabo.servlet.Page)
         oracle.cabo.servlet.Page oracle.cabo.servlet.PageBrokerHandler.handleRequest(oracle.cabo.servlet.BajaContext)
         void oracle.cabo.servlet.BajaServlet.doGet(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
         void javax.servlet.http.HttpServlet.service(com.evermind.server.http.EvermindHttpServletRequest, com.evermind.server.http.EvermindHttpServletResponse)
         void javax.servlet.http.HttpServlet.service(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
         void javax.servlet.http.HttpServlet.service(javax.servlet.ServletRequest, javax.servlet.ServletResponse)
         void com.evermind.server.http.ServletRequestDispatcher.invoke(javax.servlet.ServletRequest, javax.servlet.ServletResponse)
         void com.evermind.server.http.ServletRequestDispatcher.forwardInternal(javax.servlet.ServletRequest, javax.servlet.http.HttpServletResponse)
         boolean com.evermind.server.http.HttpRequestHandler.processRequest(com.evermind.server.ApplicationServerThread, com.evermind.server.http.EvermindHttpServletRequest, com.evermind.server.http.EvermindHttpServletResponse, java.io.InputStream, java.io.OutputStream, boolean)
         void com.evermind.server.http.HttpRequestHandler.run(java.lang.Thread)
         void com.evermind.util.ThreadPoolThread.run()
    We found the element of the UIX page that causes the problem:
    <bc4j:viewObjectScope name="ElementsView" >
    <contents>
         <bc4j:rowScope name="NewElement" >
         <contents>     
              <bc4j:region automatic="false" >
                   <bc4j:key>
                        <bc4j:rowKey name="keyElement"/>
                   </bc4j:key>
                   <contents>
                        <bc4j:attrScope name="FlgState">
                        <contents>
                             <messageChoice name="FlgState" prompt="State" >
                                  <boundAttribute name="selectedValue">
                                       <concat>
                                            <bc4j:attrProperty name="value"/>
                                            <fixed text=""/>
                                       </concat>
                                  </boundAttribute>
                                  <contents>
                                       <!-- This is the nested vo scope causing the error -->
                                       <bc4j:viewObjectScope name="DecodeStateView" >
                                       <contents data:childData="list@DecodeState">
                                            <option data:value="StateCode"
                                                 data:text="StateDescription"/>
                                       </contents>
                                       </bc4j:viewObjectScope>
                                  </contents>
                             </messageChoice>
                        </contents>
                        </bc4j:attrScope>
                   </contents>
              </bc4j:region>
         </contents>
         </bc4j:rowScope>
    </contents>
    </bc4j:viewObjectScope>
    This usage of nested view object scopes has been explained in reply of a previous post, How to databind the children of a UIX XML choice, and before ours attempts to modify the tree it worked fine. Removing the nested view object scope the page makes the page render correctly, but we need it to retrieve the description of its state.
    We get the same behaviour (and a much similar stack trace, with the same oracle.cabo.ui.data.DataObjectList oracle.cabo.ui.collection.DataObjectListNodeList.getDataObjectList (oracle.cabo.ui.RenderingContext) throwing a NullPointerException) if we use NodeUtils.createPreorderDescendentAttributeEnumeration method instead of PathUtils.

    It's a bug in the DataObjectListNodeList class that's up at the top of
    the stack. It's been fixed for 9.0.3. The bit of XML that's triggering
    it isn't the <viewObjectScope>s, but the "data:childData".
    I believe you can workaround this bug by not passing a null RenderingContext to
    findPathWithNodeID(). Now, you don't have a real RenderingContext, and we
    don't especially need one - "null" is legit here, but I think if
    you just pass "new oracle.cabo.ui.RootRenderingContext()" then you'll
    get around this bug.

  • UIX XML - BC4J +

    We are implementing a functionality to insert new elements using BC4J components and UIX XML.
    We have carefully followed istruction from the UIX developer's guide (Business Components for Java Integration) but we notice some problems
    that we suppose are due to RowDefs with autocreate=true and the KEY attribute management flow.
    The components implemented have:
    1) A create method implemented for setting entity primary key using a DB sequence and other default values:
         protected void create(AttributeList attributeList) {
              super.create(attributeList);
              SequenceImpl seq = new SequenceImpl("VA_TIPO_PUNTEGGIO_SEQ", getDBTransaction());
              setAttribute("IdTipoPunteggio", seq.getSequenceNumber());
              setDataAgg(new Date( new Timestamp(System.currentTimeMillis())));
    2) A validation rule that checks for duplicate description using a ListCompare:
    <ListValidationBean
    OnAttribute="TitTipoPunteggio"
    OperandType="SQL"
    Inverse="true"
    ListValue="select tit_tipo_punteggio from va_tipo_punteggio where id_tipo_punteggio &#60;&#62; %IdTipoPunteggio%" >
    </ListValidationBean>
    Our problems are:
    1) The ID taken from a DB Sequence are increased by 2 (this doesn't occur using test on application module), and we suppose that it happens because row isn't
    found using the correct KEY property.
    2) When the validation's rule is triggered, row data aren't reloaded
    UIX code for apply event is:
    <event name="saveEvent" >
         <bc4j:findRootAppModule name="TipoPunteggioViewAppModule" >
              <bc4j:findViewObject name="TipoPunteggioView" >
                   <bc4j:findRow name="newRow">
                        <bc4j:setPageProperty name="key" >
                             <bc4j:stringKey />
                        </bc4j:setPageProperty>
                        <bc4j:setAttribute name="IdTipoPunteggio" />
                        <bc4j:setAttribute name="TitTipoPunteggio" />
                        <bc4j:setAttribute name="FlgObsoleto" />
                        <bc4j:insertRow/>
                        <bc4j:commit/>
                        <bc4j:executeQuery/>
                        <ctrl:go redirect="true" name="Anagrafiche_TipiPunteggio"/>
                   </bc4j:findRow>
              </bc4j:findViewObject>
         </bc4j:findRootAppModule>
    </event>
    However we have doubts on the code flow because we suppose the following istruction are missing before the findRow tag:
    <bc4j:setPageProperty name="keyTipoPunteggio" >
         <bc4j:parameter name="keyTipoPunteggio"/>
    </bc4j:setPageProperty>
    otherwise what is the reason of the keyStamp tag declared on the region?
    Moreover we don't understand the purpose of these instructions:
    <bc4j:setPageProperty name="keyTipoPunteggio" >
         <bc4j:stringKey />
    </bc4j:setPageProperty>
    because when validation on the row occurs, data of the rejected row are not reloaded.
    Perhaps would be useful an HowTo or a detailed explanation of interaction between registryDefs and event handler tags.
    TIA

    Our problems are:
    1) The ID taken from a DB Sequence are increased by 2 (this doesn't occur using test on application module), and we suppose that it happens because row isn't found using the correct KEY property.This is correct.
    2) When the validation's rule is triggered, row data aren't reloaded
    UIX code for apply event is: <snip>
    Replace it with this:
    <event name="saveEvent" >
    <bc4j:findRootAppModule name="TipoPunteggioViewAppModule" >
    <bc4j:findViewObject name="TipoPunteggioView" >
    <bc4j:setPageProperty name="key" >
    <bc4j:parameter name="key" />
    </bc4j:setPageProperty>
    <bc4j:findRow name="newRow">
    <bc4j:setAttribute name="IdTipoPunteggio" />
    <bc4j:setAttribute name="TitTipoPunteggio" />
    <bc4j:setAttribute name="FlgObsoleto" />
    <bc4j:insertRow/>
    <bc4j:setPageProperty name="key" >
    <bc4j:stringKey />
    </bc4j:setPageProperty>
    <bc4j:commit/>
    <bc4j:executeQuery/>
    <ctrl:go redirect="true" name="Anagrafiche_TipiPunteggio"/>
    </bc4j:findRow>
    </bc4j:findViewObject>
    </bc4j:findRootAppModule>
    </event>
    The main issue is that the string representation of the key changes when the row is inserted into the view object. It is a "short" key before insert and a "long" key after insert. Also, "short" keys cannot be found by ViewObject APIs to locate rows when the key is still "short".
    Here is the flow:
    1. Create page is rendered, auto-creating a new row with "short" key.
    2. In apply event handler, we must set the page property based on the submitted key
    to find the same row. Unfortunately, the "short" key does not find the old row, so
    we end up creating a new one for this request (incrementing the sequence).
    3. We may get as far as inserting the new row, upgrading to a "long" key.
    4. So we update the page property after a successful insert to the new "long" key.
    5. We rerender the page and use the page property to find the row, most likely the "long" key.
    [Note: if an exception occurred during set attribute, before insert row, the key will still
              be "short"]
    6. Once we get as far as attempting insertRow, the key will become "long" and locatable by
    ViewObject APIs.
    You don't encounter this problem in the tester because it can keep an in-memory handle to the row it
    is trying to insert for the duration of the insert attempt.
    The web-based UI relies on key-based references instead, which have the issue outlined above.
    We will follow up on this to see if "short" keys can be located by ViewObject APIs in future, allowing
    the same reference to be found across requests.
    Regards,
    John Fallows.

  • UIX XML & BC4J Editable Tables

    How to process the changes on a bc4j table with editable columns (in UIX XML)?
    We can read the values, but when we try to update the view object, it occurs an error saying that the read value is not serializable.

    I think the problem is that you are not getting at the viewObject correctly in your eventHandler.
    First, in the uiXML file, the handler should be something like:
                <ctrl:handlers>
                  <ctrl:event name="..." >
                    <bc4j:findRootAppModule name="EmpAppModuleLocal" >
                      <bc4j:findViewObject name="AllEmpsVO" >
                        <ctrl:method class="yourClass"
                                     method="applyChanges"/>
                        <bc4j:commit/>
                      </bc4j:findViewObject>
                    </bc4j:findRootAppModule>
                  </ctrl:event>
                </ctrl:handlers>Then you can write your applyChanges method like this:
    public static EventResult applyChanges(BajaContext context,
                                           Page page,PageEvent event)
      ViewObject view = (ViewObject) context.getProperty(
                JboConstants.BC4J_NAMESPACE,
                JboConstants.VIEW_OBJECT_PROPERTY);
      view.getCurrentRow().setAttribute("Ename","Smith");
      return null;
    }Please see:
    http://otn.oracle.com/jdeveloper/help/topic?inOHW=true&file=jar%3Afile%3A/u01/webapps/OHW/ohw-app/jdeveloper/helpsets/jdeveloper/uix_devguide_ohj.jar!/bc4j.html&linkHelp=false#HandlingEvents
    http://otn.oracle.com/jdeveloper/help/topic?inOHW=true&file=jar%3Afile%3A/u01/webapps/OHW/ohw-app/jdeveloper/helpsets/jdeveloper/uixref.jar!/bc4j/findViewObject.html&linkHelp=false

  • UIX/XML - BC4J - " a strategic decision"

    I have read that you (Oracle JDev Team) suggest using, for new applications, UIX/XML and BC4J.
    We are engaging our best resources trying to use these frameworks but, due to poor documentation/samples, we are in serious difficulties.
    Every day some new problems rise.
    What do you suggest?
    - To wait for release 9.0.3 hoping to see a better product and well documented?
    - To participate to training courses hoping to find them in our country (Rome - Italy)?
    - To continue to solve a problem every day with your help hoping that they are a reasonable number?
    Excuse my poor English.
    TIA

    I have read that you (Oracle JDev Team) suggest using, for new applications, UIX/XML and BC4J.
    We are engaging our best resources trying to use these frameworks but, due to poor
    documentation/samples, we are in serious difficulties.
    Every day some new problems rise.
    What do you suggest?
    - To wait for release 9.0.3 hoping to see a better product and well documented?That's a tough one to answer: it depends on where you are in the development
    cycle, your schedule etc. 9.0.3 will definitely be an improvement - and these
    aren't technologies that will be going away, so there'll be ongoing improvements
    in the future.
    - To participate to training courses hoping to find them in our country (Rome - Italy)?I wouldn't personally know if those are available. Sorry. :(
    - To continue to solve a problem every day with your help hoping that they are a
    reasonable number?We'll continue to help! If you're running into problems because of inadequacies
    on our documentation, that's our fault, not yours. The questions here on OTN
    have been essential in figuring out the most significant holes in BC4J UIX XML,
    and I'm sure they'll continue to be.
    Excuse my poor English.Your English is pretty darn good. No apologies needed!

  • UIX XML BC4J  Calling custom and framework methods

    We are developing an application using BC4J and UIX XML.
    We would like to define field attributes, such as date formatting and labels, at business component-level, but those properties are bound to a locale setting. We do not want to duplicate this kind of settings for each end-user locale, whats the best way to obtain that? And UIX BC4J extension tags, like tables and region in automatic mode, will automatically use those settings?
    In BC4J components we can define custom methods to perform further processing, using UIX XML can we access those and other framework-provided interfaces, and how?

    automatic mode is just for quick demos. You cannot internationalize your application while using automatic mode.
    You will need to turn off automatic mode, and have bc4j:column beans in your table and databind the data to come from your resource bundles.

  • UIX/XML BC4J - Dynamic breadcrumbs

    We have a page that contain a dynamic breadcrumbs (stored in session) that is populated at runtime with the PageDescription class. We need to add the next element to session from a value of a BC4J views. How we can interact with the RegistryDefs from the PageDescription to do this?
    Anyone can explain the sequence of the rendering phase, especially when is executed the RegistryDefs and the DataBinding to interact with it from the PageDescription?

    We have implemented a class that extends the page description and must add the link to the breadcrumbs using a description of the current element displayed (for example if the page display information about an employee, its name and surname must appear on the breadcrumbs).
    To do this, we have used the procedure described in chapter 16 (dynamic structure for uix pages), subclassing the method getRootUINode: the problem encountered is that we need to use a view object to obtain the description of the link to be added to breadcrumbs, for example with this registry def:
    <bc4j:registryDef>
    <bc4j:rootAppModuleDef name="TipoPunteggioViewAppModule"
    defFullName="com.websiteitalia.valutazioni.modules.TipoPunteggioAppModule"
    configName="TipoPunteggioAppModuleLocal"
    releaseMode="stateful" >
    <bc4j:viewObjectDef name="TipoPunteggioView" >
    <bc4j:rowDef name="UpdateTipoPunteggioView" autoCreate="false" >
              <bc4j:propertyKey name="keyTipoPunteggio" />
    </bc4j:rowDef>
    </bc4j:viewObjectDef>
         <bc4j:viewObjectDef name="DecodeStatoView"/>
    </bc4j:rootAppModuleDef>
    </bc4j:registryDef>
    The servlet binding utils seems to be useful in event handler java code but not in PageDescription, because dosn't require the view name, but uses the view object currently scoped!
    How we can do?
    About the rendering process, it is useful an explanation of the sequence of method that are called from the invocation of the page to its visualization to the browser (sequence diagram?) with a summary of the data structure in memory and/or the classes that interact with it.
    For example I cant resolve this problem because I dont know when registry def is loaded, when can I interact with it in the processing phase and which classes are involved.

  • UIX XML & BC4J Templates

    I've tried to create an "appModuleScope" UIX template, to embed a bc4j:table and the wrapping viewObjectScope and appModuleScope.
    But when i'm trying to build the .uit page the compiler says:
    "Warning(19,44): listTemplate.uit: Parsing error, line 19, column 44: <appModuleScope> is not an understood child element.
    Check the syntax of its parent element!"
    Is it possible to use bc4j uix tags in UIX templates? If yes, what is the correct way to accomplish the task?
    The "bc4j:registryDef" section must be in the UIX template or in the UIX page?
    This is the source of listTemplate.uit:
    <?xml version="1.0" encoding="windows-1252"?>
    <templateDefinition xmlns="http://xmlns.oracle.com/uix/ui"
              xmlns:ui="http://xmlns.oracle.com/uix/ui"
              xmlns:data="http://xmlns.oracle.com/uix/ui"
              xmlns:bc4j="http://xmlns.oracle.com/uix/bc4j"
              xmlns:ctrl="http://xmlns.oracle.com/uix/controller"
              xmlns:html="http://www.w3.org/TR/REC-html40"
              targetNamespace="http://www.example.com/uix/templates"
              localName="listTemplate">
         <type base="bc4j:appModuleScope">
         </type>
         <content>
              <bc4j:appModuleScope name="QPMAppModule">
                   <contents>
                        <!-- this is a simple html
                        tag to print something on
                        the scope of appModule -->
                        <html:hr></html:hr>
                   </contents>
              </bc4j:appModuleScope>
         </content>
    </templateDefinition>
    And this is the source of a uix page using the template:
    <?xml version="1.0" encoding="windows-1252"?>
    <page xmlns="http://xmlns.oracle.com/uix/controller"
              xmlns:ui="http://xmlns.oracle.com/uix/ui"
              xmlns:ctrl="http://xmlns.oracle.com/uix/controller"
              xmlns:html="http://www.w3.org/TR/REC-html40"
              xmlns:bc4j="http://xmlns.oracle.com/uix/bc4j"
              xmlns:myTemplate="http://www.example.com/uix/templates">
         <templates xmlns="http://xmlns.oracle.com/uix/ui">
              <templateImport source="listTemplate.uit"/>
         </templates>
         <bc4j:registryDef>
              <bc4j:rootAppModuleDef name="QPMAppModule"
                        defFullName="com.example.QPMAppModule"
                        configName="QPMAppModuleLocal"
                        releaseMode="stateful">
                   <bc4j:viewObjectDef name="CommittenteView" rangeSize="10"/>
              </bc4j:rootAppModuleDef>
         </bc4j:registryDef>
         <content>
              <pageLayout xmlns="http://xmlns.oracle.com/uix/ui"
                        xmlns:data="http://xmlns.oracle.com/uix/ui"
                        title="BC4J Template Test">
                   <contents>
                        <myTemplate:listTemplate>
                        </myTemplate:listTemplate>
                   </contents>
              </pageLayout>
         </content>
    </page>

    I think the BC4J UIExtensions are correctly registered.
    This is the servlet element of my web.xml file (that has never been touched):
         <servlet>
    <servlet-name>uix</servlet-name>
    <servlet-class>oracle.cabo.servlet.BajaServlet</servlet-class>
    <init-param>
    <param-name>oracle.cabo.servlet.loggedInKey</param-name>
    <param-value>LoginHandler.isLoggedIn</param-value>
    </init-param>
    <init-param>
    <param-name>oracle.cabo.servlet.loginPage</param-name>
    <param-value>Login</param-value>
    </init-param>
    <init-param>
    <param-name>oracle.cabo.servlet.pageBroker</param-name>
    <param-value>oracle.cabo.servlet.xml.UIXPageBroker</param-value>
    </init-param>
    <init-param>
    <param-name>oracle.cabo.ui.UIExtensions</param-name>
    <param-value>oracle.cabo.data.jbo.ui.JboUIExtension</param-value>
    </init-param>
    <load-on-startup>1</load-on-startup>
    </servlet>

  • UIX/XML: checkBox controls

    I'm trying to use a databound checkBox on a form. In an event handler I'd like to retrieve the state of the checkBox, but it only has a value if it's checked. If the checkBox is unchecked I don't get the formaparameter of the checkBox at all.
    I used something like this:
    <form method="POST" name="mainForm">
    <contents>
    <checkBox selectedValue="ckbx@fti:data" value="Y" name="ckbx" id="ckbx">
    Since we use a generic eventhandler for a number of different pages to write the formparameters back to an XML document, we cant haredcode the handling of checkBoxes.
    Is there any way to get a formParameter for unchecked checkBoxes to an eventhandler ?
    If not this would make checkBoxes unusable for us and probably for many other applications as well.
    Thanks,
    Guido

    In HTML, an unchecked checkbox doesn't deliver any value. A lousy design choice,
    I think, but that's the way it is! So, one approach is to just treat the
    absence of the parameter as "not checked".
    Another approach is to use some onClick behavior. I think the following would work:
      <checkBox name="foo" onClick="document.someForm.fooValue = document.someForm.foo.checked ? 'y' : 'n'"/>
      <formValue name="fooValue"/>Tedious (and error-prone) to write and rewrite this, so I'd consider wrapping that up
    into a template.

  • UIX XML BC4J  Hidden Fields

    We have to put some hidden data for each table row, for example an id number, necessary for further processing. We have tried to use the following syntax inside a column:
    <bc4j:formValue name="Empno" attrName="Empno" />
    but this does not render any hidden field. With the following syntax, the hidden field is correctly rendered:
    <formValue name="Empno" >
         <boundAttribute name="value">
              <bc4j:attrProperty name="value" />
         </boundAttribute>
    </formValue>
    but it is very tedious... Is there another syntax available?
    How can I add an invisible column that contains these hidden fields?
    PS: Does it exist a way to tell the renderer to format the html output for debug purposes?

    There isn't actually a <bc4j:formValue> element. If you try checking the
    syntax of your UIX page, that should appear as an error. I'll see
    what I can do about getting one added, but: you could wrap up your
    tedious syntax in a little template, and save yourself a lot of typing.
    For nicely formatted output: in house, we have a handy debug version
    of the library that shows formatted output. There's no easy way to
    turn on this functionality in the library included with JDev. We hope
    to make this functionality easily accessible in 9.0.3.

  • UIX/XML BC4J  Retaining form values

    Whats the best way to retain form values in a UIX page when the user fires some action that makes it refresh? This is especially important in a master-detail page, where the user can for example modify some of the master data and navigate detail list before committing his changes (and therefore leaving that page).

    If you set the attribute values in the event handler before leaving the page, using releaseMode="stateful" or releaseMode="reserved", then these values should be available before when you return.
    Regards,
    John Fallows
    Oracle Corporation.

  • UIX/XML BC4J  Retaining multiple selection in tables

    We have a table with multiple selection, and we want the items to remain selected after the page refresh for some reason. Whats the cheapest way to obtain this?

    Data bind the selection attribute of multipleSelection to "someKey@ctrl:eventResult". Then in your event handler use an oracle.cabo.ui.data.ServletRequestDataSet and attach it to the event result, under the key "someKey".
    When the page is refreshed it should remember the multiple selection.
    Regards,
    John Fallows
    Oracle Corporation.

  • UIX/XML BC4J - Table row buttons

    We want to create a bc4j:table with several buttons for each row to handle user actions, such as remove, update, etc.
    We want to use these buttons to submit a form with row's data plus some other fields that will be entered by the user before taking the action.
    For example, consider the following scenario: the user has a field to specify a quantity value, and a table to select the product to buy. We need to place an add to cart button on each row of the table, whose effect is submitting the form with both the product id and quantity value.
    Different design choices cant be taken to get the job done, the app has to work this way.
    We need to call the function submitForm in the button onClick, but we dont know how to specify, with some parameters, the row where the action is taken.
    We cant use the following solution (suggested in another thread) because the form is not submitted.
    <button text=Add to Cart ctrl:event=add>
         <boundAttribute name=destination>
              <ctrl:pageURL name=ThisPage event=add>
                   <ctrl:parameters>
                        <ctrl:parameter key=addParam data:value=productId />
                   </ctrl:parameters>
              <ctrl:pageURL>
         </boundAttribute>
    <button>

    Different design choices cant be taken to get the job done, the app has to work this way.
    We need to call the function submitForm in the button onClick, but we dont know how to
    specify, with some parameters, the row where the action is taken.
    <button text="Add to Cart">
      <boundAttribute name="onClick">
        <concat>
          <fixed text="submitForm('yourFormName', 1, {event:'add', addParam:'"/>
          <dataObject select="productId"/>
          <fixed text="'}); return false;"/>
        </concat>
      </boundAttribute>
    </button>This'll submit the form, setting the event to "add" and an "addParam" to
    your productId. You'll need to make sure there's someplace in your form to put
    the "addParam"; that just means that inside of <form>'s contents, you should add:
      <formParameter name="addParam"/>

Maybe you are looking for

  • How can I turn off where every time I turn on iPad or mail it ask for password

    I Have the iPad 4, after last update I changed my Apple ID and password, but iCloud won't change the ID but it allowed the pw change so every time I turn on iPad or go to mail it wants the password. This is frustrating as I'm the only one on here. He

  • Invoking Openoffice calc through ABAP OLE Object

    I want to show the output of my ABAP process  through openoffice calc worksheet. I tried to invoke calc using ABAP OLE object. But even a blank calc sheet is not getting opened with the following statements. Type-pools: OLE2. TYPES: service_manager t

  • Exclusion of storage location from ATP

    Hi Gurus, Can anybody pls tell me how should i exclude a storage location from ATP check. Regards Kaisar

  • Need guidance to learn EWM

    Hi, I am trying to learn Extended Warehouse Management. I have IDES Ehp4, ECC 6.0 system. I have activated the Business Framework for Extended Warehouse Management. I have done those configurations necessary from ERP side. What do I need to do to Ins

  • New pioneer dvd drive, can i use to install tiger or is it a catch-22?

    what i am concerned about is a catch-22 type situation. i recently bought a pioneer dvd-110. currently i am on os 10.3.8. so i installed the verison of patchburn i needed for 10.3.8. (there are also versions of patchburn for jaguar and tiger as well)