News: Order Styplon Flovent Cheap Zocor Cheap Nexium Female Sexual Cheap Zimulti Ventolin Cheap V-Gel Cheap Avandia Buy Nonoxinol Order Bupropion Reosto Cheap Xanax Cheap Aristocort Feldene Female Viagra Order Tricor Buy Sumycin Purchase Accutane Order Topamax Atrovent Buy Darvocet Cozaar Order Micardis Cheap Himcospaz Sorbitrate Order Reosto Purchase Cephalexin Buying Didrex Buy Aristocort Vytorin Order Dilantin Herbal Maxx Speman Order Omnicef Order Monoket Purchase Methocarbam Cheap Lanoxin Levlen Cheap Valium Order Femara Purchase Atrovent Adipex Purchase Zyvox Purchase Adalat Trandate Cheap Starlix Purchase Lotensin Buy Viagra Cheap Myambutol Cheap Adipex Cheap Zyvox Purchase Nicotinell Buy Famvir Actos Order Zestril Buy Hytrin Purchase Tramadol Eurax Purchase Kamagra Purchase Zovirax Order Mycelex-G Buy Phentermine Evista Buy Coreg Confido Order Zanaflex Purchase Bactroban Cardizem Cheap Tramadol Buy Aldactone Cheap Viramune Cheap Seroquel Cheap Stromectol Purchase Acyclovir Cheap Xeloda Purchase StretchNil Cheap Didronel Purchase Retin-A Crestor Cheap Buspar Cheap Singulair Cheap Inderal Lamisil Cheap Femcare Lopressor Purchase Prozac Buy Karela Purinethol Buy Consultation Order Cardizem Buy Lotensin Purchase Cystone Buy Imitrex Order Paxil Purchase Imdur Buy Lasix Buy Feldene Order Prinivil Buy Antabuse Serophene Buy Desyrel Cheap Allegra Purchase Diazepam Prozac Order Detrol Buy Sorbitrate Buy Bactroban Purchase Codeine Purchase Zetia Cheap Procardia Order Tenuate Lynoral Flonase Buy Parlodel Purchase Amoxil Buy Shallaki Order Prednisone Cheap Clomid Buy Crestor Buy Lopressor Order Lynoral Cheap Geriforte Arimidex Cytotec Order Endep Purchase Actos Cheap Ansaid Order Butalbital Purchase Mexitil Purchase Xanax Buy Menosan Kamagra Buy Viramune Order Protonix Order Altace Buy Valium Purchase Ventolin Purim Omnicef Grifulvin V Order Aceon Cheap Evecare Order Serophene Purchase Aldactone Hoodia Buy Danazol Order Cozaar Buy Zyvox Order CLA Buy Adalat Purchase Avandamet Buy Butalbital Order Nonoxinol Purchase Nolvadex Cheap Sustiva Hydrocodone Cheap Xenacore Zestril Order Neurontin Purchase Cozaar Purchase Altace Cheap Pilex Buy Diakof Purchase Hytrin Order Feldene Buy Trimox Cheap Revia Buy Pravachol Order Ionamin Purchase Cialis Purchase Menosan Fioricet Purchase Femara Purchase Leukeran Purchase Mevacor Order Ultram Prandin Cheap Lorazepam Order Shoot Buy Rocaltrol Order Copegus Wellbutrin SR InnoPran XL Buy Carisoprodol Ultimate Male Urispas Tiberius Erectus Penis Growth Buy Confido Zantac Order Zyprexa Order Hydrocodone Cheap Geodon Flomax Purchase Feldene Buy Lortab Herbal Phentermine Purchase Levothroid Purchase Geodon Cheap Exelon Xanax Order Nicotinell Buy Avapro Cheap Loxitane Cheap Requip Buy Zocor Buy Koflet Cheap Plendil Buy Serevent Buy Diazepam Order Calan Cheap Vasodilan Order Cystone Zocor Order Mexitil Purchase Serophene Purchase Levitra Order Zebeta Purchase Amaryl Buy Superman Cyklokapron Order Ashwagandha Order Zyloprim Buy Lozol Lipitor Cheap Pletal Purchase Rumalaya Purchase Lopressor Cheap Aldactone Buy Styplon Women Attracting Cheap Omnicef Septilin Cheap Tenuate Himcospaz Buy Trazodone Cipro Mexitil Cheap Himcocid Order Famvir Cheap Clarina Cheap Maxaquin Cheap Abana Cheap Confido Buy Purim Order Keftab Buy Bontril Purchase Lasix Buy Celexa Norco Cheap Avandamet Purchase Famvir Purchase Detrol Buy Tramadol Depakote Buying Alprazolam Purchase Celexa Purchase Diflucan Plavix Cheap Norvasc Buy Effects Buy Requip Order Noroxin Zebeta Order Acticin Buy Synthroid Buying Viagra Purchase Neurontin Order Antabuse Purchase Buspar Buy Flomax Coreg Herbolax Order Isordil Cheap Mysoline Cheap Claritin Zimulti SleepWell (Herbal Glucotrol XL Buy Dospan Buy CLA Cheapest Adipex Buy Azulfidine Premium Diet Purchase Hyzaar Buy Seroquel Cordarone Cheap Sinequan Diabecon Order Penisole Buy Renalka Didrex Purchase Singulair Order Biaxin ActoPlus Met Buy Calan Altace Pulmicort Inhaler Buy Allegra Buy Flovent Order Premarin Cheap Tricor Cheap Pravachol Allegra Order Ansaid Buy Prescriptions Order Aristocort Lotensin Purchase Renalka Zyvox Purchase Ashwagandha Acyclovir Cheap Lozol Order Gasex Purchase Emsam Mentax Buy Arimidex Detrol Order Percocet Cymbalta Lorazepam Buy Zyrtec Purchase Speman Cheap Lopid Buy Hyzaar Cheap Aceon Buy Cozaar Buy Rumalaya Purchase Diarex Order Actos Buy Nicotinell Buy Hydrochloride Buy Imdur Zerit Cheap Zerit Buy Dostinex Purchase Prometrium Cheap Nizoral Purchase Prilosec Purchase Oxycontin Buy Serophene Chitosan Cheap Hydrocodone Avodart Purchase Lynoral Cheap Glucophage Ephedrine Buy Cardizem Cephalexin Order Clomid Cheap Pamelor Lukol Order Levlen Buy Snoroff Cheap Azulfidine Buy Fosamax Order Flexeril Purchase Pilex Clomid Purchase Cymbalta Vantin Cheap Feldene Myambutol Purchase Zyban Buy Trandate Cheap Detrol Order Rogaine Buy Zyprexa Cheap Hytrin Purchase Noroxin Cheap Ophthacare Celexa Order Atacand Order Cardura Amaryl Prometrium Cheap Crestor Buy Plavix Order Cipro Purchase Zestril Order Ambien Purchase Lipitor Purchase Proscar Order Lanoxin Order Levitra Order Sinequan Watson Order Pilex Purchase Starlix Cheap Cystone Order Celexa Methocarbam Cheap Famvir Zyban Purchase Augmentin Cheap Methocarbam Purchase Arava Buy Sinequan Toprol XL Order Proventil Cheap StretchNil Buy Differin Norpace CR Cheap Levaquin Nonoxinol Cheap Trandate Buy Zelnorm Purchase Maxaquin Butalbital Cheap Trazodone Cialis Cheap Antabuse Purchase Omnicef Buy Diabecon Purchase Purinethol Proventil Cheap Atarax Cheap Vasotec Purchase Norco Cheap Himplasia Virility Gum Order Diakof Cheap Topamax Oxytrol Buy Eurax Purchase Snoroff Himcolin Buy Tulasi Order Glucophage Cheap Rumalaya Order Amaryl Deltasone Cheap Tenormin Cheap Flonase Purchase Butalbital Cheap Rogaine Micardis Buy Nizoral Darvocet Relafen Buy Prometrium Cheap Lamictal Order Zelnorm Buy Prednisone Buy Sarafem Lasix Cheap Flexeril Buy Biaxin Buy Zovirax Order Flomax Order Ephedrine Buy Shoot Ordering Didrex Cheap Rocaltrol Aldactone Cheap Lariam Loxitane Buy Cyklokapron Buy Cialis Purchase Xenacore Cheap Proventil Buy Vasodilan Buy Stromectol Purchase Lotrisone Order Diarex Order Naprosyn Buy Purinethol Cheap Atacand Buy Loxitane Purchase Oxytrol Cheap Evista Cheap Speman Buy Plendil Purchase Lukol Purchase Parlodel Order Rumalaya Mycelex-G Cheap Quibron-T Geodon Order Flovent Purchase Sumycin Buy Buspar Flexeril Order Geodon Order Prevacid Purchase Sinequan Buy Claritin Buy Capoten Buy Oxycontin Pilex Avandia Buy Soma Purchase Risperdal Purchase Viagra Monoket Order Pamelor Abana Inderal Orgasm Enhancer Cheap Darvocet Diazepam Cheap Urispas Buy Kytril Cheap Penisole Quibron-T Cheap Femara Buy V-Gel Flagyl ER Cheap Micardis Cheap Proscar Buy Celebrex Order Nirdosh Cheap Ambien Lariam Adderall Brafix Purchase Mentax Purchase Percocet Buy Glucophage Acticin Order Prandin Order Mobic Hyzaar Order Elavil Prilosec Trazodone High Love Order Lukol Himcocid Menosan Buy Vantin Order Trazodone Buy Norco Cheap Deltasone Order Oxycontin Buy Zyloprim Cheap Zyrtec Cheap Prinivil Order Ventolin Order Diabecon Order Evecare Buy Lincocin Capoten Purchase Zanaflex Purchase Nizoral Purchase Depakote Purchase Effexor Order Himcolin Purchase Ophthacare Buy Mexitil Order Acomplia Purchase Plavix Order Aldactone Buy Quibron-T Clarina V-Gel Buy Ventolin Buy Emsam Order Nexium Cheap Reosto Purchase Diabecon Diarex Order Dostinex Cheap Menosan Cheap Cephalexin Purchase Lopid Buy Avandia Cheap Prilosec Cheap Cardura Order Lasix Order Azulfidine Cheap Dilantin Order Aricept Order Zyban Order Eurax Cheap Ismo Purchase Loxitane Purchase Synthroid Cheap Rimonabant Purchase Calan Meridia Order Meridia Lioresal Purchase Stromectol Purchase Ansaid Himplasia Dilantin Cheap Monoket Purchase Pamelor Order Differin Order Vantin Buy Fioricet Shuddha Guggulu Sustiva Cheap Danazol Order V-Gel Purchase Evecare Cheap Cordarone Prednisone Order Prometrium Buy Clarina Purchase Triphala Buy Zebeta Effexor Buy Urispas Lexapro Buy Lasuna Cheap Zyprexa Purchase Inderal Cheap Emsam Buy Lexapro Order Prozac Purchase Revia Cheap Lynoral Purchase Zithromax Buy Procardia Cheap Percocet Calan Buy Flexeril Buy Amaryl Zero Nicotine Order High Starlix Mevacor Desyrel Buy Proscar Buy Exelon Noroxin Buy Starlix Cheap Sumycin Cheap Brahmi Purchase Requip Purchase Imitrex Order Brafix Cheap Lasix Buy Depakote Buy Monoket Purchase Sildenafil Lasuna Buy Acticin Order Maxaquin Buy Codeine Purchase Aceon Bactroban Order Kytril Evecare Cheap Noroxin Purchase Clonazepam Order Risperdal Pletal Levaquin Danazol Purchase Chitosan Viramune Rythmol SR Purchase Loprox Purchase Cordarone Cheap Naprosyn Ultram Order Claritin Purchase Ambien Purchase Himcospaz Cheap Celebrex Purchase Purim Buy Arava Order Lotensin Men Attracting Femara Zelnorm Buy Abana Purchase Diakof Bontril Diet Maxx Buy Lotrisone Cheap Prevacid Buy Penisole Purchase Soma Buy Topamax Cheap Norco Cheap Loprox Kytril Buy Lopid Order Bactroban Cheap Ashwagandha Buy Mevacor Purchase Lincocin Order Didrex Cheap Renalka Prevacid Order Zerit Buy Tricor Buy Zithromax Cheap Diazepam Brahmi Cheap Mexitil Cheap Levothroid Order Ophthacare Order Liv.52 Order Himcocid Vitamin A Order Hytrin Purchase Evista Order Xeloda Order Quibron-T Order Stromectol Cheap Cyklokapron Buy Xenacore Aristocort Purchase Phentermine Order Zocor Purchase Lozol Order Lotrisone Cheap Acyclovir Cheapest Generic Hoodia Weght Buy Nolvadex Order Cymbalta Snoroff Soma Cheap Acomplia Synthroid Order Mysoline Cheap Diakof Order Methocarbam Cheap Sarafem Mental Booster Cheap Isordil Buy Aciphex Purchase Zyloprim Order Himcospaz Cheap Acticin Cheap Serevent Buy Lipitor Rimonabant Cheap Lukol Claritin Order Karela Buy Proventil Rhinocort Purchase Lamictal Purchase Sorbitrate Purchase Mycelex-G Order Cephalexin Purchase Rhinocort Buy Aricept Adalat Purchase Ismo Buy Casodex Order Superman Leukeran Viagra Jelly Buy Singulair Order Accutane Cheap Copegus Order Seroquel Order Zetia Purchase Adderall Zyloprim Shoot Order Retin-A Cheap Parlodel Order Prograf Buy Prandin Topamax Karela Buy Speman Buy Prilosec Superloss Multi Purchase Clarina Order Elimite Dostinex Cheap Aciphex Cheap Flomax Menopause Gum Purchase Danazol Order Zyvox Atacand Order Chitosan Order Lincocin Purchase Clomid Buy Cipro Buy Aleve Order Rimonabant Purchase Lasuna Augmentin Buy Atacand Purchase Vasotec Purchase Superman Order Cordarone Purchase Propecia Order Vasodilan Cheap Cipro Buy Herbolax Purchase Meridia Buy Ashwagandha Order Pravachol Order Sumycin Order Ismo Order Triphala Buy Pamelor Purchase Lisinopril Buy Omnicef Purchase Isordil Order Nizoral Purchase Levlen Cheap Alprazolam Buy Phentrimine Cheap Clarinex Order Rocaltrol Buy Geodon Cheap Amaryl Ophthacare Buying Adipex Purchase Sarafem Purchase Combivent Buy Didronel Buy Rogaine Buy Isordil Nexium Cheap Accutane Purchase Biaxin Buy Ephedrine Order Aleve Cheap Diflucan Cheap Nimotop Styplon Buy Atrovent Purchase Atarax Cheap Hoodia Cheap Purinethol Purchase Quibron-T Purchase Herbolax Green Tea Buy Paxil Buy Tenuate Tulasi Cheap Clonazepam Ansaid Purchase Flonase Buy Propecia Hytrin Order Norvasc Purchase Xeloda Cheap Bupropion Cheap Ativan Order Sarafem Cheap Nonoxinol Cheap Zithromax Cheap Zyloprim Buy Avandamet Cheap Lopressor Cheap Chitosan Order Avapro Cheap High Sarafem Buy Adipex Purchase Zocor Order Exelon Purchase Brahmi Purchase Acticin Amoxil Buy Online Buy Prevacid Cheap Retin-A Cheap Adalat Order Accupril Order Valium Order Urispas Purchase Fosamax Buy Revia Buy Deltasone Order Lariam Purchase Karela Buy Prozac Penisole Order Cyklokapron Purchase Nirdosh Levitra Protonix Purchase Abana Cheap Aricept Buy Himcospaz Order Hyzaar Order Coreg Buy Accutane Paxil Loprox Cheap Ephedrine Purchase Clarinex Cheap Levitra Cheap Levlen Diflucan Buy Evecare Cheap Plan Cheap Carisoprodol Purchase Miacalcin Order Lortab Buy Evista Purchase Zimulti Order Cialis Order Brahmi Cheap Brafix Atarax Order Flonase Cystone Mobic Purchase Elimite Order Koflet Fosamax Purchase Koflet Order Depakote Buy Loprox Buspar Rumalaya Forte Glucophage Cheap Tulasi Order Capoten Purchase Nimotop Order Zovirax Cheap Lincocin Lamictal Order Himplasia Premarin Order Avandamet Cheap Cozaar Keftab Lozol Cheap Leukeran Cheap Triphala Buy Rhinocort Order Casodex Purchase Eurax Purchase Flovent Purchase Zantac Cheap Capoten Buy Brite Zovirax Biaxin Purchase Copegus Buy Endep Purchase Shoot Cheap Prednisone Purchase Geriforte Buying Ultram Accutane Purchase Mysoline Cheap Depakote Order Cytotec Purchase Prednisone Lotrisone Purchase Prandin Hair Loss Purchase Ultram Acomplia Purchase Liv.52 Cheap Nicotinell Cheap Diarex Order Sorbitrate Buy Atarax Buy Ophthacare Cheap Prandin Buy Lisinopril Order Herbolax Order Zyrtec Purchase Tenuate Cheap Cymbalta Order Atrovent Order Adalat Buy Vicodin
News Blogs: Sensation! Cigarettes Sale Auto Free Ringtones Balans Credits Åables Soma online Pills, Compare pills, Reviews pills Autos mp3 music for mobile Cases Cars Sportswear Xanax online Free Ringtones furniture Cialis online Dating Replica Rolex Ladies handbag Evening dress Cigarette Online notebook shop Ambien online Yachts Loan Online Chairs FDA Approved Pharmacy Tramadol online Fioricet online Ornaments Blog Search the Web Adipex online Valium online Bracelets Phentermine No Prescription Top auto-moto Fashions Cheap drugs online shop ya.by Green Card Information Ear rings Rolex Replica Mobiles Top casino Boots Chronometer Suits Hydrocodone online Necklace Download Ringtones Free mp3 ringtones auto-moto Rington Underwear Vicodin online Get ringtones online Boats Medicine news Intimate goods

Recent Posts

Archives

Categories


« JDeveloper 11 TP4 is out on OTN | Main | ADF Faces RC: How-to configure a custom Splash Screen »

ADF Faces: ADF Faces Tree Drilldown Example

By frank.nimphius | May 2, 2008

Another lost example: The workspace linked by this blog entry shows how to use a command link to drill down to detail records shown in a table.

The drilldown functionality - though not shown as a stand alone example - is documented by Steve Muench in the context of the ADF BC version in the SRDemo and the ADF Business Components developer guide. In this blog entry I'll give you two examples - the one provided in the developer guide and one less declarative but code centric example.

The ADF BC Developer Guide version

The ADF BC Developer Guide version sets the row currency for the data displayed in the form by clicking on the tree node links. To get to a specific user entry, you click the location node, expand the department node and then click onto the user name entry.

Clicking the department node entry shows the first record by default, which allows you to build an input form with navigation buttons. While this works nicely, having to click on each and every tree node along the path down to the user entry may not be considered user friendly.

Firstly, make sure you created iterators for each of the ViewObjects invloved: LocationsView, DepartmentsView, EmployeesView

This solution is implemented through the setCurrentRowWithKey operation, which is exposed as an operation on the LocationView, DepartmentsView and EmployeesView. Open the pageDef file in the Structure Window and select the bindings node.

From the context menu select the option to create a new Action. Select the LocationView instance that represents the top view in the tree structure. Choose the setCurrentRowWithKey option from the drop down.

Its important to set the rowKey value to #{node.rowKeyStr} so that the selected node's key value is passed to the operation. the "node" string is a variable name contained in the page when building the tree and you have to type it into the value field (the ExpressionLanguage builder doesn't see this variable name)

After building the action, make sure you give it a good and readable name by changing the default name in the property inspector for the action.

Next step is to create a binding of the tree component to a managed bean. The binding is used later to detect the depth of the tree, which is important for the command link to access the right setCurrentRowsWithKey action.

The tree nodes are defined by three command link components, according to the expected tree depth of location -- department -- employees.

Each of the command links is displayed or hidden based on one of the following conditions added to the "rendered" property

#{TreeManagedBean.treeHandler.depth==0}
#{TreeManagedBean.treeHandler.depth==1}
#{TreeManagedBean.treeHandler.depth==2}

This means that e.g. the command link with the ActionListener set to execute the setCurrentRowWithKey operation for the employees view, is shown or hidden by #{TreeManagedBean.treeHandler.depth==2}

Last, but not least, each of the command links needs to be linked to one of the setCurrentRowWithKey actions.

This way, when the node is clicked on, the underlying ViewObject row currency is set to the selected row. Also note that the command links don't use PPR (partial submit = false).

XML:
  1. <h:panelGroup>
  2.       <af:commandLink text="#{node}" partialSubmit="false"
  3.       id="nodeAction1"
  4.       actionListener="#{bindings.setCurrentLocationRowWithKey.execute}"
  5.       rendered="#{TreeManagedBean.treeHandler.depth==0}"/>
  6.       <af:commandLink text="#{node}" partialSubmit="false"
  7.       id="nodeAction2"
  8.       rendered="#{TreeManagedBean.treeHandler.depth==1}"
  9.       actionListener="#{bindings.setCurrentDepartmentsRowWithKey.execute}"/>
  10.       <af:commandLink text="#{node}" partialSubmit="false"
  11.       id="nodeAction3"
  12.       rendered="#{TreeManagedBean.treeHandler.depth==2}"
  13.       actionListener="#{bindings.setCurrentEmployeesRowWithKey.execute}"/>
  14.       </h:panelGroup>
  15.  
  16.       Note that for the JSF form to show the selected employee, the input form must be based on the EmployeeView instance contained in the LocationView tree.

Custom example

The custom example solves the usability concern of the version documented in the ADF BC developer guide so tha only the leaf nodes are shown as hyperlinks. Later, in the implementation, you will see that the risk with this version lies in how the node tree key is parsed.

As for the documented ADF BC tree drill down example, you need to create iterator bindings for all the ViewObject instances that are involved. Also you need to create a binding from the tree component to a managed bean.

Instead of using three command links that are used in the previouse example, you use one output text component and one command link. The command link is set to partial submit and also has an id assigned to it so it triggers the refresh of the JSF input form.

Note that the output text component is rendered for all tree depth that are below 2, whcih means for locations and employees.

The ActionListener property on the commandLink component is set to #{TreeManagedBean.nodeSelected}, which is a managed bean method.

CODE:
  1. public void nodeSelected(ActionEvent actionEvent) {
  2.  
  3.       String rowKeyStr = getTreeHandler().getRowKey().toString();
  4.       String[] path = rowKeyStr.split(", ");
  5.  
  6.       if (getTreeHandler().getDepth()==2) {
  7.       int locIndx = new Integer(path[0].substring(1)).intValue();
  8.       int depIndx = new Integer(path[1].substring(0)).intValue();
  9.       int empIndx = new Integer(path[2].substring(0,path[2].indexOf("]"))).intValue();
  10.  
  11.       // System.out.println(locIndx);
  12.       // System.out.println(depIndx);
  13.       // System.out.println(empIndx);
  14.  
  15.       FacesContext fctx = FacesContext.getCurrentInstance();
  16.       ValueBinding vb = fctx.getApplication().createValueBinding("#{bindings.LocationsView1Iterator}");
  17.       DCIteratorBinding dciterLocationsView = (DCIteratorBinding)vb.getValue(fctx);
  18.       dciterLocationsView.getRowSetIterator().setCurrentRow(dciterLocationsView.getRowAtRangeIndex(locIndx));
  19.  
  20.       vb = fctx.getApplication().createValueBinding("#{bindings.DepartmentsView3Iterator}");
  21.       DCIteratorBinding dciterDepartmentsView = (DCIteratorBinding)vb.getValue(fctx);
  22.       dciterDepartmentsView.getRowSetIterator().setCurrentRow(dciterDepartmentsView.getRowAtRangeIndex(depIndx));
  23.  
  24.       vb = fctx.getApplication().createValueBinding("#{bindings.EmployeesView4Iterator}");
  25.       DCIteratorBinding dciterEmployeesView = (DCIteratorBinding)vb.getValue(fctx);
  26.  
  27.       int empRangeSize = dciterEmployeesView.getRangeSize();
  28.       int empRangeIndx = 0;
  29.       int empRowIndx = 0;
  30.  
  31.       if (empIndx + 1> empRangeSize){
  32.       empRangeIndx = empIndx/ empRangeSize;
  33.       empRowIndx = empIndx % empRangeSize;
  34.       dciterEmployeesView.getRowSetIterator().setRangeStart(dciterEmployeesView.getRangeSize()*empRangeIndx);
  35.       empIndx = empRowIndx;
  36.       }
  37.  
  38.       dciterEmployeesView.getRowSetIterator().setCurrentRow(dciterEmployeesView.getRowAtRangeIndex(empIndx));
  39.       //additional partial target needed to be set
  40.       AdfFacesContext.getCurrentInstance().addPartialTarget(formHandler);
  41.       }
  42.       }

Because the user clicks on an employee enttry only, the manage bean method parses the row key, which comes in the format of [location index, department index, employee index]

For example --- [0, 1, 13] identifies the 14th employee node of the second departments node under the first location

Knowing about the tree structure, this information is then used to determine the current row and setting it (similar to what clicking each of the commanLink does in the first example)

CODE:
  1. FacesContext fctx = FacesContext.getCurrentInstance();
  2.       ValueBinding vb = fctx.getApplication().createValueBinding("#{bindings.LocationsView1Iterator}");
  3.       DCIteratorBinding dciterLocationsView = (DCIteratorBinding)vb.getValue(fctx);
  4.       dciterLocationsView.getRowSetIterator().setCurrentRow(dciterLocationsView.getRowAtRangeIndex(locIndx));

The code line above sets the currentRow for the locations iterator based on the location tree node that the selected employee is a member of.

If you access ViewObjects that use page ranges, which is recommended to not always query the whole data, you must be aware of the possibility that a selected node - eg. employee node in this example - is not in the first (default) range. The range by default is set to 10 records. This setting is defined on the iterator binding properties.

To access the correct row, you need to get the range size out of the employee index. E.g. employee 23 means that it is the 4th record (counting starts by 0) in the 2nd range (also counting from zero)

CODE:
  1. int empRangeSize = dciterEmployeesView.getRangeSize();
  2.       int empRangeIndx = 0;
  3.       int empRowIndx = 0;
  4.  
  5.       if (empIndx + 1> empRangeSize){
  6.       empRangeIndx = empIndx/ empRangeSize;
  7.       empRowIndx = empIndx % empRangeSize;
  8.       dciterEmployeesView.getRowSetIterator().setRangeStart(dciterEmployeesView.getRangeSize()*empRangeIndx);
  9.       empIndx = empRowIndx;
  10.       }

Setting the range start ensures that the employee index (3 if the index number was 23) can be looked up

To run the application, you need to

Get the workspace from here

Topics: ADF Faces |

Comments are closed.


phentermine rxlist generic information does phentermine show on drug test canine arthritis phentermine contents of phentermine phentermine pictures dosages order phentermine hcl cod phentermine and mood iwant to purchase phentermine phentermine for sale in usa lose weight fast diet phentermine pill same day shipping on phentermine phentermine doctor weight loss ga cheapest phentermine 37.5x90 phentermine in green and white capsule phentermine and no presciption adjustable bed phentermine q searchers com phentermine show up in drug test