BC4J,Setting a default Value In a View With Data From An Other View

hi
I'm developping A BC4J. I want to set the default value of a field By counting the number of rows in an other view.
So I want to instanciate the view and execute the sql statement and get the result.
Is that the right manner to do it or not.
can someone help me to do that
cheers
ghassen

There's lots of ways to skin this cat depending upon whether you mean "database view" or "view object" when you say "view", and individual requirements.
Given database views v1 and v2 with a common key between them
select v1.x, count(*) from v1,v2 where v1.key = v2.key group by v1.x;
either in the database view or in expert mode for the view object ( I think it'll take group by, but never done it ). ( assumption is that v1.x is a primary key for v1 )...
Try this from sql*Plus first to get a feel for how this works.
The catch with the above is that it is "static"... if you can ADD rows to v2 in your application... they aren't visible in the count until saved and requeried.
Another way ( I think... hopefully Oracle folk will kibitz... )
Create your own attribute on the view object like "TheOtherCount".
In the view object's RowImpl, find the "getTheOtherCount". Find the count of rows in the second view object or entity object or rowSetInfo through the method of your choice. ( If you've already set up a master detail relationship that is active you can just get the rowcount! ). Refer to earlier postings on how to get the rowcount, or to create a dynamic view query to get the count.
The nice thing is that this should reflect your counts even if the second view has added or removed rows... but will probably move like a snail.
Note that if you have a need where you want the row count updated in a frame for v1 whenever v2 is added to or removed from... well... then you need to set up some sort of event listener to do a redisplay of v1's frame, I'd think? Since the attribute you've created in the view object is not based on an entity object attribute, it has no way to know when it has been "updated" via an additional or removed row from the target.
I'm posting the above because no one has responded yet... it may form a place to start from. And maybe someone in the know will go "No, No, No... KKirk... it doesn't work that way at all!" and fill us in on how this can be accomplished!
Good Luck

