tag:blogger.com,1999:blog-5874979429188093780.post8033195192884576646..comments2024-03-18T06:46:54.352+01:00Comments on Andrej Baranovskij Blog: Create, Edit and Delete operations in Master-Detail af:table componentsAndrej Baranovskijhttp://www.blogger.com/profile/04468230464412457426noreply@blogger.comBlogger54125tag:blogger.com,1999:blog-5874979429188093780.post-63281949312429712882016-06-10T12:29:24.400+02:002016-06-10T12:29:24.400+02:00Hi Andrejus,
I have a master child scenario where...Hi Andrejus,<br /><br />I have a master child scenario where master and child are date effective. Suppose for a particular id if i have two date effective records in master and each date effective record in the master has 2 date effective records in child. Assume that child date effcective records are same for both master date effective records. If i navigate from 2nd date effective master record and update a row in child date effective record, the last update of the first date effective master records is getting updated. But ideally it should update 2nd master date effective record. How can i resolve this issue? The association from master to child is 1-*.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-5874979429188093780.post-9025688335491858602011-11-21T05:07:17.091+01:002011-11-21T05:07:17.091+01:00Hi Andrejus,
I want to create a master detail page...Hi Andrejus,<br />I want to create a master detail page for order creation,in this page top part will contain af:form to create new order,and bottom of page should contain table to add line item to the new order.Plese help me solve out in solving this problem.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-5874979429188093780.post-87443958290420780082010-11-15T10:31:48.960+01:002010-11-15T10:31:48.960+01:00I have created a sample like yours and 'edit&#...I have created a sample like yours and 'edit' & 'delete' & 'save' buttons now work well, but if the location_id is not based on sequence, instead, it based on procedure, eg 'shanghai-01' , 'shanghai-02'. I must get it by using 'createCallableStatement', this one how to do? Thanks!yang xingshunnoreply@blogger.comtag:blogger.com,1999:blog-5874979429188093780.post-41721190117426710582010-06-28T23:44:12.140+02:002010-06-28T23:44:12.140+02:00You replied:Make sure you have updated ValueHolder...You replied:Make sure you have updated ValueHolder.java class as well. It declares CountryId as String type, you should update to oracle.jbo.domain.Number.<br /><br />Thanks. Making sure ValueHolder.java declared the correct types fixed the problem! You're the best!Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-5874979429188093780.post-33963950169969197012010-06-28T20:56:12.445+02:002010-06-28T20:56:12.445+02:00Hi,
Make sure you have updated ValueHolder.java c...Hi,<br /><br />Make sure you have updated ValueHolder.java class as well. It declares CountryId as String type, you should update to oracle.jbo.domain.Number.<br /><br />Regards,<br />AndrejusAndrej Baranovskijhttps://www.blogger.com/profile/04468230464412457426noreply@blogger.comtag:blogger.com,1999:blog-5874979429188093780.post-23174737008247820282010-06-28T20:15:40.969+02:002010-06-28T20:15:40.969+02:00I'm trying to 'Select and' click the E...I'm trying to 'Select and' click the Edit command button to edit a rec in a row. The CountryId in my table is an integer, not a string like in the example, so the <af:setActionListener from="#{row.CountryId}" to="{valueholder.selectedCountryId}> is causing an 'illegal argument' error because it's expecting a string in the 'from'. Don't know how to fix. Please help (and thanks for everything you do).Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-5874979429188093780.post-30733159769592887312008-08-07T19:40:00.000+02:002008-08-07T19:40:00.000+02:00Thanks for your reply.Yes, I tried 'detailtableID ...Thanks for your reply.<BR/>Yes, I tried 'detailtableID = :bindValue(+)', but I get an error indicating invalid SQL.<BR/><BR/>Thanks,<BR/>SireeshaUnknownhttps://www.blogger.com/profile/02997301563987418497noreply@blogger.comtag:blogger.com,1999:blog-5874979429188093780.post-18514748088752311742008-08-07T19:16:00.000+02:002008-08-07T19:16:00.000+02:00Hi,Have you tried left outer join - detailtableID ...Hi,<BR/><BR/>Have you tried left outer join - detailtableID = :bindValue(+)?<BR/><BR/>Regards,<BR/>AndrejAndrej Baranovskijhttps://www.blogger.com/profile/04468230464412457426noreply@blogger.comtag:blogger.com,1999:blog-5874979429188093780.post-81712623633207037132008-08-07T19:11:00.000+02:002008-08-07T19:11:00.000+02:00Hi Andrejus,Thanks for the samples. I have a requi...Hi Andrejus,<BR/><BR/>Thanks for the samples. I have a requirement to join master and detail table with an outer join. In the view link, i tried to detailtableID (+) =:bindValue, but this does not return result as expected. Any ideas on how to achieve the above?<BR/>Thanks in advance,<BR/>SireeshaAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-5874979429188093780.post-82318701647830546752008-07-10T21:50:00.000+02:002008-07-10T21:50:00.000+02:00Hi Andrejus, I got the project from you that y...Hi Andrejus,<BR/> I got the project from you that you did for Vijaya, I'm not able to figure out what exactly have you done so that when you initially get to the create form for the master table record the detail table below doesn't show any records.<BR/>How are you actually doing that?Unknownhttps://www.blogger.com/profile/09884527809164818670noreply@blogger.comtag:blogger.com,1999:blog-5874979429188093780.post-71757013912952832932008-04-23T17:46:00.000+02:002008-04-23T17:46:00.000+02:00Thanks! U Rock!Thanks! U Rock!dieciocho18https://www.blogger.com/profile/00243504760027761853noreply@blogger.comtag:blogger.com,1999:blog-5874979429188093780.post-47968194296336840532008-04-23T13:40:00.000+02:002008-04-23T13:40:00.000+02:00Hi,Yes, you can set Immediate=True property for Sa...Hi,<BR/><BR/>Yes, you can set Immediate=True property for Save button. This will by-pass validation.<BR/><BR/>Regards,<BR/>AndrejusAndrej Baranovskijhttps://www.blogger.com/profile/04468230464412457426noreply@blogger.comtag:blogger.com,1999:blog-5874979429188093780.post-91209814835167096792008-04-22T21:27:00.000+02:002008-04-22T21:27:00.000+02:00Hi Andrejus, thanks for your update. I associated ...Hi Andrejus, thanks for your update. I associated a method to the action called by the button but the page validation won´t let me get through, and I can´t execute the method. Do you have any ideas on how I can by-pass this validation and let the method take care of all the businees?<BR/>Thanks in advancedieciocho18https://www.blogger.com/profile/00243504760027761853noreply@blogger.comtag:blogger.com,1999:blog-5874979429188093780.post-50665448617187271882008-04-22T19:29:00.000+02:002008-04-22T19:29:00.000+02:00Hi,Create Method Action for Save button and in Bac...Hi,<BR/><BR/>Create Method Action for Save button and in Backing bean check for empty rows (acquire collection from Iterator). If there will be some empty rows, remove those rows from Iterator. And do commit after that.<BR/><BR/>Regards,<BR/>AndrejusAndrej Baranovskijhttps://www.blogger.com/profile/04468230464412457426noreply@blogger.comtag:blogger.com,1999:blog-5874979429188093780.post-58566291883111039882008-04-22T09:13:00.000+02:002008-04-22T09:13:00.000+02:00Hi,Its good question, I will check this today even...Hi,<BR/><BR/>Its good question, I will check this today evening and will post update.<BR/><BR/>Regards,<BR/>AndrejusAndrej Baranovskijhttps://www.blogger.com/profile/04468230464412457426noreply@blogger.comtag:blogger.com,1999:blog-5874979429188093780.post-65420556275274245762008-04-22T00:12:00.000+02:002008-04-22T00:12:00.000+02:00Hi Andrejus, your examples have been very helpful,...Hi Andrejus, your examples have been very helpful, I want to thank you for providing us with such good code samples. Well I have also got a question for you. I am working on an example in which I have to create new rows. Let´s say I added a new row with the create button and I filled in the correct info for that row. Then, I want to create a new row, so I hit the create button and the new Inputs appear, but I change my mind and I don´t want to add another record. How can I get through the validation that won´t let me submit the changes I have already made (the first insertion)? Is there a way to just remove that last Input row?<BR/>If you could help me with that I would really appreciate itdieciocho18https://www.blogger.com/profile/00243504760027761853noreply@blogger.comtag:blogger.com,1999:blog-5874979429188093780.post-86452080964511718302008-03-24T10:21:00.000+01:002008-03-24T10:21:00.000+01:00Hi,Do you have Commit action defined in Page Defin...Hi,<BR/><BR/>Do you have Commit action defined in Page Definition?<BR/><BR/>Regards,<BR/>AndrejusAndrej Baranovskijhttps://www.blogger.com/profile/04468230464412457426noreply@blogger.comtag:blogger.com,1999:blog-5874979429188093780.post-34641953114746939812008-03-24T08:28:00.000+01:002008-03-24T08:28:00.000+01:00Hi Andrejus,I am able to make a row Editable when ...Hi Andrejus,<BR/><BR/>I am able to make a row Editable when "EDIT" button is Clicked but the new value is not being saved When Clicking the "Commit" Button.<BR/>Actually i draged that commit button form dataCOntrol pallete only(As per your procedure)...<BR/> <BR/> public boolean isEnableEditing()<BR/>{<BR/> FacesContext ctx = FacesContext.getCurrentInstance();<BR/> Application app = ctx.getApplication();<BR/> ValueBinding bind = app.createValueBinding("#{row.Pycode}");<BR/> String jobId = (String)bind.getValue(ctx);<BR/> this.enableEditing = this.getSelectedJobId().equals(jobId);<BR/> <BR/> return this.enableEditing;<BR/> }Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-5874979429188093780.post-77396821301201197062008-03-22T15:53:00.000+01:002008-03-22T15:53:00.000+01:00Hi Ricky,If I understood you correctly, I think yo...Hi Ricky,<BR/><BR/>If I understood you correctly, I think you need to enable AutoSubmit on countryId field and declare PartialTriggerring for a table with countryName. So, when countryId value will be provided, table with countryName will be refreshed.<BR/><BR/>Regards,<BR/>AndrejusAndrej Baranovskijhttps://www.blogger.com/profile/04468230464412457426noreply@blogger.comtag:blogger.com,1999:blog-5874979429188093780.post-73976503174199999812008-03-21T08:11:00.000+01:002008-03-21T08:11:00.000+01:00Hi Andrejus,i want to make the application when th...Hi Andrejus,<BR/>i want to make the application when the user input the countryId (and tab to next field), the apps should query another table for countryName. How to do this ?<BR/><BR/>Thanks,<BR/>RickyAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-5874979429188093780.post-90264517649745508992008-03-03T20:05:00.000+01:002008-03-03T20:05:00.000+01:00Hi Siva,Is it in my sample application? You need t...Hi Siva,<BR/><BR/>Is it in my sample application? <BR/><BR/>You need to use Commit operation to execute Save functionality.<BR/><BR/>Regards,<BR/>AndrejusAndrej Baranovskijhttps://www.blogger.com/profile/04468230464412457426noreply@blogger.comtag:blogger.com,1999:blog-5874979429188093780.post-61844533303109308882008-03-03T14:56:00.000+01:002008-03-03T14:56:00.000+01:00Hi Andrejus,I am able to make a row Editable when ...Hi Andrejus,<BR/>I am able to make a row Editable when "EDIT" button is Clicked but the new value is not being saved When Clicking the "Save" Button.<BR/>Here I think we are updating the Table is it possible to overwrite the values from "Save" button which is actually a commit operation ?? Please Help me I am not able to solve this problem...<BR/>........Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-5874979429188093780.post-28360965235169452852008-02-13T14:31:00.000+01:002008-02-13T14:31:00.000+01:00Hi Ans,You can achieve this with those steps:1. Ge...Hi Ans,<BR/><BR/>You can achieve this with those steps:<BR/><BR/>1. Generate Entity Object Java class with Data Manipulation Methods option included for Detail entity<BR/><BR/>2. Look for doDML(...) method in newly generated class, this method is executed during Create (with code 1 for Create operation)<BR/><BR/>3. In doDML method you can access all attributes from Detail entity and using code available in my blog post - <A HREF="http://andrejusb.blogspot.com/2007/04/invoking-create-method-programmatically.html" REL="nofollow">Invoking Create method programmatically</A> create row in this not dependent table. Just reuse code from createCountry(...) method.<BR/><BR/>Regards,<BR/>AndrejusAndrej Baranovskijhttps://www.blogger.com/profile/04468230464412457426noreply@blogger.comtag:blogger.com,1999:blog-5874979429188093780.post-91459853583608724072008-02-13T12:24:00.000+01:002008-02-13T12:24:00.000+01:00Hi Andrejus,I have created a Master-Detail af:tabl...Hi Andrejus,<BR/>I have created a Master-Detail af:table components as u said<BR/>It is working perfectly for me.<BR/>But I have another requirement.<BR/>When I create and save a new row in Details table,I also want to insert<BR/>these values into another independent table also.<BR/>Please let me know how to do this.<BR/>Thanks <BR/>ANSAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-5874979429188093780.post-64991939887609580042008-01-22T12:16:00.000+01:002008-01-22T12:16:00.000+01:00Hi Neetha,You can just drop me an email. I will se...Hi Neetha,<BR/><BR/>You can just drop me an email. I will send you that application I developed for Vijaya.<BR/><BR/>Regards,<BR/>AndrejusAndrej Baranovskijhttps://www.blogger.com/profile/04468230464412457426noreply@blogger.com