Showing posts with label ADF - Basics. Show all posts
Showing posts with label ADF - Basics. Show all posts

Thursday, 12 June 2014

SVN - The Good The Bad and The Ugly

SVN - History

So Recently I was told by someone that SVN "Looses" History, because the information he committed is not there.

So I wanted to do some Experiments.

What I needed

  • Local SVN
  • Project
  • Files

Initially, I created a local SVN Using Tortoise SVN.
Then I created a small Hello World Project Using ADF, with one page, and as we all know, doing something so simple creates many folders.
First Commit

Browse


First Log

When I add a Task Flow, with a page, the commit looks like this;
Task Flow Commit

If you press ok, at this stage without any changes, you task flow WILL NOT, i repeat WILL Not be committed to SVN. The folder icon will also be changed to look like it has all been committed.

After this, there are two scenarios that may happen after this, if you carry on working from the same project, everything will work as expected.

If you download the project from SVN, you will get errors, most probably ones saying the pages do not exist.

SVN Commit

When doing this make sure, if any new files were added, add them to be committed. 
non-versioned Commit
Commit Log
Make sure the non-versioned Status has been Checked. This can be done by clicking all, just above the file names.

Log

Please Note: The Actions in the Log, in the above picture, there are only adds, and Modifies. In the Below One there is a delete as well as Modify.


One thing to note: is now that I have done all this, no matter what I do on the SVN, those logs will never be changed.

The only things that one can change are the Author and "Message"

This is a very limited example of a SVN Server with Revisions, but I just wanted to show that there are certain things that you cannot do with a SVN, and there are certain things that one needs to do, otherwise your SVN commits will break the application.

#bearMan, f

Monday, 30 September 2013

ADF Basics: Refresh UIComponent within Manage Bean

ADF Basics: Refresh UIComponent within Manage Bean

This is a quick code tip:

     /**
*import javax.faces.component.UIComponent;
*
* PPR UIComponent
*
* @param UIComponent - The UIComponent wanting to be refreshed
*
*/
    public void refreshComponent(UIComponent component){
        AdfFacesContext.getCurrentInstance().addPartialTarget(component);  
    }

ADF Basics: Find UIComponent within Manage Bean

ADF Basics: Find UIComponent within Manage Bean

This is a quick code tip:

     /**
* FindUIComponent
*
* @param UIComponent - The UIComponent ID you are wanting to find
*
*/
private UIComponent findUIComponent(String name) {  
 FacesContext facesCtx = FacesContext.getCurrentInstance();  
 return facesCtx.getViewRoot().findComponent(name) ;  
}

#bearMan

Tuesday, 17 September 2013

ADF Basics: Printing Behavior

ADF Basics: Printing Behavior

Hi

I will be showing you how to use the ADF showPrintablePageBehavior Component, how to get what you want to display on the "Print Ready Page"

ADF Print Demo Application can be downloaded here

I Created two Pages, both of which have have the same Components (Nearly), both pages have a button either to "Print" the Table Alone, or the Whole Page.

On the page where it prints only the Table, I surrounded the table with a panelCollection, and in the toolbar Region, I put the button with the showPrintablePageBehavior.
<f:facet name="toolbar">
 <af:toolbar id="t2">
   <af:commandToolbarButton text="Print Table"
                            id="ctb1">
     <af:showPrintablePageBehavior/>
   </af:commandToolbarButton>
 </af:toolbar>
</f:facet>

ADF Before Printed
Before Printed

ADF Table Printed
Printed


With the Page Print, I surrounded the whole page with a panelHeader and within that toolbar Region I added the same Button.
<f:facet name="toolbar">
 <af:toolbar id="t2">
   <af:commandToolbarButton text="Print Table"
                            id="ctb1">
     <af:showPrintablePageBehavior/>
   </af:commandToolbarButton>
 </af:toolbar>
</f:facet>

Before Printed ADF panelHeader
Before Printed


Printed ADF panelHeader
Printed

Extra

If you don't want a component to show when in Printing mode
use this EL expression in the Applicable Property
"#{adfFacesContext.outputMode eq 'printable' ? false : true}

Panel Box, not to display header
showHeader="#{adfFacesContext.outputMode eq 'printable' ? 'never' : 'ifNeeded'}"


Regards
#bearMan.