This is default featured slide 1 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 2 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 3 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 4 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 5 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

Pages

Friday, April 5, 2013

Oracle ADF Form validation from managed bean and show the pop-up error message

So i have a case that i create a BPM Process and auto-generate the task form and then i have to validate user input at the task form. by default, the Submit form button is cannot do validation. so i have to change the autogenerated button with other button.

this link would redirect you to the original tutorial i follow to create new button to do the validation function.
http://niallcblogs.blogspot.com/2011/05/bpm-adf-form-streamlining-saveapprove.html
for the default submit button section, you could search for <af:commandToolbarButton> with <f:attribute name="DC_OPERATION_BINDING" value="bindings.SUBMIT"/> value.
i just comment that section using '<!-- -->' typical comment in html.



from the niall blogs, when you submit your form, it just return "closeTaskFlow" string to end the taskflow process, previously i try it in a pop up new window, the window won't close after i submit the form.
if you are having same case, add a javascript to close your pop up window.


        FacesContext facesContext = FacesContext.getCurrentInstance();
        ExtendedRenderKitService service = Service.getRenderKitService(facesContext, ExtendedRenderKitService.class);
        service.addScript(facesContext, "window.opener = self;window.close();");


in your validation function, you can add this code to show a message pop up whether the form still has dirty data.


        FacesContext facesContext = FacesContext.getCurrentInstance();
FacesMessage facesMsg = new FacesMessage(FacesMessage.SEVERITY_ERROR, null, msg);
facesContext.addMessage(null, facesMsg);


at my case, i want to display a multiline error message in the pop up. you can do that with putting a <html> and <body> tag in the message. i got that from this tutorial.
http://mjabr.wordpress.com/2011/08/31/how-to-show-multi-lines-afmessage/

credit to original author :)


Oracle AppModule Error when run

I got an error when trying to test a AppModule that i already set up using the integratedWeblogicServer. i got a error pop up from the JDEV, the error code is like this :

(oracle.jbo.ConfigException) JBO-33001: Configuration file /tester.xcfg is not found in the classpath.

and the error code from the console is like this :


MDS-01370: MetadataStore configuration for metadata-store-usage "mstore-usage_1" is invalid.  
MDS-01368: Variable "oracle.home" used in configuration document is not defined either as system property or as envrionment variable.

oracle.mds.config.MDSConfigurationException: MDS-01330: unable to load MDS configuration document  
MDS-01329: unable to load element "persistence-config"
MDS-01370: MetadataStore configuration for metadata-store-usage "mstore-usage_1" is invalid.  
MDS-01368: Variable "oracle.home" used in configuration document is not defined either as system property or as envrionment variable.

trying to google the solution and find an interest one. try to set up your ORACLE.HOME environment variable. and point it to your <JDEV> folder. Remember to restart your JDEV before you test it.

voila, the AppModule should be run succesfully now !