[ADF, JDev12.1.3] Attribute Transient VO be calculated in different ways as a var pageFlowScope: how?

Hallo,

I have a jspx page that contains an af:table (created from an instance of VO) and search (built-by-me) form containing a lot of search filters.

The request of the VO should be composed dynamically based on the values of the search filters then in the managed bean that is associated with the page, I use this approach to create and run the query that fills the af: table:

    ArrayList<Object> queryParams = new ArrayList<Object>();
    StringBuilder query = new StringBuilder();
    BindingContext bctx = BindingContext.getCurrent();
    BindingContainer bindings = bctx.getCurrentBindingsEntry();
    DCIteratorBinding iteratorBind = (DCIteratorBinding) bindings.get("SearchItems1Iterator");
    ViewObject vo = iteratorBind.getViewObject();
    query.append("Select Field1, Field2, ..., FiledX from Table");
    /*
      Here I build the SQL of the query and the list of params in function of the filters, of session vars and of pageFlowScope vars
    */
    MyUtilsClass.modifyQueryDynamically((SearchItemsVOImpl) vo, query.toString());
    vo.setWhereClauseParams(queryParams.toArray());
    vo.executeQuery();


In the t, I defined a transitory attribute that must be calculated in 2 different ways according to a var. pagepageFlowScope

Calculation of transient attribute in the definition of VO by an expression Groovy does not help because 1) should be able to read the value of pagepageFlowScope var or 2) in the managed bean should I be able to change the Groovy used to calc the attribute expression.

But I don't know if and how it is possible to do these things

Also calculate the value in the getMyTransientAttribute() of the VORowImpl class method helped me because I should pass the pageFlowScope var to the method somehow that I don't know.

You kindly suggest me a method to solve this problem?

Thank you

Federico

You can't build the query in the way in which you want to calculate the transient attribute?

Then, you don't need to change anything.

Timo

Tags: Java

