Master-Detail prevent inserting detail row if master doesn't exist
Hello,
I have a complex page that has several master-detail table pairs on it. I have what should be a simple problem to work around that I can't seem to figure out. On each table (either master or detail) I have a create button in the header and a delete button in each row. I have a couple issues I just can't seem to get past.
1. How to disable the detail create button if no master row exists or one hasn't been selected by the user? (Right now you can create detail rows without a valid master row)
2. How to disable the master row delete button if there are any (commited or not) detail rows present?
I think I have figured out 2 by having a transient attribute on the master row that uses groovy and the view link accessor to count the detail rows. This appears to be working but if there's a better, cleaner solution I'm all ears. I just can't seem to get 1 working no matter what I try.
Thanks for any help you can provide.
hi,
you can use estimatedRowCount of iterator to disable the button like
disabled="#{!(bindings.mastervoIterator.estimatedRowCount ge 0)}"and use currentRow property to determint whether current row is selected like
disabled="#{!(bindings.mastervoIterator.currentRow ne null)}"so the combination will be as follows
disabled="#{!(bindings.mastervoIterator.estimatedRowCount ge 0 and bindings.mastervoIterator.currentRow ne null)}"hope this helps...
Regards.
Similar Messages
-
Default import data in a service PO as material master doesn't exist .
Hello all ,
Could anyone let me know , how can we default the import data entries at item level , in a service PO to a foreign vendor .
As we dont enter a material number , a material master cannot be refernced for these values to default in , during PO creation .
Example fields are Ctry of origin , BusTransactType and Exclusion/Inclusion indicator .
thanksthanks , but no access is made to material master in case of Service POs . As only a short text ( and no material number ) is entered along with the account assignment category .
any suggestions ? -
Procedure to create date row if it doesn't exist fails if 1 date exists
Hola -
The idea is to create a procedure which checks if today's date exists in the table, and if not enters it. Works fine if there is only 1 date that matches but bails if it doesn't with the error:
ORA-06512: at line 1
01422. 00000 - "exact fetch returns more than requested number of rows"
and I'm not sure why. Any help (or alternate way to work this) greatly appreciated. 10gR2 right now but 11g is an option.
Procedure:
create or replace
PROCEDURE "ADD_DAY_FOR_REFDESK_STATS" IS
v_date_exists varchar2(1) := 'N';
BEGIN
select 'Y' into v_date_exists
from dt
where to_date(thedate, 'DD-Mon-YYYY') in
(select unique(to_date(sysdate, 'DD-Mon-YYYY')) from dt);
if v_date_exists = 'Y' then
insert into dt (thedate, col) values (sysdate, 'col1');
end if;
END;
Test table:
CREATE TABLE "SUPERVISOR"."DT"
"THEDATE" DATE,
"COL" VARCHAR2(20 BYTE)
Data:
insert into dt (thedate, col)
values (to_date(sysdate, 'DD-Mon-YYYY'), 'Col1');
insert into dt (thedate, col)
values (to_date(sysdate, 'DD-Mon-YYYY'), 'Col2');Hi,
GuyInPhilly wrote:
Many thanks Frank, I am fuzzy on MERGE so I had avoided it, but it works, my great thanks & also for the explanation. MERGE is very handy. If it takes some time to learn how to use it, I'm sure you'll find it time well spent.
I had assumed my call of unique would have taken care of this.UNIQUE means that the query won't return two identical rows; "SELECT UNIQUE job FROM scott.emp" returns 5 rows. Also, you were using UNIQUE in a sub-query. It's okay for the sub-query to return multiple rows; SELECT ... INTO requires that main query returns no more than 1 row. (By the way, it doesn't matter if the rows in an IN-subquery are unique or not.)
I actually do have to enter several dates but they remain the same; what varies is the value for 'col', there are 10 of them entered for each date. Usually, I use 'INSERT ALL' as in:
INSERT ALL
INTO dst (dst.thedate, dst.col) VALUES (src.todays_date, 'colA')
INTO dst (dst.thedate, dst.col) VALUES (src.todays_date, 'colB')
INTO dst (dst.thedate, dst.col) VALUES (src.todays_date, 'colC')
SELECT * FROM dual;
which works on it's own, but in this case/in the context of the MERGE I am getting the error:
SQL Error: ORA-00926: missing VALUES keyword
I'll assume that construct isn't valid in this case, what would be a good way to accomplish this?
As for using 'to_date' on a date field.... I blame a recent switch to tea instead of coffee.I don't think you can usie INSERT ALL with MERGE.
You can generate a source table with 10 rows, lile this:
MERGE INTO dt dst
USING (
SELECT TRUNC (SYSDATE) AS todays_date
, 'Col' || CHR (64 + LEVEL) -- or use CASE to get 10 distinct values
AS col
FROM dual
CONNECT BY LEVEL <= 10
) src
ON ( src.todays_date = dst.thedate
AND src.col = dst.col
WHEN NOT MATCHED
THEN INSERT (dst.thedate, dst.col)
VALUES (src.todays_date, src.col)
; -
Hi, I'm just evaluating Numbers and I can't figure out how to insert multiple rows within a set of existing rows. I can see how to add a single row above or below a row, but not how to open up a block to insert multiple rows.
Many thanks, JonathanHi Mark,
Thank you for the response. I hadn't looked at the "Table" menu, I was looking at the popup menu that appears at the front of the row - that menu continues just to offer 'add row'.
It would be good if the help documentation included this information.
Anyway, you tip solves the problem for me. Many thanks. -
Insert a row in master detail view & jboRowKey parameter
Hi
I hava a minor problem.
On JSP page I have edit form for master view, beyond edit form is browse of detail view. I would like to insert or edit a row on master view and after update and commit, a would like to stay on the same page to insert some rows into detail view.
When I editing rows it is Ok, becose jboRowKey parameter is always the same (to find proper row on master view).
Problem appears when I want to Insert a row into master view, becose after transaction is commited, jboRowKey parameter is changed.
Primary key on master table is sequence and it is inserted by (preinsert) trigger before commit.
If anybody has some idea to solve this problem, please help.
GorazdWithout knowing exactly the technology you are using, (JDev version, BC4J JSP tags/Components tags?),
In general with BC4J after you do a commit, you do not necessarily have a record pointer on the new record that you just insert on the master table, so you would have to locate it again.
Here is one way you could do this.
After you commit your new inserted record, you could go back to a master "browse" page which shows the records of your master table along with a link to it's corresponding detail page. Encoded in the link you could pass the rowkey of the master record as a parameter and then in the detail page you could locate the master record that was clicked on by using the Find operation of the Row tag. When the master row is located, you automatically would be pointing to the correct detail records.
In this case since the master was just created, there wouldn't be any detail records yet. You could then create new detail records for the new master..
Let me know if this helps..
-Chris -
Master-Detail and Auto Insert Detail rows
Apex 3.0
I'm trying to do a Master-Detail form. I have it set to stay on the same page when I Create a new Master Record.
Now, what I would like to do is auto insert data into the Detail Rows some predefined information and have it ready for the user to enter the rest of the information. I did this by creating a Page Process to trigger on the Add Row button for the Details region. The code I used is:
begin
insert into purch_insurance_type (Contract_ID, INSURANCE_TYPE) values(:P7_Contract_ID, 'General');
insert into purch_insurance_type (Contract_ID, INSURANCE_TYPE) values(:P7_Contract_ID, 'Automobile');
insert into purch_insurance_type (Contract_ID, INSURANCE_TYPE) values(:P7_Contract_ID, 'Excess');
insert into purch_insurance_type (Contract_ID, INSURANCE_TYPE) values(:P7_Contract_ID, 'Workers Comp');
insert into purch_insurance_type (Contract_ID, INSURANCE_TYPE) values(:P7_Contract_ID, 'Others (Builders Risk)');
end;
P7_Contract_ID is the PK on the Master table and I predefine the Insurance Type. The rest of the table the user is able to enter as needed.
When I run it, the new rows show up but the Insurance Type is NULL and browsing from one record and back the new rows are gone. It seems like the PK for the Detail rows are not being filled. I have a Sequence Trigger set to fire on Update:
CREATE OR REPLACE TRIGGER "BI_PURCH_INSURANCE_TYPE"
before insert on "PURCH_INSURANCE_TYPE"
for each row
begin
if :NEW."INSURANCE_TYPE_ID" is null then
select "PURCH_INSURANCE_TYPE_SEQ".nextval into :NEW."INSURANCE_TYPE_ID" from dual;
end if;
end;
ALTER TRIGGER "BI_PURCH_INSURANCE_TYPE" ENABLE
What am I missing? Any ideas or suggestions?Hi All!
I think there is no solution to this problem, only single selection is the solution.
If any one has anyother solution plz let me know.
Thanks and regards.
Abbasi -
Insert new row to master - detail form using bindingsource
Hi all,
I have a form to analyse price of product, the form include master (textbox:slip ID,datetimepicker : date) and detail(datagridview:slipID,productID,price..)
When I insert new row as below code, all inserted to DB but not show on form, I must close and reopen the form the new row will show, how i must to do to fix it
please help, thanks
Select data when form load
ds = New DataSet
damaster = New SqlDataAdapter("select soPTG,ngaybd,ngaykt,khoa = case when sttesign =0 then 'True' else 'False' end from tbl_PTGMaster", conn)
damaster.Fill(ds, "tbl_ptgMaster")
dadet = New SqlDataAdapter("select [SoPTG],[Mahang],[gianhap],[thuesuat],[laigop],[giacu],[giamoi] from tbl_PTGDetail", conn)
dadet.Fill(ds, "tbl_ptgdetail")
ds.Relations.Add("PTG_rel", ds.Tables("tbl_ptgmaster").Columns("SoPTG"), ds.Tables("tbl_ptgdetail").Columns("SoPTG")).ChildKeyConstraint.UpdateRule = Rule.Cascade
BindingMaster.DataSource = ds
BindingMaster.DataMember = "tbl_ptgmaster"
BindingDetail.DataSource = BindingMaster
BindingDetail.DataMember = "PTG_rel"
gridchitiet.DataMember = "tbl_ptgdetail"
txtptgnumb.DataBindings.Add("text", BindingMaster, "soPTG")
dtstart.DataBindings.Add("Text", BindingMaster, "ngaybd")
dtend.DataBindings.Add("Text", BindingMaster, "ngaykt")
cmdlock.DataBinding.Add("Enabled", BindingMaster, "khoa", True, DataSourceUpdateMode.OnPropertyChanged)
setStatus()
SetHeader()
Dim cmdinsert As New SqlCommand("insert into tbl_PTGMaster(SoPTG,ngaybd,ngaykt) values(@SoPTG,@ngaybd,@ngaykt)", conn)
cmdinsert.Parameters.Add("@soPTG", SqlDbType.Char, 10).Value = txtptgnumb.Text
cmdinsert.Parameters.Add("@ngaybd", SqlDbType.DateTime).Value = dtstart.Value
cmdinsert.Parameters.Add("@ngaykt", SqlDbType.DateTime).Value = dtend.Value
damaster.InsertCommand = cmdinsert
damaster.FillSchema(ds, SchemaType.Source)
cmdinsert = New SqlCommand("insert into tbl_PTGDetail(SoPTG,mahang,gianhap) values(@SoPTG,@mahang,@gianhap)", conn)
cmdinsert.Parameters.Add("@SoPTG", SqlDbType.Char, 10).Value = txtptgnumb.Text
cmdinsert.Parameters("@SoPTG").Direction = ParameterDirection.InputOutput
cmdinsert.Parameters.Add("@mahang", SqlDbType.Char, 10, "mahang")
cmdinsert.Parameters.Add("@gianhap", SqlDbType.Decimal, 8, "gianhap")
dadet.InsertCommand = cmdinsert
dadet.FillSchema(ds, SchemaType.Source)
gridchitiet.FinishEditing()
BindingMaster.EndEdit()
damaster.Update(ds, "tbl_PTGMaster")
ds.Tables("tbl_PTGMaster").AcceptChanges()
BindingDetail.EndEdit()
dadet.Update(ds, "tbl_PTGDetail")
ds.Tables("tbl_PTGDetail").AcceptChanges()
BindingMaster.ResetBindings(False)
BindingDetail.ResetBindings(False)Hello,
The base idea here is if the record is added successfully you would then get the new primary key then manually add the record to the underlying data source. Does not matter if we are talking a single table or a master-detail setup.
The following shows the basics
https://code.msdn.microsoft.com/Adding-new-records-into-bff5eaaf
All of the above is done without using a DataSet yet the same thing needs to happen with a DataSet, simply focus on the one table.
Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. -
Insert master and detail rows with Composition assoc generating JBO-26048
I have the Master and Detail Entity Objects and made an Association linking them as Composition related.
I have 2 ViewObjects. the MasterViewObject is composed of the Master entity object and 1 other udpateable object. the DetailViewObejct only contains the Detail entity Object.
I tried to create a row on the masterviewobject and then immeidately create a detail row, and then commit, ADF issues a JBO-26048 error. Constraint "MY_FK" violated during post operation.... ".
I don't know wahts wrong, but this should not be error should nit be appearing, as ViewObjects and the Links with Composition Association take care of populating the Foreign Keys of the detail. Or am I missing something here?The ADF Guide covers this problem, and I have a method that works as well on jdevguru.com. Take a look at the manual first, they have an indepth view on it and how to get it all to work together.
Kelly -
How to insert a row in the detail table of a treeTable (master/detail)?
Is there any small, working example with JDev 11.1.2.1 on how to programmatically insert a row in the detail table represented by the treeTable component?
Please don't send links to this example http://jobinesh.blogspot.com/2010/05/crud-operations-on-tree-table.html , which does not work.
Thanks.Erp, why do you keep giving the links to that example or the zip including the project of that example? I explicitly asked to not send any links to that example, which does not work with jdev 11.1.2.1.
This is the exception from that one when trying to create a new record on the details:
<UIXEditableValue> <_isBeanValidationAvailable> A Bean Validation provider is not present, therefore bean validation is disabled
:bndVarFirstName =null
:bndVarFirstName =null
:bndVarFirstName =null
:bndVarFirstName =null
:bndVarFirstName =null
:bndVarFirstName =null
:bndVarFirstName =null
:bndVarFirstName =null
:bndVarFirstName =null
:bndVarFirstName =null
:bndVarFirstName =null
:bndVarFirstName =null
:bndVarFirstName =null
:bndVarFirstName =null
:bndVarFirstName =null
:bndVarFirstName =null
:bndVarFirstName =null
:bndVarFirstName =null
:bndVarFirstName =null
:bndVarFirstName =null
:bndVarFirstName =null
:bndVarFirstName =null
:bndVarFirstName =null
:bndVarFirstName =null
:bndVarFirstName =null
<FormRenderer> <_warnUnpoppedContextChanges> ADF_FACES-60095:Durante l'elaborazione del renderer del form, la modifica di contesto trovata non corrisponde al componente previsto.
<UIXCollection> <processSaveState> è possibile che la chiave di riga non venga reimpostata correttamente alla fine della richiesta. ID componente: :pc1:tt1, ViewId: /treeSample.jspx
<UIXComponentBase> <processSaveState> Salvataggio dello stato per gli elementi figlio del componente RichPanelCollection[UIXFacesBeanImpl, id=pc1] non riuscito.
<UIXComponentBase> <processSaveState> Salvataggio dello stato per gli elementi figlio del componente RichPanelGroupLayout[UIXFacesBeanImpl, id=pgl1] non riuscito.
<UIXComponentBase> <processSaveState> Salvataggio dello stato per gli elementi figlio del componente RichForm[UIXFacesBeanImpl, id=f1] non riuscito.
<UIXComponentBase> <processSaveState> Salvataggio dello stato per gli elementi figlio del componente RichDocument[UIXFacesBeanImpl, id=d1] non riuscito.
<LifecycleImpl> <_handleException> ADF_FACES-60098:Il ciclo di vita Faces ha ricevuto eccezioni non gestite nella fase RENDER_RESPONSE 6
java.lang.NullPointerException
at oracle.jbo.uicli.binding.JUCtrlHierNodeBinding.findChildNode(JUCtrlHierNodeBinding.java:867)
at oracle.jbo.uicli.binding.JUCtrlHierBinding.bringNodeToRangeKeyPath(JUCtrlHierBinding.java:788)
at oracle.adfinternal.view.faces.model.binding.FacesCtrlHierBinding.bringNodeToRangeKeyPath(FacesCtrlHierBinding.java:111)
at oracle.adfinternal.view.faces.model.binding.RowDataManager.setRowKey(RowDataManager.java:130)
at oracle.adfinternal.view.faces.model.binding.FacesCtrlHierBinding$FacesModel.setRowKey(FacesCtrlHierBinding.java:830)
at org.apache.myfaces.trinidad.component.UIXCollection.setRowKey(UIXCollection.java:513)
at org.apache.myfaces.trinidad.component.UIXCollection.processSaveState(UIXCollection.java:270)
at org.apache.myfaces.trinidad.component.TreeState.saveState(TreeState.java:175)
at org.apache.myfaces.trinidad.component.UIXComponentBase.processSaveState(UIXComponentBase.java:1043)
at org.apache.myfaces.trinidad.component.TreeState.saveState(TreeState.java:175)
at org.apache.myfaces.trinidad.component.UIXComponentBase.processSaveState(UIXComponentBase.java:1043)
at org.apache.myfaces.trinidad.component.TreeState.saveState(TreeState.java:175)
at org.apache.myfaces.trinidad.component.UIXComponentBase.processSaveState(UIXComponentBase.java:1043)
at org.apache.myfaces.trinidad.component.TreeState.saveState(TreeState.java:175)
at org.apache.myfaces.trinidad.component.UIXComponentBase.processSaveState(UIXComponentBase.java:1043)
at javax.faces.component.UIComponentBase.processSaveState(UIComponentBase.java:1156)
at org.apache.myfaces.trinidadinternal.application.StateManagerImpl.saveView(StateManagerImpl.java:193)
at org.apache.myfaces.trinidadinternal.application.StateManagerImpl.getViewState(StateManagerImpl.java:134)
at oracle.adfinternal.view.faces.renderkit.rich.PprResponseWriter._writeViewState(PprResponseWriter.java:514)
at oracle.adfinternal.view.faces.renderkit.rich.PprResponseWriter.endDocument(PprResponseWriter.java:83)
at oracle.adfinternal.view.faces.renderkit.rich.DocumentRenderer.encodeAll(DocumentRenderer.java:1490)
at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1452)
at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:511)
at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:923)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1659)
at oracle.adfinternal.view.faces.context.PartialViewContextImpl._processRender(PartialViewContextImpl.java:321)
at oracle.adfinternal.view.faces.context.PartialViewContextImpl.processPartial(PartialViewContextImpl.java:152)
at javax.faces.component.UIViewRoot.encodeChildren(UIViewRoot.java:974)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1652)
at oracle.adfinternal.view.faces.component.AdfViewRoot.encodeAll(AdfViewRoot.java:91)
at com.sun.faces.application.view.JspViewHandlingStrategy.doRenderView(JspViewHandlingStrategy.java:431)
at com.sun.faces.application.view.JspViewHandlingStrategy.renderView(JspViewHandlingStrategy.java:233)
at org.apache.myfaces.trinidadinternal.application.ViewDeclarationLanguageFactoryImpl$ChangeApplyingVDLWrapper.renderView(ViewDeclarationLanguageFactoryImpl.java:350)
at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:131)
at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:273)
at org.apache.myfaces.trinidadinternal.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:165)
at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._renderResponse(LifecycleImpl.java:1027)
at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:334)
at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:232)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:313)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:173)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:122)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:468)
at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:60)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:468)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:293)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:199)
at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:111)
at java.security.AccessController.doPrivileged(Native Method)
at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:313)
at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:413)
at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:94)
at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:161)
at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.dms.servlet.DMSServletFilter.doFilter(DMSServletFilter.java:136)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3715)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3681)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2277)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2183)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1454)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)
<RegistrationConfigurator> <handleError> ADF_FACES-60096:Eccezione server durante PPR, n. 1
java.lang.NullPointerException
at oracle.jbo.uicli.binding.JUCtrlHierNodeBinding.findChildNode(JUCtrlHierNodeBinding.java:867)
at oracle.jbo.uicli.binding.JUCtrlHierBinding.bringNodeToRangeKeyPath(JUCtrlHierBinding.java:788)
at oracle.adfinternal.view.faces.model.binding.FacesCtrlHierBinding.bringNodeToRangeKeyPath(FacesCtrlHierBinding.java:111)
at oracle.adfinternal.view.faces.model.binding.RowDataManager.setRowKey(RowDataManager.java:130)
at oracle.adfinternal.view.faces.model.binding.FacesCtrlHierBinding$FacesModel.setRowKey(FacesCtrlHierBinding.java:830)
at org.apache.myfaces.trinidad.component.UIXCollection.setRowKey(UIXCollection.java:513)
at org.apache.myfaces.trinidad.component.UIXCollection.processSaveState(UIXCollection.java:270)
at org.apache.myfaces.trinidad.component.TreeState.saveState(TreeState.java:175)
at org.apache.myfaces.trinidad.component.UIXComponentBase.processSaveState(UIXComponentBase.java:1043)
at org.apache.myfaces.trinidad.component.TreeState.saveState(TreeState.java:175)
at org.apache.myfaces.trinidad.component.UIXComponentBase.processSaveState(UIXComponentBase.java:1043)
at org.apache.myfaces.trinidad.component.TreeState.saveState(TreeState.java:175)
at org.apache.myfaces.trinidad.component.UIXComponentBase.processSaveState(UIXComponentBase.java:1043)
at org.apache.myfaces.trinidad.component.TreeState.saveState(TreeState.java:175)
at org.apache.myfaces.trinidad.component.UIXComponentBase.processSaveState(UIXComponentBase.java:1043)
at javax.faces.component.UIComponentBase.processSaveState(UIComponentBase.java:1156)
at org.apache.myfaces.trinidadinternal.application.StateManagerImpl.saveView(StateManagerImpl.java:193)
at org.apache.myfaces.trinidadinternal.application.StateManagerImpl.getViewState(StateManagerImpl.java:134)
at oracle.adfinternal.view.faces.renderkit.rich.PprResponseWriter._writeViewState(PprResponseWriter.java:514)
at oracle.adfinternal.view.faces.renderkit.rich.PprResponseWriter.endDocument(PprResponseWriter.java:83)
at oracle.adfinternal.view.faces.renderkit.rich.DocumentRenderer.encodeAll(DocumentRenderer.java:1490)
at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1452)
at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:511)
at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:923)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1659)
at oracle.adfinternal.view.faces.context.PartialViewContextImpl._processRender(PartialViewContextImpl.java:321)
at oracle.adfinternal.view.faces.context.PartialViewContextImpl.processPartial(PartialViewContextImpl.java:152)
at javax.faces.component.UIViewRoot.encodeChildren(UIViewRoot.java:974)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1652)
at oracle.adfinternal.view.faces.component.AdfViewRoot.encodeAll(AdfViewRoot.java:91)
at com.sun.faces.application.view.JspViewHandlingStrategy.doRenderView(JspViewHandlingStrategy.java:431)
at com.sun.faces.application.view.JspViewHandlingStrategy.renderView(JspViewHandlingStrategy.java:233)
at org.apache.myfaces.trinidadinternal.application.ViewDeclarationLanguageFactoryImpl$ChangeApplyingVDLWrapper.renderView(ViewDeclarationLanguageFactoryImpl.java:350)
at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:131)
at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:273)
at org.apache.myfaces.trinidadinternal.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:165)
at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._renderResponse(LifecycleImpl.java:1027)
at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:334)
at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:232)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:313)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:173)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:122)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:468)
at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:60)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:468)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:293)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:199)
at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:111)
at java.security.AccessController.doPrivileged(Native Method)
at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:313)
at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:413)
at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:94)
at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:161)
at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.dms.servlet.DMSServletFilter.doFilter(DMSServletFilter.java:136)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3715)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3681)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2277)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2183)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1454)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)
while I get this from my own project based on the above one:
<UIXEditableValue> <_isBeanValidationAvailable> A Bean Validation provider is not present, therefore bean validation is disabled
<UIXRegion> <_logIllegalContextChangeMessage> ADF_FACES-10026:Durante l'elaborazione del componente area, non è stata trovata una modifica di contesto oppure la modifica trovata non corrisponde all'istanza impostata dal componente corrente. Prevista oracle.adf.view.rich.component.fragment.UIXRegion$RegionContextChange, trovata UIXCollection.CollectionComponentChange[Component class: oracle.adf.view.rich.component.rich.data.RichTreeTable, component ID: tt1].
<UIXRegion$RegionSiteImpl> <validate> Attempt to validate an already invalid RegionSite:
<UIXCollection> <processSaveState> è possibile che la chiave di riga non venga reimpostata correttamente alla fine della richiesta. ID componente: :pt1:r1:pt1:pc1:tt1, ViewId: /main.jspx
Edited by: user10047839 on 20-ott-2011 7.23 -
using adf/bc with jsf. I have defined a master detail relationship between two entities. This relationship is a composition relationship. The entities are related by a view link which link the master and detail view objects. i have a need to create/insert a master row and a detail row programmatically "on the fly" so that when the jsp renders, the user will see blank inputs for both the master and detail view objects. The problem is that the primary key of the master record is not known at creation time ( it will be entered by the user) and therefore the detail record cannot be created by the framework because of the unknown value of the parent's primary key. I was hoping the following section in the adf guide would eliminate my problem, but it doesn't appear to:
This is from section 26.7.3.2 of the adf developer's guide
Note: An alternative to the programmatic technique discussed
above, which solves the problem at the J2EE application layer, is the
use of deferrable constraints at the database layer. If you have control
over your database schema, consider defining (or altering) your
foreign key constraints to be DEFERRABLE INITIALLY DEFERRED.
This causes the database to defer checking the constraint until
transaction commit time. This allows the application to perform DML
operations in any order provided that by COMMIT time all appropriate
related rows have been saved and would alleviate the parent/child
ordering described above. However, you would still need to write the
code described in the following sections to cascade-update the foreign
key values if the parent’s primary key is assigned from a sequence.
This approach did not help in allowing me to create the detail record without first knowing the value of the parent's primary key record in a composition relationship. The only thing i've found to work is define the relationship as just an association, and not a composition. However, this is a true one to many (composition) relationship and i would like to take advantage of some of the features of the framework that are there when a relationship is defined as a composition relationship. Is there any way to do what i need to do with a composition relationship defined between these two entities? Thanks.Hi,
I guess you need a "Cascading LOVs".
1) Create viewObject for country values list. Named VO1.
2) Create viewObject for state values list. Named VO2.
3) Create view criteria for (bind variable) VO2 which can restrict the result by country.
4) Create view accessor to get VO1.
5) Create view accessor to get VO2. Define the bind variable value which can provide country info dynamically. I guess it should be a Groovy expression.
6) Create country LOV on step 4) view accessor.
7) Create state LOV on step 5) view accessor.
Done
On the view layer, you may enable PPR between country and state attributes.
Todd -
Master Detail Form - unable to add detail row
Dear,
I have a test application that runs for years on apex.oracle.com.
Since 3rd of june 2010 I am unable to add rows on a detail form.
Any ideas?
Help is welcome!
Kind regards
Lorenz4.0 Conversion Issue
Lorenz stated I can create the orderheader, but unable to create orderlines.Simply nothing happens, when I click the add row button.>
I share the same issue as Lorenz, on a Master/Detail form, I am able to create my Master row and but nothing happens when attempting to create detail rows. I was able to switch my application to theme 13 (Traditional Blue) from 2 (Blue and Tan) and was then able to create and add details rows.
My dilemma. When switching to theme 13 and others, none appear to support Two Level Tabs in the same manner as Theme 2. Essentially the applications look and feel is not going to go over well with my user base of 3+ years.
Is there another standard theme that will support Two Level Tabs like Theme 2 and allow the addition of detail rows on a Master/Detail form?
Is this a reported 4.0 conversion issue?
Jeff -
Master-Detail: create detail-row(s) with id already filled in
I have two tables with an one-to-many relationship (connected by 'id'). If you select a row from the master-table, you'll see the detail-table (with the various row's belonging to the master-record). Now I made a button which users can use to add additional rows to the detail-table. They get a form which they can fill in and submit, the only problem is... I don't want them to manualy fill in the id, this should be the only field that should already be filled in (or better should be invisible, but filled in). So they should select a master-row first and then click 'add' to add a detail-row(s) to it. But I have absolutely no clue how I can do this... I tried creating custom create methods in the view-object or entity-object... but the problem I keep running into is where to get the row-iterator... I have know idea if this is the right direction to look for, maybe somebody can give me some advice.
Thanks in advance...!Steven, hope you can help me out once more...
I have the same problem with a different view object, I'll explain...
First of all I set jbo.locking.mode to 'optimistic', now the problem...
I have two entity objects (Mbrships and Mbrshiphistory) which are connected by a foreign key (created in the database) on MbrshipID. Mbrshipshistory is also connected to the Aff entity object by a foreign key on AffID. The idea is simple... there are affiliates and a couple of memberships. An affiliate has/had a membership, that's where the membershiphistory-table comes in, which stores AffID, MbrshipID, DateFrom, DateTo and some other values.
Now, what I created... JDeveloper created entity-objects of all the tables and made associations of the foreign keys. I created the following view objects: http://213.93.142.238/oracle/datamodel.jpg and application module: http://213.93.142.238/oracle/applicationmodule.jpg The (MemberToMembershipHistory) view link between Members and MembershipHostory is based upon the association between the two tables.
The following is a screenshot of my struts-config.xml: http://213.93.142.238/oracle/struts-config.jpg
Editing mbrshiphistories works fine, but I get the following error when I try to add one: oracle.jbo.InvalidOwnerException: JBO-25030: Failed to find or invalidate owning entity. I also don't see the AffID already filled in in the add/edit-screen (same problem as in the opening-post) when I try to add one. I double-checked everything, but I can't find the problem. Do you know what I do wrong...? -
Problem: trying to update all detail rows on pre-commit (MASTER DETAIL FORM
Hi:
I got a MASTER DETAIL form... and I need to update every detail row of this form (if the master was updated) before commiting the changes. the problem is that i cannot do that for instance in PRE-COMMIT or ON-COMMIT... it's an "illegal operation". I achieved part of it by coding KEY-COMMIT... but that did not solve the all problem. first take a look of the kind of code i want execute before commiting.
form trigger key-commit code is is somehow like this:
DECLARE
tot_line NUMBER (3);
line NUMBER (3);
begin
IF NAME_IN ('system.form_status') = 'CHANGED'
THEN
GO_BLOCK ('DETAIL');
LAST_RECORD;
tot_line := GET_BLOCK_PROPERTY ('DETAIL', current_record);
FIRST_RECORD;
line:= 1;
LOOP
:detail.quant := :detail.quant + 1;
EXIT WHEN line= tot_line;
next_record;
line:= line+ 1;
END LOOP;
FIRST_RECORD;
GO_BLOCK ('MASTER');
END IF;
COMMIT;
end;
The problem is for instance when the users close form in the "X" button (right top, near minimize form) ... If they do that Forms ask "Do you want to save changes?" ... and with this i do not execute the update of the detail rows...
But there are other situations when this happens... for instance if EXECUTE_QUERY when i change a record...
Anyone help?
Joao OliveiraUse PRE-UPDATE trigger (Master block).
begin
update <detail_table>
set quant + 1
where <detail_table>.<relaition_column1> = :<Master_block>.<relaition_item1>
and <detail_table>.<relaition_columnN> = :<Master_block>.<relaition_itemN>
and <detail_block_WHERE>;
EXCEPTION WHEN OTHERS THEN NULL;
end; -
Master/detail and problem with selected row when errors on detail row
I'm using JDeveloper 10.1.3.3
I have a very simple master/detail screen (JSF JSP) where master is departments and detail is employees in the selected department. Some of the attributes in employees are required.
To department A
I take away the value of one of the required attributes of one of the detail employee rows.
Select one of the other departments ie department B
Get Error message Value required.
So far so good, but the selected department is B and the detail rows shown is for department A.
I expected that department A to still be selected or that department B with its row to be shown.
Edited by: user628847 on 26.feb.2009 04:55Hi,
if (row != null)
Row masterRow = row;
vo.setCurrentRow(masterRow);
// not needed : getMesReponsesPourTiersVO1().executeQuery();
You shouldnot execute the child VO after setting current row in master VO.
When the current row is set in master VO, then the child rows will get refreshed automatically.
Cheers,
Prasanna -
Creating a master automatically when creating a detail row
Hi,
I'm using Jdev. 11.1.2.3.0
I have three tables (with their corresponding view objects) with a master/detail/detail relationship.
The first-level detail table contain a maximum of one row for each master row.
The ids of the first-level and second-level details are automatically generated with a groovy expression and a sequence.
The views are added on the page as table(master/)form(detail)/table(detail).
I have a case where a master record has no details and i need to create a row in the second-level detail table.
So is there a way to tell ADF to automatically create the first-level detail row (since the master is known) ? or i should manually check that such a row doesn't exists in the first-level detail table and thus create it before creating the row in the second-level detail table?
Thank you.So is there a way to tell ADF to automatically create the first-level detail row (since the master is known) ? or i should manually check that such a row doesn't exists in the first-level detail table and thus create it before creating the row in the second-level detail table?
Thank you.
No, there is no such option so you will need to manually create this row.
Dario
Maybe you are looking for
-
Does Adobe have a plug in for Photoshop CS6 to open Nikon P7800 raw files?
I recently purchased a Nikon P7800 camera. I am using a MacBook Pro computer and Adobe Photoshop CS6. Does Adobe have a plug-in/update that will allow me to open the camera raw files? If they do where do I find it to install it?
-
How to create a G/L account in chart of accounts
Hi experts, i want to create a G/L account for our company code and i receive following message: Account . does not exist in chart of accts .. I have found some helpfull posts but I don't want to do some mistake so, Please, someone describe the steps
-
Is there a way to do percentage based line heights?
For example if I have a 24px font and want the line height to be 140%.
-
ABAP DDIC table name for structure definition
Hello, Can anybody tell me what is the name of DDIC table used for storing ABAP structure definition and also its related tables. Thanks&Regards, Prajesh
-
Transporting Authorization Object
Hi All, We are having two autherization objects.But we use only one in production. we noticed that the other object is also active in production. I checked in development and it is not active. So i need to capture it from development and transport to