Hierarchy component

10 Oct '14, 03:57 PM
61,585 Views
Forum Forum Starter - Level 2

In my WebRatio 7.2.0 project I'm using a hierarchical list, but it dosn't display what I expect.

I defined the entity Titolario in domain model with a 1-N relationship to itself. In the database table, I've inserted some records with NULL in titolario_oid column if they are parents and the parent's oid if they are children. In a site view I put a Hierarchy Component with these parameters: Entity, Display Attributes, Sort Attributes, Level Order. I put also a level under the hierarchy, with the same entity and attributes and Rel. Role equal to ChildToParent relationship.

What I get is a list where I see parent records one time (correct) but children records twice.

What am I doing wrong?

Thanks.

Luciano Sulis
 

 
x 0
Follow
Answer Answer at this question and get points!
Forum Starter - Level 3

Hi Luciano,


the Hierarchy Component is thought to display a nested list of elements coming from different entities connected by relationships.
The behaviour you described is correct, because in your case, the Hierarchy Component displays all the records in Titolario and then, it display a child element for those having one. 
In this way children elements are displayed twice: once because they belong to the entity Titolario, and twice because they belong to the Level you defined on the Hierarchy.

If you want to obtain a proper result, you should use the Recursive Hierarchy Component, that allows to display a nested list of elements coming from the same entity and connected by a recursive relationship.

 

You can fine more details in the following online lesson:

http://www.webratio.com/learn/learningobject/advanced-master-detail

 
x 0
Forum Starter - Level 2

Thanks Antonella. I didn't understand the hierarchy behavior. I tried to use recursive hierarchy, but I got no record. If I mark "Show all as root" I got all the records, but in a flat format of course. I put in Child to Parent Role my ChildToParent relationship. I didn't put any conditional expression.

Luciano

 
x 0
Forum Starter - Level 3

Using the "Show all as root" property you should obtain the same result as using the Hierarchy Component. So, you should uncheck that property.

When you set the "Entity" property for the Recursive Component, WebRatio Platform automatically set the "Child To Parent Role" property (if there is a unique recursive relationship on your entity). So I think that property is properly set.

According to what you wrote, I think that you should check if the "Display Attribute" property is empty, or if something is changed in your data.

 
x 0
Answer at this question and get points!

Related questions

404 on generated app page 500 error with WebRatio BPM 502 proxy error-generate and run Admin area disabled aggiornamento fallito a causa di un errore interno Ajax and FCK Editor (WebRatio 5.x) AJAX events problem to external JavaScript Ajax onchange and jQuery 2.x (with migrate plugin) incompatible Ajax on change selection field and modify units Any sample deployment Autocomplete template Automatic date in form Automatic file upload BPMN: URL field Cannot invoke method putAll() on null object Cannot invoke method selectSingleNode() on null object Can't run any aplication ckeditor - change directory for the browser Clean a form Code is exceeding the 65535 bytes limit error on JBOSS Como crear cambio de contraseña Como tener dos botones juntos en un formulario independientes de una accion? Como usar la función autocomplete en un field Compare with the current time Component computation com.webratio.struts.exceptions.WRSecurityException: Invalid request target host Connection refused. coupled mandatory fields Cryptic error when submitting a form Database connection, Host and Port number DB in Data Service Project Debug configuration Dependencies installation error Disabilitare campi durante evento AJAX Drop down menu question Dudas sobre modelado(Data Flow,Forms y Operation Create) Dynamic attribute/field names. Possible? Dynamic instantiation of fields on a page for any Class type Empty record mistakenly saved entry form logic. Entry Unit - Default field timestamp Entry Unity, Field Date Type Error error activating student account Error deploying WAR against to JBOSS Error updating metadata process Error when updating to WR 7.2.3 Field as link soruce Filtros Caracteres Especiales Find Model Problemas Format currency Form element Form template From BPM to WebProject - BUILD FAILED Generation errors on ajax enabled page with many components, ajax links and selective refresh "Generation Error" with Generate and Run Getting the absolute path of a RTXBLOBData Groovy script numer after an error HelloWorld Unit sample code Help with math unit. Debug mode says error as result code Hide form until a flow is triggered Hiding form components based on page conditions How I can receive the primary key value after adding into database from OK Port. how to delete this error? How to get a wr:AjaxURL tag working How to redirect to the correct site view after a successful login attempt i can't install mobile version on windows I can't install Webratio on my Desktop (Ubuntu 13.04 x64) I can't run any application with WebRatio (Table/View 'APP.POST' does not exist) input mask Installation with java 1.8 Installazione Macosx invio mail fallito java.lang.NullPointerException java virtual machine error Job not start correctly JSP/DO issues on Tomcat 5.5 (Ubuntu) Login Error mandatory control code parameter is missing Mensaje: the selection cannot be launched and there are no recent launches Missing plugin emulation support error Missing units when importing project Multi Entry Unit: How to forward only checked rows? Multi-Image Upload Multiple forms on one page. HTML5 input attributes. Possible? (2 questions) multi selections field problem Multi Selects didn't work in update page Next Activity Note property - Error synchronizing with web project No access to protected site view with Login No Apache Derby driver found No database on my cloud account Page Home - First time the Project Web begins Prelevare la chiave del record da una Selection Field in una Multiple Form Problema al generar y ejecutar proyecto Problema generazione codice Problema Grafo da una lista gerarchica Problema ¨HTTP Status 404" Problemas con el Operations View Delete Problem: Compile Failed problemi installazione su Mac sistema operativo OSX El Capitan problem on first deploy with webratio Problem saving multi selection from input Problems to connect Sql Server DB from Webratio Problem syncing reports Problem to run an Application Problem with application runnung Problem with execution of webratio Problem with ireport Problem with the deletion of more than 50.000 records in a table Progress bar when uploading big file(s) in a form? Project cannot be opened with WebRatio Community Platform Pulire URL Redirecting users to another site view Resize fields Sample web application Search by Selector component does not work selection fields on cascade Select multiple files for upload Setting Upload directory Showing items that have a relation with an entity Slot in Selection Field Solve "Generation Error" with Generate and Run option Student reserved area, download error Table 'freeapp43.profesion' doesn't exist Tomcat external session store and WebRatio webapp. "Unable to close sub-context ..." Unable to compute the controller URL(s) for applicationUnable to compute the controller URL(s) for application having status PROVISIONING Unable to connect to Internet Unable to execute the script java.lang.NullPointerException Unable to find Cloud free function Unable to get ExpenseReport example work in WebRation Personl 7.2.2 Unable to instantiate a new application instance Unable to update the web project Unspecified BPM Engine Database Update fields based on selection of other fields Updating attributes of an entity upload file and the move it to other location upload file html Uppercase User Login Timestamp Uso de la componente chart de webRatio Validacion validation fields Value Length (Min) fails to validate when field is empty? Webratio Add-ons no permite login Web Ratio Add-ons shop not working WEBRATIO LINUX AT EXECUTION TIME Web Ratio Mobile plateform Macos Sierra Web Ratio Mobile - Remote data mapping problem WebRation - Create Navigation diagram What are the new features of WebRatio 6.1? When execute my web application I have this error: returned a null bean which of these three models is closer to webratio/ifml way of creating web applications XPCOM Error