Similar Questions

  • [ADF, JDev12.1.3] Attribute of EO: uncheck the required box does not reflect on VO (here, it is necessary to change the prop in the bat VO XML). Why?

    Hallo,

    I noticed that when in an OE I uncheck the required box for a field...

    ... do not reflect the changes on the ground of the VO...

    As in the definitions of the VO, the check box is cleared, the only way to make the non-mandatory field is manually change the scope of the definition XML VO...

    I would like if this approach is normal.

    Thank you

    Federico

    I can reproduce this behavior. Fortunately, it is only a display bug. When you run the application the object entity attribute cancels the incorrectly set required field of the VO.

    A user may be confused by this setting, even if it is only a Visual problem, I will file a bug on the ADFEMG issue tracker. WARNING: this incident handler has no attached SLA. If you need a patch for this that you must file a SR with support.oracle.com (paid the necessary support contract).

    Timo

  • [ADF, JDev12.1.3] Plating of workflow that can function as 'serch &amp; open' and 'create '? How to build?

    Hallo,

    in a stubborn workflow, I have a fragment of Details as you can see here...

    And it is the working group...

    Then dynamic region is contained within the page that has a menu.

    Each menu item has action = "#{viewScope.mainDynamicRegion.startBoundedTaskFlowX}". "

    The bean maniDynamicRegion I have a lot of functions, each for each menu item, like this:

    public String startBoundedTaskFlowX() {}

    taskFlowId = "/WEB-INF/btf-X.xml#btf-X";

    Returns a null value.

    }

    End of details

    I would like to have 2 menu items for the btf above: one as 'research and details open' and onoter like 'create new details '.

    When I click on "search...". "a search form should appear, the user selects a folder, then click on 'Open' and finally appears my fragment 'details' showing the desired folder.

    Of course I have now that I'll have to add a new snippet to search for the folder desired to open

    When I click "create...". "my fragment displays the master desired folder should appear. Af: form in the 1st tab must be ready to be filled.

    You kindly could help me to complete the stubborn workflow? What components do I use?

    How can I let know the stubborn workflow what mode should work (research & open or create)?

    Is there something in particular, I have to take care of?

    Thank you very much

    Federico

    Hi Federico

    You can do this by using a BTF or two

    So, using only a BTF you can do the following:

    1. create an inputPram in your BTF who receives a value if the application is called from the search menu or create (set its value to S (Search) and C (Create))

    2 use a router to check if BTF is called from the search menu, then he should go to the search page

    3. and if it is called in Menu create then they should goto createPage drirectly and in the range of the router and createPage createInsert (for the first tab) operating as a method in taskFlow, so it will show a folder created in the first tab

    See -task using flow router in Oracle ADF - YouTube activity

    Thank you

  • [ADF, JDev12.1.3] (I need some advice on the 1) using panelHeader/box of 2) how achieve a specific layout

    Hallo,

    I create a page in which there are many 'af:form + af:table' groups (each group reads a VO istance).

    I would like to know if, in my case, I use it to group the CIU, panelBoxes or panelHeaders, and which of them would be advised.

    I would like that it is easy to install for all conatiners the same width.

    In addition, I would like to only 2 groups are always visible while others should be no in a space (just a panelGroupLayout?) with a vertical scroll bar.

    You could you kindly help me in achieving this layout?

    Thank you

    Federico

    PanelBox can be reduced by the user, well, can't panelHeader.

    As for scrolling, you can probably surround other sections with a panelGroupLayout and set layout = "scroll".

    Dario

  • [ADF, JDev12.1.3] Which is the best way to define the properties of CIU/fragments of pages. Is the approach that I have used a good choice (for a beginner)?

    Hallo,

    in my app, that I have a lot of pages and fragments in which properties (for example rendered text, disabled, Selected,...), lots of user interface components must be set, before/when the page is displayed, depending on the session and pageFlow scope attributes.

    So far I have created for each page/one backingBean brought bean fragment in which I defined an attribute for each property defined (e.g. 2 properties for each UIC: UIC is 10...) "I have 20 attributes to manage in the bean).

    Then, I linked each attribute of the bean to the respective UIC property. You can see in this my thread (unfortunately without answers ) [ADF, JDev12.1.3] backingBean bean: a lot of properties to set for lots of CIU... is better by using the properties of the binding or access code (created by ID) UIC? a small example. I put the attributes the bean Builder (or in a function of 'action' if the APP properties must be set based on the interaction of the user).

    I would like to know:

    • If it is a good approach / recommended / safe or if there is a better way;
    • If the scope backingBean is OK, or if a larger scope would be better.

    As I asked in the thread in the link above, the situation can become difficult to manage if the PPP for which setting, properties are very different.

    So I'd like if there is no alternative that I can use to get the same result with less effort.

    For example, using the class ComponentReference or invokeOnComponentAPI could simplify my life? And their use could I always use backingBean brought beans?

    Thank you

    Federico

    Federico, please understand that this forum has no sla. I have other work to do, who pays my bills. I will do my best to help, but you can not expect the instant replay.

    (1) you must not use the bean to init your beans. You can delay load or init your beans instead.

    (2) as Frank and says you can use a bean to view range and use it to make your calculations as long as you know how their parameters go to the btf

    (3) you should always use the reference of the component if you bind a component to a bean. Make a habit of all scopes.

    As we do not know how you calculate the State and how often it changes while the Working Group is on the page, it is difficult to give further advice.

    Timo

  • How to set the order in the table in the ADF for a transitional attribute in the default sort t

    Guys,

    I have a VO with 2 columns, the column is transitional attribute.  In my jsff page, I got an af:table that displays the transition attribute.

    When the page is loaded for the first time, by default, transitional attribute values should be sorted in ascending order. Currently, the displayed values are not sorted. I need to click the sort button to sort the values. I need to change this behavior to sort automatically when the page is displayed for the first time.

    Question: How can I set the command to the table in the ADF for a transitional attribute of default sort?

    Note: I have to pragmatically, I can't use order by clause in my VO for the transitional attribute.

    Help, please.

    Thank you

    Rambaud

    Hi Rambaud,

    You can do the sorting "in memory".

    You can implement it like this:

    Get the VO and make sure that all required lines are extracted from the DB

    ....

    Sort the rows by transient attribute

    myVO.setSortBy ("TransientAttribute");

    read the current query mode

    int oldQueryMode = myVO.getQueryMode ();

    to sort in memory

    myVO.setQueryMode (ViewObject.QUERY_MODE_SCAN_VIEW_ROWS);

    myVO.executeQuery ();

    redefine the query mode on original value (only needed if you want to be able to get new lines of the DB)

    deadlineVO.setQueryMode (oldQueryMode);

    I hope this helps.

    Kind regards

    Linda

  • [ADF, JDev12.1.3] How to get the column headers, request of VO and VO bind vars used by an af:table?

    Hallo,

    I want to create a method that takes as a parameter the id of an af:table (used to display the search results) and returns:

    • the column headings of the af: table
    • Visible property (true/false) of the columns af:table
    • the actual query of the VO instance used to create the af: table
    • the values of real bind variables passed to the query of the instance of VO

    I would like to create a servlet which takes the parameters reruns the query and returns a report Excel/PDF file that contains exactly the same columns and same of the af records: table.

    I'm a little confused on who use the code to achieve this... you kindly help me?

    I did a similar qustion here Re: [ADF, JDev12.1.3] how to export an af:table to Excel in an ADF Essentials application? but then I guessed that it was preferable to create a new thread.

    Thank you

    Federico

    For this, you can use this type of code

    Context LocaleContext = _adfTableBinding.getLocaleContext ();

    for (attr AttributeDef: attributeDef) {}

    Label As String = attr.getUIHelper () .getLabel (context);

    _logger.info ("Attritbute name:" + attr.getName () + "column name:" + attr.getColumnName () + "Col4Query name:" + attr.getColumnNameForQuery () +)

    "Name:"+ label);

    }

    which produces this output

    Timo

  • [ADF, JDev12.1.3] When you use create/restoreSavepoint... Restore operation is still useful? And other doubts...

    Hallo,

    Dario and Timo advised me (in this thread Re: [ADF, JDev12.1.3] Master w/playback af:form only af:tables detail: how to handle insert and edit through forms?) I make a request using the functions create/restoreSavpoint to this fragment in my application.

    The tables are read-only, and the user can insert and modify records by a form of popup.

    Each table has its own pop-up that I created using a btf executed as diaolog (*).

    Before I open the popup, I create the backup point.

    BindingContext bctx = BindingContext.getCurrent();  
    DCDataControl dcDataControl = bctx.getDefaultDataControl();  
    String sph = (String) dcDataControl.createSavepoint();  
    AdfFacesContext.getCurrentInstance().getPageFlowScope().put("AdfmSavePoint", sph); 
    

    When the popup is closed, I restore the backup point if the Cancel button was clicked...

    Object confirmOrCancel = returnEvent.getReturnValue();  
    if (((String) confirmOrCancel).equals("cancel")) {  
      String sph = (String) AdfFacesContext.getCurrentInstance().getPageFlowScope().get("AdfmSavePoint");  
      BindingContext bctx = BindingContext.getCurrent();  
      DCDataControl dcDataControl = bctx.getDefaultDataControl();  
      dcDataControl.restoreSavepoint(sph);  
    } 
    

    I have these doubts:

    1. the button "CANCEL ALL" (so far) AM restore operation is still meaningful (is always useful) when you use the check points? Or can I avoid using the restore of the AM operation, creating a backup point before you enter the fragment and restore it if the user clicks on "RESTORE ALL"?
    2. for all tables: before opening the popup insert/change the backup point is implemented pageFlowScope under the same key 'AdfmSavePoint '. Is it OK or would it be better to use a different key for each table (for example 'AdfmSavePointTable1', 'AdfmSavePointTable2',...)?
    3. If the pageFlowScope already contains a checkpoint under the "AdfmSavePoint" key... What does if I give the floor to new .put ("AdfmSavePoint", sph)? Can I be sure that the old value is overwritten?
    4. is this safe with nested savepoint? For example in my case I want to create a backup before the fragment in the image point is displayed (and restore if the user leaves the fragment by clicking "RESTORE ALL"), then within the fragment, as I said above, I would manage other points of record when inserting/editing tables.
    5. I noticed that clicking on the button "RESTORE ALL" when it relates to the AM-restore operation causes this strange thing: when before displaying the fragment I call SetCurrentRowWithKey on the master istance VO... If I click on "ROLLBACK ALL" posted master VO Records changes and 1 minutes of the main of the VO table is displayed. Why the master istance VO is not reimain in the folder I've previously selected by SetCurrentRowWithKey?
    6. With reference to the expression (*) above. The BTF 'dialogue' I created contains only the page jspx with shape and a return to activity. I also tried a) create (and restore) the backup point, b) to call createInsert inside the "dialog box" operation BTF (see images below), but the createInsert on retail VO istance called inside the 'dialogue' BTF seems not to reflect on the table as when I call createInsert by calling btf. I have to make some adjustments in the 'dialogue' of BTF?

    Thank you

    Federico

    Federico,

    (1) Yes, what should happen if a user add or edit vo1 and click ok in the dialog box but decided that ask to work must be restored?

    (2) as long as you don't have that a dialog box is open, it should work.

    (3) the flowrate range of page is a map. You can put the same key more than once. If the key already exists, the value is replaced.

    (4) in fact, I don't know, but the sounds of complicated design. I guess you can record more points, but only in the order of creation. It's as if you try to rebuild the framework. BTF yo it even for you, when worn right. Please go to ADF Architecture Square and read and watch it task flow of related things.

    (5) this behavior is as expected. A restore resets all the iterators so thagetto point at the top of he. http://www.Oracle.com/technetwork/Developer-Tools/ADF/learnmore/OCT2010-OTN-Harvest-183714.pdf 'keep the line after cancellation' shows how to handle this situation.

    (6) I suppose have you refresh the table iterator, once you close the dialog box for the new data. But that's only a guess because it depends on how the btf share control of data and the your involved.

    Timo

  • Attribute fill EO Jdev 10.1.3.2.0 with attribute Transient VO

    Jdeveloper 10 with Struts using...

    I have a View object that is connected to an Entity object. The View object has an extra attribute transient (editable). I would put one of the attributes by using the value of the transient EO attribute. I tried to use postChanges() on the VOImpl, but this causes more problems that it solves (Houston-28201).

    I work hard to avoid changing the data model for commercial reasons. Ideas or comments on this would be greatly appreciated.

    Thank you

    Once you generate the file VORowImpl, you would get the methods getter/setter for all attributes & also the transient attributes:

    To set the name combined in CustomerName, so you can be the following:

    public String getSurname() {}
    Return (String) getAttributeInternal (SURNAME);
    }

    public void setSurname (String value) {}
    setAttributeInternal (NAME, value);
    Set the CustomerName by adding all the names
    setAttributeInternal (CUSTOMERNAME, this.getName1 () + this.getName2 () + this.getSurname ());
    }

    Thank you
    Nini

  • [ADF, JDev12.1.3] I would like to stress that af: table takes the entire width of page and column auto-augmenter/reduce their width in proportion to the amount of available space. How...?

    Hallo,

    I see that default ADF makes all the 100px wide columns and there is the possibility to stretch a column to take full available width.

    I would like to know if there is a function / approach in ADF which - occupies all the available space - auto-calcule the width of each column to 1) the width of DB fields and 2) space in the browser window.

    I could also set the with columns of table in columns (characters) or (better?) in pixels and the framework should only for reproportion widths according to the available width.

    Or track to follow is defining the width of the columns in the table (percentage) property?

    Thank you

    Federico

    There is the possibility to stretch a column to take full available width.

    AFAIK, you can stretch several columns (read the docs for this property)

    I would like to know if there is a function / approach in ADF which - occupies all the available space - auto-calcule the width of each column to 1) the width of DB fields and 2) space in the browser window.

    (1) as far as I know, no

    (2) you can add class AFStretchWidth to the styleClass property to af:table (or surround your table with af:panelCollection and add this style class here)

    Or track to follow is defining the width of the columns in the table (percentage) property?

    Is probably not.

    % has different interpretation in different browsers, so you should use the style class AFStretchWidth.

    Dario

  • [ADF, JDev12.1.3] Form based on EO VO istance basis: which is the best place where to score the extra required fields?

    Hallo,

    I created a form of a base EO VO istance.

    The EO has auto-marqué as asterisk fields in the db table on which it is based.

    Self-validation as happens on these fields, but I want to force the user to fill in the other fields.

    What is the best blace where to add other fields of cumpolsory?

    So far, I did it in the attributes of the OS... but I would like to know if it's OK.

    Thank you

    Federico

    Yes, this is logical job for each line that is the place to mark the attribute as mandatory.

    In this way, the validation is done as for the other attributes.

    Timo

  • Hide the line of adf table based on the transient attribute does not

    I have a JSF page where the user can insert new line in View object . this View object contains a transitional attribute which indicates whether or not the record is newly created.

    On the same page, I have a table adf which is bounded on the city view object . This table should show only newly created records. my approach is to use expression language of in the renditions property to hide all the other lines that are not newly created. I changed the render property for the columns of the table as: rendered="#{row.bindings.RowStatus.inputValue eq'new'}" , but the table does not show anything.

    Then, I tried to change the made not for the column property, but to the outputText inside the same way. It worked, but the problem is that the blank line is always on display.

    So, basically because I do not hide the entire line, instead I'm hiding the text in the lines and lines with spaces empty is still on display in the page aside.

    The Table of JSF page where the made property is applied on outputText inside the column:

    <af:table value="#{bindings.UplodedFilesView1.collectionModel}" var="row"
      rows
    ="#{bindings.UplodedFilesView1.rangeSize}"
      binding
    ="#{CreatSR_UserBean.fileTable}">

      
    <af:column sortProperty="#{bindings.UplodedFilesView1.hints.FileName.name}"
      headerText
    ="File Name" id="c1">

      
    <af:outputText value="#{row.bindings.FileName.inputValue}" id="it1"
      rendered
    ="#{row.bindings.RowStatus.inputValue eq'new'}"/>

      
    </af:column>

      
    </af:table>

    I use Jdeveloper with ADF technology 11.1.2.3

    Thanks Timo,

    You are right. Its to late to hide lines after stamping in the row set. I solve the problem by filtering the view object, based on the transitional attribute in the section of liaison page. The steps as follows: (assuming that the object from view with the temporary attribute has been created, and the transient attribute contains the filtered values)

    1. Drag the view object on the page and also make the Table (in my case it might otherwise listen)
    2. On the page, go to the connection tab.
    3. Double-click the object desired in the links column.
    4. New window will appear titled with (change the binding tree)
    5. Check the option (enable filtering)
    6. Select the (filter attribute) and (filter value) for the selected filter attribute.
    7. Select (Display attribute) you want to appear in the page.
    8. Press OK
  • [ADF, JDev12.1.3] Problem of formatting attribute VO MONEY when exports it as an Excel file using apache.poi

    Hallo,

    I have a VO with an attribute based on the field of database of MONEY.

    In the configuration of the VO for the attribute I put:

    • In the "Details" tab: Type = BigDecimal
    • In the "Indications of the UI" tab: Format type and Type like the image below

    Immagine.png

    These settings allow the value of the attribute (in the table, inputText) appears with thousands and decimal separator that according to my language - Italian - are. (point) and, (comma).

    For example. Silver number displayed correctly:

    10.123.000,37

    When I write the value of the attribute in an Excel cell using apache.poi...

    cell.setCellValue (attr.toString ());

    ... I see in the cell...

    10123000.3700

    ... Although I'd like to see what...

    10123000,37 (not thousands separator, the comma as separator decimal and only 2 decimal places)


    You could you kindly help me to get there?

    Thank you

    Federico

    Federico, this isn't really a question JDev or ADF. This can be solved by setting the cell format to the cell, you write the number. Like oyu would in excel

    style.setDataFormat(HSSFDataFormat.getBuiltinFormat("#,##0.00"));

    more info on HSSFDataFormat (javadocexamples.COM JAVA DOC BY EXAMPLES) - API, usage, demonstrations and code examples

    Timo

  • ADF ViewObject. Fill the transient attribute on ExecuteQuery

    Hi all

    I use Jdev 12.1.3.0

    I have a requirement to display the link within the cell of the column. and there is a chance that there may be multiple links in a single cell at a time.

    I get the table data (spacer) string, separated, if there are several links in a chain.

    Is it that I anticipate, create a transitional attribute and process data and fill attribute (spacer) transient data separated in the table list. And use this as an entry for the iterator to display in the cell of the column.

    But I'm not sure where to implement the that runs as soon as the execution of query.

    Please suggest.

    Thank you

    Vieira

    Hi user,

    You need not transitional attribute.

    Let's say that your attribute delimited by spaces of db table have the name 'space_separated_attr_from_DB '.

    First, create a managed bean property (say, iterTest), with type ArrayList, as follows:

    public ArrayList getIterTest(){
          // get  space separated attribute value:
          FacesContext ctx = getFacesContext();
          Application app = ctx.getApplication();
          ValueBinding bind = app.createValueBinding("#{row.space_separated_attr_from_DB}");
          String space_separated_attr = (String)bind.getValue(ctx);
        // now, parse space_separated_attr, store in the ArrayList, and return as method result:
        return some_parsed_ArrayList; // you know...
    }
    
    private ArrayList listTest = new ArrayList();
    
    public void setIterTest(ArrayList listTest){
          this.listTest = listTest;
    }
    

    Then place new column in the af: table, as follows:

    
            
                   
            
    
    

    This way, you'll have a commandLink for each word of space_separated_attr_from_DB

    Here is how this looks to the execution time:

  • Table ADF attribute Transient refreshing on the scroll bar

    Hello

    I use JDeveloper 11.1.1.6.

    My case is

    I have a SQL based ViewObject that made table ADF, transitional attribute table is there which is the type Boolean data must select several rows in the table for the deleting.

    When the ADF tables retrieves the database lines, I can select/check the transitional attribute and scroll down in the table, then select a few lines more for deletion.

    When I scroll the selected/checked lines become non controlled has refreshed.

    How to stop updating the data from one table of ADF on the scroll bar?

    Please help me...

    Thanks in advance.

    Kind regards

    Shashidhar

    Problem solved, I changed the View object to View object based entity and added transitional attribute in entity object.

    When I scroll down/up the value of fetch VO of EO so I'm getting transitional attribute as checked/selected.

    Thank you

    Shashidhar

Maybe you are looking for