Similar Messages

  • How to set the default value of a LOV that is found in a view criteria

    HI,
    I need to set the default value of an LOV that is found in a view criteria. I tried to set a groovy expression but unfortunately it wasn't read. i also tried to bind the LOV to a bind variable and set the value of the bind variable in the constructor of my backing bean but unfortunately the default value appeared the second time i entered the screen and not on page load.
    Can anyone advise where can i set the default value,
    Thanks

    if you want some default value in LOV. you go to edit list of value wizard-> UI hint->include no selection Item checkbox -checked.use labeled item first of list- and beside that put the label. but when you try to get value, it will show null.but you can manipulate in ur java , if it default value

  • How to set the Default values for Info Objects in Data Selection of InfoPac

    Hi All,
    Flat file Extracion:
    How to set the Default values for Info Objects in Data Selection Tab  for Info Package
    ex: Fiscal Year Variant  Info Object having values 'K4' 'Y2' etc  in Flat file
    Initially  default value(not constant)  for this info Object value should be 'K4'  in Info Package
    If I set data selection value for this info object K4 it will retreive records with this selection only? how to handle
    Rgds,
    CV

    Hi,
    suppose as your ex. if you are having fiscalyear variant in the dataselection tab then specify K4 in the from column, again the ficalyearvariant row and click on insert duplicate row at the bottom . you will get another row . In that enter Y2 in the from column. now you can extract K4, y2 values .
    haritha

  • How to set the default value of an item type DATE PICKER to the day of yest

    Hi
    How to set the default value of an item type DATE PICKER to the day of yesterday ?
    Thank you very much !
    Christian.

    Hi Christian,
    Have a look at this thread Re: Default the Date Picker to Today
    It covers this issue in detail.
    Regards
    Paul

  • Performance View with data from Custom Rule

    Hello again everybody,
    so we created a vbscript which measures time needed for a specific process inside a program.
    Now we made a rule for getting this data inside SCOM. Alerting and Health-Monitoring works fine.
    For example, we made "if TimeNeeded>5" critical Health state, works like a charm.
    But now, we want to view the data (the script runs every 30 seconds) inside a Performance view.
    - We checked if the rule works as intended. Check
    - Set the rule to "Performance Collection". Check
    - Set the right target group. Check
    - Override for specific target. Check
    - Created a perf.monitor "collected by specific rules" (added our rule) with right targeting. Check
    But the performance-view keeps unpopulated.
    What now?

    I exported the MP as XML file but the rule is not in there, only references.
    But thats not the point anyway, the rule is working.
    The only thing missing is to grab the data the script returns (via oAPI propertybag) and show it in a view. Thats all
    Maybe the question was not clear enough:
    Our script returns a value every 30 seconds, for example 6, then 4, then 8, then 10 and so on...
    All we want now is to show these values in a Performance-View.
    Graphical example:
    10|                            X
    08|                     X
    06|         X
    04|               X                              X
    02|                                    X
    00|
    I guess you now know what I mean.
    This Article
    corelan.be/index.php/2008/04/16/using-customnon-performance-counter-data-to-build-graphs-in-operations-manager-2007
    is EXACTLY what I want and what I did.
    But my Performance-View refuses to show
    ANYTHING...
    Whats the problem?

  • How to update a list in parent view with data from child view/window ?

    I have a view named AccountListView that displays some buttons and a list of accounts.Its viewmodel is called AccountListViewModel and has a collection : ObservableCollection<AccountViewModel>. What I'd like to acomplish: whenever I press the Add/Edit
    Button from the AccountListView to open a new window/usercontrol, i.e. AccountView and bind it to an instance of AccountViewModel that will have some fields to fill in and a Submit and Cancel buttons. How can I update the ObservableCollection<AccountViewModel>
    from  inside the child view, so when I click on the Submit button from AccountViewModel it will return an AccountViewModel object with the data I filled in and add it to the observablecollection. Would notifications from prism be the right way ? Should
    I include code from the AccountListViewModel and AccountViewModel ?

    The way to communicate between view models in Prism is to use the EventAggregator. You raise an event from view model A and subscribe and handle this event in view model B. I have written a blog post about it which should be helpful here:
    http://blog.magnusmontin.net/2014/02/28/using-the-event-aggregator-pattern-to-communicate-between-view-models/.
    In your case you could define an event that carries an AccountViewModel object and pass this one from view model A to view model B:
    public class AccountViewModelEvent : CompositePresentationEvent<AccountViewModel>
    Please refer to the blog post for more information and a complete code example.
    Hope that helps.
    Please remember to close your threads by marking helpful posts as answer and then start a new thread if you have a new question. Please don't ask several questions in the same thread.

  • SRM 4.0- How to set the default values for product type (01) only for SC

    The radio button “Service” should not be visible.
    Also for search help (e.g. search for internal products) where a search should only be possible for product type 01 (goods). The system should not display the product type and internally always search for goods only.
    How to set the default values for product type (01) only for SC
    We needs to use Search help BBPH_PRODUCT which having parameter PRODUCT_TYPE
    Here we can set defalut value 01 but it is not correct one since same search help is using several places.
    We need to limit the search help results only for SC.
    Kindly help out me ASAP.

    The easiest way to set defautl values is to edit the batch class.
    Goto the characteiristic and go to update values.
    In here you probably have something like 0 - 100 as a spec range.
    On the next line enter the default value within this range.  At the end of the line, click in the box in the column labelled "D".  This indicates the defautl value for the characteristic.
    If you need to you can do this in the material classification view as well.
    Just to be clear, these values will only show up in the batch record.  You can not have defautl values in resutls recording screens.
    FF

  • How do I set ical default values in lion?

    I have just upgraded to Lion and so far, so good.  In the new iCal, how do I set the default values?  In the old version, when you clicked on the calendar, the default value was a 1 hour meeting around the current time of day.  The new version defaults to an all-day meeting.  I like the old way better, or best would be to have it as a preference. 
    Is there a way to set this that I'm not seeing?

    Mike,
    It sounds to me like you are using the "Month" view for that entry.
    Default event creation in Month view results in an all day event.
    Lion iCal Help (Add events to a calendar) says: "Add a new event in Month view by double-clicking within the day you want the event to appear. Enter a name and time duration for the event in the event’s title field, and then press Return."
    Try entering "Meeting at 9am"...that will create a one hour event named Meeting.

  • How to set a default value for particular field in SRM PO Portal

    Dear Gurus,
    Im desparetly need a help in web dynpro on how to set a default value for a field(flag) in PO header tab in portal.
    My requirement is whenever the user press the edit button in PO screen,automatically a flag field should be set as abap_false.
    I dont think this will handle in check badi or change badi. i tried this part in onbuttonpressed overwriteexit in CNR_VIEW views,i can get the function EDIT in debugging mode,but dont know how to proceed further.....
    Many of them suggested to go with get attribute and set attribute for changing any particular field in web dynpro,but im not very familiar in using those get and set attributes.I request you people can give me sample code on how to identify my target field in the node and set the values while pressing EDIT Button.
    Thanks in advance...
    Regards,
    Sathish

    Dear Laurent,
    Thanks for your response,
    But i searched in enhancement spot of WD_BADI, but couldnt get the exact way to change the coding,
    My real requirement is, that particular flag should be enable and disable dynamically by checking a condition in my header values.So in that case i dont know how to proceed further to handle in the PO screen.
    Kinly guide me how to get the particular node of field in the Purchase order screen.
    Thanks you in advance,
    Sorry for the inconvenience if any
    Regards,
    sathish

  • How to set a default value to ADF CoreInputText ?

    Hello,
    I try to set a default value to a CoreInputText, JDev 10.1.3 automatically turns it into a CoreOutputText ! When jspx is rendered, I am not be able to edit my input default value anymore.
    Here are my tries:
    (a) Bind directly to a managed bean token using Value property
    Example: <af:input> ..... value="#{mybean.mytoken}" .....</af:input>
    (b) Bind indirectly via jspx backing view Java, example of my codes:
    public void setIssueDate(CoreInputText inputText15) {
    FacesContext fctx = FacesContext.getCurrentInstance();
    inputText15.setValueBinding("value",fctx.getApplication().createValueBinding("#{mybean.mytoken}"));
    this.issueDate = inputText15;
    public CoreInputText getIssueDate() {
    return issueDate;
    .... and so on...
    I appreciaite your help to set other properties perhaps to reserve CoreInputText.
    Many thanks.
    Rob.
    Robert.

    <p>
    Hi,
    </p>
    <p>
    Try Steve&#39;s Muench example 70.<strong>Conditional View/Controller-Layer Defaulting of Fields in a Create Form</strong> 
    </p>
    <p>
    Kuba 
    </p>

  • Cannot set the default value of an item in the detailed table

    Hi,
    I have Master-Detail group, both are Table formats.
    I need to set the default value of an item in the details row to the value of an item in the selected row in the Master table.
    I tried Default Display Value=#{row.MasterItem}, but it seems it is trying to access current details row instead of the Master.
    I tried #{bindings.MasterGroupColumnName.inputValue}, but it does not work.
    Any ideas
    Thanks in advance
    Mohamed

    I think I now what I'm doing differently, I had the "New Rows" JHS property of the detailed table group "empty" instead of the default "2" value.
    It seems that "Default Display Value" expression works only for the new records specified in the "New Rows" property. But when I try to "Add" new record using the "Add Row" button, the new record inserted does not have the default values generated, only has values populated for the items of the FK (in the view link) but not the ones set through the property.
    I guess in a nutshell, how I can get the details item to behave like the FK columns?
    Thanks much
    Mohamed

  • How to set a default values on fields

    Hi !
    using Jdeveloper:11.1.1.4.0
    ADF Business Components     11.1.1.59.23
    Jsp page
    I want to set a default Date value in the field (in search form) How to do this ? Img priview [http://tinypic.com/r/zjhuf9/6]
    The default value need to be one week older that today priview Default value: 07.08.2012 (14.08.2012:Today)
    and a user cannot change that value
    I am newbie in ADF and Java so some usefull links can be posted to
    ID

    Hi,
    Adding default value for the attribute would work for the new rows that are created. If you want to have that in the search field, you need to set the default value for the bind variable which you are using in your View Criteria. The blog i've posted serves exact same usecase as yours.
    -Arun

  • How to set the default values of the field of the context.

    Hi Experts ,
    I want to set the default value of the field of the context.
    Where and how this declaration should be done.
    Thanks in Advance.

    In the context tab of the view. Select the attribute for which you want to set the default value.it will show the properties at the bottom. set the Default value property to the value which you want to set as the default value.
    Regards
    Naresh

  • How to set a default value for a drop down list box and then apply cascading based on the default value in Infopath 2010.

    Hello Everyone
    I have two drop downs. Both are coming from look up fields from two lists. i want to set a default value(first list item) for the first drop down list box and then apply cascading based on the default value for the next drop down list box. I found one article(http://www.bizsupportonline.net/infopath2010/display-first-item-drop-down-list-box-infopath-2010.htm)
    where in i can set a default value but i can't apply cascading based on that default value. Any suggestions would be highly appreciated.
    Thanks
    Ramanjulu Naidu N

    Hey Ramanjulu,
    Take a look at the below article which I believe will answer your question.
    http://basquang.wordpress.com/2010/03/29/cascading-drop-down-list-in-sharepoint-2010-using-infopath-2010/
    Daniel Christian (MCTS)

  • How to Set default value for taxonomywebtagging control with terms and nested terms

    Hi,
    I have created taxonomy control in custom aspx page and I am able to select terms but I am trying to setup default value to that control.
    Can anybody let me know how to set the default value for TaxonomyWebTagging control in custom.aspx page with nested terms?
    Any help would be greatly apprecited.
    Control code in aspx page:
    <td>
    <asp:Label runat="server" ID="lblLanguages">Field A: </asp:Label><asp:Label runat="server" ID="rfvlblLanguages" CssClass="errorMsg" ForeColor="Red">*</asp:Label>
    </td>
    <td>
    <Taxonomy:TaxonomyWebTaggingControl ID="term" Width="385px" runat="server" /></td>Mapping metedata code:TaxonomySession session = new TaxonomySession(SPContext.Current.Site);
    //Set the Business Unit Field
    SPSite site = SPContext.Current.Web.Site;
    TermStore termStore = session.TermStores["Managed Metadata Service"];
    Group group = termStore.Groups["GROUPName"];
    TermSet termSet = group.TermSets["TERMSETNAME"];
    Term term = termSet.Terms["TermA"];
    Guid termGuid = term.Id;
    term.SspId.Add(termStore.Id);
    term.TermSetId.Add(termSet.Id);
    term.AllowFillIn = true;
    term.AnchorId = countryGuid;
    term.IsMulti = true;
    Thank you.
    AA.

    Hi,
    According to your description, you want to set default value for TaxonomyWebTaggingControl.
    I have a test in my environment. It could be achieved by setting the Text Property of TaxonomyWebTaggingControl.
    Here is the code snippet:
    TaxonomySession session = new TaxonomySession(SPContext.Current.Site);
    SPSite site = SPContext.Current.Web.Site;
    TermStore termStore = session.TermStores["Managed Metadata Service"];
    Group group = termStore.Groups["GroupA"];
    TermSet termSet = group.TermSets["A"];
    Term term = termSet.Terms["A1"];
    TaxonomyWebTaggingControl1.SspId.Add(termStore.Id);
    TaxonomyWebTaggingControl1.SSPList = termStore.Id.ToString();
    TaxonomyWebTaggingControl1.TermSetId.Add(termSet.Id);
    TaxonomyWebTaggingControl1.TermSetList = termSet.Id.ToString();
    TaxonomyWebTaggingControl1.AllowFillIn = true;
    TaxonomyWebTaggingControl1.IsAddTerms = true;
    TaxonomyWebTaggingControl1.IsMulti = false;
    TaxonomyWebTaggingControl1.Text = string.Format("{0}|{1}", term.Name, term.Id.ToString());
    Here is a detailed article for your reference:
    http://blog.bugrapostaci.com/2010/09/23/taxonomywebtaggingcontrol-sharepoint/
    Feel free to Reply the test result.
    Thanks
    Patrick Liang
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Patrick Liang
    TechNet Community Support

Maybe you are looking for

  • How Do I Back Up My iTunes Purchases On The 11.01 Version?  Please help!

    How do I back up my latest iTunes song purchases on the 11.01 version that I recently upgraded to?  Please help!

  • No PDF Thumbnails in Windows 7 RTM Reader 9.1.3

    My Thumbnails have disappeared. PDF documents that previously had thumbnails are gone. Just the plain old Adobe icon now. I have tried every setting I can think of and deleted all the thumb files and icon caches. One minute I had 'em and the next the

  • Parent-Chold O/R Mapping

    Hello I have two tables in an Oracle database: PARENT and CHILD. The PARENT table has a column called IDENTIFIER (String) The CHILD table has a column called PARENT_IDENTIFIER (String) I want to markup my Parent has having a collection of Children. T

  • Open Indesign files in photoshop

    Hello, I use photoshop cs2. Are you able to open Indesign files in CS3? I am considering upgrading. Shawn

  • Copy control for J1IIN.

    Hi Gurus, How the data is copied form billing document to J1IIN? Is there any copy control for this?