A dynamic table based on run-time created view object -- please help!

Hello!
I'm trying to create a dynamic table based on an run-time created view object. All go ok, but table binding component take the first view/iterator state and don't reflect changes they have. Please, take a look:
1. At run-time the view is being replaced by new red-only one based on query in application module:
getQueryView().remove();
createViewObjectFromQueryStmt("QueryView", statement);
2. Page definition file contains an iterator (using iterator or methodIterator - doesn't matter) binding and table, which binds to the iterator, like:
<methodIterator id="distributeQuery1Iter" Binds="distributeQuery1.result"
DataControl="QueryServiceDataControl" RangeSize="10"/>
<table id="distributeQuery11" IterBinding="distributeQuery1Iter"/>
3. The page code uses <af:table>. But, if I use table binding (it's right) like this:
<af:table var="row" value="#{bindings.distributeQuery11.collectionModel}">
<af:forEach items="#{bindings.distributeQuery11.attributeDefs}" var="def">
the table will never changed (i.e. still show the first view instance).
When I tried to use iterator binding directly (it's bad and cannot provide all needed features unlike CollectionModel from table binding) I saw that table works!
(Code is somehing like:
<af:table var="row" value="#{bindings.myIterator.allRowsInRange}">
<af:forEach items="#{bindings.myIterator.attributeDefs}" var="def">
Why the table binding do not reflect changes in iterator? Or should I use different approach?
Thanks in advance!
Ilya.

I got it to work! I used a hybrid approach comprised of some of your code and some of Steve Muench's AcceessAppModuleInBackingBean example.
In the setBindings method, I execute an app module method that redefines the query, then I used your code to delete and recreate bindings and iterator:
public void setBindingContainer(DCBindingContainer bc) {
this.bindingContainer = bc;
rebuildVO();
The rebuildVO() method looks like the code you provided in your example:
private void rebuildVO() {
DCDataControl dc;
DispatchAppModule dApp;
DCBindingContainer bc;
DCIteratorBinding it;
OperationBinding operationBinding;
ViewObject vo;
DCControlBinding cb;
try {
bc = getBindingContainer();
dc = bc.findDataControl(DATACONTROL);
dApp = (DispatchAppModule)dc.getDataProvider();
// Execute App Module Method to rebuild VO based upon new SQL Statement.
dApp.setDispatchViewSQL();
vo = dApp.findViewObject(DYNAMIC_VIEW_NAME);
it = bc.findIteratorBinding(DYNAMIC_VO_ITER_NAME);
it.bindRowSetIterator(vo, true);
// logger.info("Remove value binding...");
cb = bc.findCtrlBinding(DYNAMIC_VIEW_NAME);
cb.getDCIteratorBinding().removeValueBinding(cb);
bc.removeControlBinding(cb);
// logger.info("Creating new value binding...");
FacesCtrlRangeBinding dynamicRangeBinding =
new FacesCtrlRangeBinding(null,
bc.findIteratorBinding(DYNAMIC_VO_ITER_NAME), null);
// logger.info("Add control binding...");
bc.addControlBinding(DYNAMIC_VIEW_NAME, dynamicRangeBinding);
} catch (Exception e) {
e.printStackTrace();
And my App Module method that redefines the view object looks like this:
public void setDispatchViewSQL() {
String SQL =
"begin ? := PK_BUsiNESS.F_GETDISPATCHVIEWSQL();end;";
CallableStatement st = null;
String ViewSQL = null;
try {
st = getDBTransaction().createCallableStatement(SQL,
DBTransaction.DEFAULT);
* Register the first bind parameter as our return value of type LONGVARCHAR
st.registerOutParameter(1, OracleTypes.LONGVARCHAR);
st.execute();
ViewSQL = ((OracleCallableStatement) st).getString(1);
findViewObject(DYNAMIC_VO_NAME).remove();
ViewObject vo = createViewObjectFromQueryStmt(DYNAMIC_VO_NAME, ViewSQL);
vo.executeQuery();
} catch (SQLException s) {
throw new JboException(s);
} finally {
try {
st.close();
} catch (SQLException s) {
s.printStackTrace();
When I run it I get my desired results. One thing I don't quite understand is why when the page is first rendered it shows the last set of records rather than the first. Now I have to figure out how to put navigation URLS in each of the table cells.
Thanks for your help; I would not have gotten this far without it,
Jeff

Similar Messages

  • Create view object from

    I create temporary table and I have to create view object and display data from that object. After that I have to delete temporary table.
    How to do it?
    Thanks!

    Check out the createViewObjectFromQueryStmt() method of the Application Module.
    See:
    http://www.oracle.com/technology/products/jdev/tips/muench/mostcommon/index.html#vo

  • No entry in table T001P when running time eval

    Hi,
    Can someone tell me, why this error occurs. "No entry in table T001P" when running time evaluation PT60. I checked his Infotype 1 and has the Personal Area/Subarea assigned.
    Thanks,
    Swarna.

    Hi,
    Please check these tables:
    V_001P_ALL
    V_503_AL
    Or try creating a blank entry in table T001P.
    Hope this helps,
    Reward points if helpful,
    Thank You,

  • Hide multiple rows in a dynamic table based on the row value.

    Hi,
    I need to hide multiple rows in a dynamic table based on the specific value of that row.
    I cant find the right expression to do that.
    please help

    Go to the Row Properties, and in the Visibility tab, you have "Show or hide based on an expression". You can use this to write an expression that resolves to true if the row should be hidden, false otherwise.
    Additionally, in the Matrix properties you should take a look at the filters section, perhaps you can achieve what you wish to achieve through there by removing the unnecessary rows instead of just hiding them.
    It's only so much I can help you with the limited information. If you require further help, please provide us with more information such as what data are you displaying, what's the criteria to hiding rows, etc...
    Regards
    Andrew Borg Cardona

  • TS3920 I have a problem after I lock my iphone or it is automatically locked , the time doesn't update. It just freezes at the last time of locking. Please help , it is iphone 5 running iOS7.1

    I have a problem after I lock my iphone or it is automatically locked , the time doesn't update. It just freezes at the last time of locking. Please help , it is iphone 5 running iOS7.1
    I check with my service provider as well as I synchronized with iTunes , changed time manually with the right time zone. Unfortunately the problem keeps showing

    Hi Courcoul
    Thanks for stepping by
    To tell the truth I forgot to mention that I already did what you said, even more I tried all "reset" options including:
    Reset all settings
    Erase All content and settings
    Reset Network settings
    Etc
    Even
    Reset location and Privacy
    It keeps showing the problem

  • Run time error '9' object variable or with bloch variable not set in WAD

    Iwas able to open the web application designer see some of the web tenplates that have done by me but now when i try to open any of the web templates its popping up me the msg Internal Error: No template standard property  . Run time error '9' object variable or with bloch variable not set
    What setting needs to be done
    Priya

    It got solved
    Wait until all the web items get loaded then own ur web template

  • Run-time error '91':object variable...

    Dear All Experts,
    When running an addon in VB6, I've got the error message : "run-time error '91' : object variable or with block variable not set". when clicking debug, the system highlighted with yellow line the code ' set oForm = oApplication.Forms.GetFormByTypeAndCount ("169", 1)
    What could be the possible cause of the error ? I have read this thread :
    https://forums.sdn.sap.com/click.jspa?searchID=7420237&messageID=952849
    but I actually did what suggested there. Please give advice. Thanks.
    Rgds,

    I managed to solve this question

  • Smartform run-time error 5825: object has been deleted

    While modifying a smartform, I keep on getting run-time error 5825 object has been deleted.
    (microsoft visual basic)
    I have already restarted sap gui, even deleted my smartform and started another.. it keeps on haunting me.
    Anybody an idea how to get rid of this error???

    Hi,
    Do you use MS Word 2007 as the ediitor for sapscript and smartforms? In this case you need the support packs specified in SAP note #1115157.  Make sure you have the satest SAPGUI patch also.
    You can switch to the old graphical editor via transaction I18N -> I18N Customizing -> MS Word as Editor.
    regards,
    Aidan

  • Create View Object programattically from XML input

    Hi,
    I have requirement to create view object from xml at run time in ADF application. is there any way to create view object dynamically in java program from xml?
    My requirement is to call a webservice and generate view object from the response of the web service call.
    Thanks

    I want to create view objects from different web services and the same will be available to the developer at the time of development. I don't want to create web service proxies for each of the web service. this will simplify the developers task to create proxy and data controls. the one thing developer has to do is select the service and base on the service the view objects will be created to develop pages accordingly.

  • How to DEBUG a function module running in background mode? Please help!

    Hi Experts,
       I am calling a function module in my ABAP code in background module using the following syntax:
      CALL FUNCTION 'YBBC2_CREATE_SNAPSHOT' IN BACKGROUND TASK
              TABLES
                itab_std_format_inv = itab_std_format_inv
                itab_snapshot_inv = itab_snapshot_inv.
            COMMIT WORK.
    If I put the breakpoint in the CALL FUNCTION line and execute the program, the debugger does not take me to the valled function module. This may be because I am running the function module as background task.
    I cannot comment this  "IN BACKGROUND TASK" statement as well since i am debugging in Quality system where I don't have change access.
    So how to DEBUG a function module running in background mode? Please help!
    Thanks
    Gopal

    Hi,
    You could try to use the following trick:
    (1) Put an endless loop into the coding of your function module where you want to start debugging, e.g.
      DATA:
        lx_exit_loop(1)     TYPE c.
      lx_exit_loop = ' '.
      DO.
        IF ( lx_exit_loop = 'X' ).
          EXIT.
        ENDIF.
      ENDDO.
    (2) Call your function module in background task
    (3) Call transaction SM50 and search for the background process.
    (3) Choose from menu Program/Mode -> Program -> Debugging
    Now you the debugger should bring you right to your endless loop. Set lx_loop_exit = 'X' in the debugger and continue (F5 or F6).
    <b>Reward points</b>
    Regards

  • I have changed default language in the program & have set Language & region in system preferences. My Word (Mac2011) keeps on changing the default language to US english every time I check. Please help!

    I have changed default language in the program & have set Language & region in system preferences. My Word (Mac2011) keeps on changing the default language to US english every time I check. Please help!

    If you're having trouble making changes to files that are inside your home folder (represented by a house icon in the sidebar of a Finder window), or if you can't get changes to the settings of an application to stick, then please see below.
    Back up all data.
    This procedure will unlock all your user files (not system files) and reset their ownership and access-control lists to the default. If you've set special values for those attributes on any of your files, they will be reverted. In that case, either stop here, or be prepared to recreate the settings if necessary. Do so only after verifying that those settings didn't cause the problem. If none of this is meaningful to you, you don't need to worry about it.
    I've tested these instructions only with the Safari web browser. If you use another browser, they may not work as described.
    Step 1
    If you have more than one user, and the one in question is not an administrator, then go to Step 2.
    Triple-click anywhere in the following line on this page to select it:
    { sudo chflags -R nouchg,nouappnd ~ $TMPDIR..; sudo chown -R $UID:staff ~ $_; sudo chmod -R u+rwX ~ $_; chmod -R -N ~ $_; } 2>&-
    Copy the selected text to the Clipboard by pressing the key combination command-C.
    Launch the built-in Terminal application in any of the following ways:
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
    ☞ Open LaunchPad. Click Utilities, then Terminal in the icon grid.
    Paste into the Terminal window (command-V). I've tested these instructions only with the Safari web browser. If you use another browser, you may have to press the return key after pasting.
    You'll be prompted for your login password. Nothing will be displayed when you type it. You may get a one-time warning to be careful. If you don’t have a login password, you’ll need to set one before you can run the command. If you see a message that your username "is not in the sudoers file," then you're not logged in as an administrator.
    The command may take a few minutes to run, or perhaps longer if you have literally millions of files in your home folder. Wait for a new line ending in a dollar sign ($) to appear, then quit Terminal.
    Step 2 (optional)
    Take this step only if you have trouble with Step 1, if you prefer not to take it, or if it doesn't solve the problem.
    Boot into Recovery. When the OS X Utilities screen appears, select
    Utilities ▹ Terminal
    from the menu bar. A Terminal window will open.
    In the Terminal window, type this:
    res
    Press the tab key. The partial command you typed will automatically be completed to this:
    resetpassword
    Press return. A Reset Password dialog will open. You’re not going to reset a password.
    In the dialog, select the startup volume ("Macintosh HD," unless you gave it a different name) if it's not already selected.
    Select your username from the menu labeled Select the user account if it's not already selected.
    Under Reset Home Directory Permissions and ACLs, click the Reset button.
    Select
     ▹ Restart
    from the menu bar.

  • How to bind UI control after having created view object

    Hi,
    I'm creating view object from an sql query
    vo = panelBinding.getApplication().getApplicationModule().createViewObjectFromQueryStmt("ViewObj", strSQL);
    and I want set model to a table
    table1.setModel((TableModel)panelBinding.bindUIControl("ViewObj", table1));
    but it doesn't work and shows null pointer exception

    Take a look at the static createAttributeListBinding() methods in JUTableBinding.
    Sascha

  • Creating View Objects at Runtime for Validation

    In Oracle® Application Development Framework
    Developer’s Guide For Forms/4GL Developers tutorial there is a topic about Creating View Objects at Runtime for Validation.
    Is there any sample code available for this topic?
    Please help
    Regards
    S Karar

    I have created a helper method . The code is given below
    protected ViewObject getValidationVO(String viewObjectDefName) {
    // Create a new name for the VO instance being used for validation
    String name = "Validation_" + viewObjectDefName.replace('.', '_');
    // Try to see if an instance of this name already exists
    ViewObject vo = getDBTransaction().getRootApplicationModule().findViewObject(name);
    // If it doesn't already exist, create it using the definition name
    if (vo == null) {
    vo = getDBTransaction().getRootApplicationModule().createViewObject(name,viewObjectDefName);
    return vo;
    // Validation_bc4j_project of type ApplicationModule not found
    and created a validation method.
    The code inside validation method is given below.
    public boolean validateAvgMr(Number data) {
    String batch_catg = getQuality();
    // Get the view object instance for validation
    ViewObject vo = getValidationVO("bc4j_project.v_sqc0150");
    if (getTestStage()=="DOLLOP" && getQuality()=="DECO")
    // Set it's bind variables (which it will typically have!)
    vo.setNamedWhereClauseParam("batch_catg","DECO");
    vo.executeQuery();
    Number dol_mr_lcl=(Number)vo.first().getAttribute("DolMrLclStd");
    setStdMrLcl(dol_mr_lcl);
    return true;
    return true;
    I have checked the validation view and it is returing value with the same bind variable value but is not returning any value when using inside this method validation.
    I have checked several times but can't find the fault in the code.
    Please help

  • Since up dating my Firefox I can not play any games on Facebook they all run very slow, can someone please help me with a solution.

    Since up dating my Firefox I can not play any games on Facebook they all run very slow, can someone please help me with a solution.It mainly seems to be with games.

    RE: "P.S. I  found it aggravating that I couldn't copy and paste text  here, it wanted me to insert as a link or an image, how do you insert plain  text?"
    I take it you tried using the "right click" menu?   That doesn't seem to work, as you noted, but, you should be able to paste text by pressing your CTRL key  and while holding it down, press the "V" letter  key.
    CTRL + C = COPY
    CTRL + X = CUT
    CTRL + V = PASTE
    HTH,
    Ortho_Fan

  • My iMac 27inch screen keeps going black but everything is still running in the background? please help

          My iMac 27inch screen keeps going black but everything is still running in the background? please help. I have read that apple are recalling 27inch iMacs....

    Hello @DesCherryBomb,
    I understand that you are having issues with your HP 2310m monitor going blank and/or flickering. I am providing you with some steps you can try below:
    Step 1. Unplug the power cord from the back of the monitor and the wall
    Step 2. Hold the power button down for at least one minute
    Step 3. Plug the power cord back into the monitor and then into the wall outlet (not a power bar or surge protector)
    Step 4. Press the Menu button on the monitor
    Step 5. Navigate to the Factory Reset option and select it
    If the above steps did not resolve your issue you can try the monitor on a computer or other device to see if the issue persists. Please call our technical support at 800-474-6836. If you live outside the US/Canada Region, please click the link below to get the support number for your region. http://www8.hp.com/us/en/contact-hp/ww-phone-assist.html
    Thank you for posting on the HP Forums. Have a great day!
    Please click the "Thumbs Up" on the bottom right of this post to say thank you if you appreciate the support I provide!
    Also be sure to mark my post as “Accept as Solution" if you feel my post solved your issue, it will help others who face the same challenge find the same solution.
    Dunidar
    I work on behalf of HP
    Find out a bit more about me by checking out my profile!
    "Customers don’t expect you to be perfect. They do expect you to fix things when they go wrong." ~ Donald Porter

Maybe you are looking for