voyent
Mapping data in IceFaces  XML
Forum Index -> Portals & Portlets
Author Message
starzlordb

Joined: 03/Nov/2010 01:24:34
Messages: 3
Offline


Hi everyone,

I am currently developing an IceFaces portlet (1.8.2) for Liferay (6.0.5).

I need to view and edit an complex structure of data.

Let's say my backing bean has following data structure:

Code:
 class Test {
   private List<HashMap> data = null;
 
   public List<HashMap> getData() {
     if (data == null) {
       data = new ArrayList<HashMap>();
       
       HashMap<String, Object> test1 = new HashMap<String, Object>();
       test1.put("list", getAdditionalData);
       
       data.add(test1);
     }
 
     return data;
   }
 
   public void setData(List<HashMap> data) {
     this.data = data;
   }
 
   private List<HashMap> getAdditionalData() {
     // Another List<HashMap> will be created here
   }
 
   public void saveData(ActionEvent event) {
     // Store values from data in DB
 
     data = null;
   }
 }
 


In my xhtml page I refer to this data as following:

Code:
 <ice:panelSeries value="#{Test.data}" var="item">
   <ice:panelSeries value="#{item}" var="#{listItem}">
     <ice:inputText value="#{listItem.value}" />
   </ice:panelSeries>
 </ice:panelSeries>
 
 <ice:commandLink value="save" actionListener="#{Test.saveData}" />
 


1. Load page and see data
2. Edit data via these inputText.
3. submit by clicking save button.
4. store changed data in DB and set data to null.
5. page reloads an reads new data values
6. edit data again
7. click save

Now my bean doesn't see my second changes, instead it sees only the first made changes. But in the frontend the values are shown as edited in step 6.

Did I anything wrong? Isn't it possible to put multiple ice:panelSeries (or dataTable) in another and get IceFaces to manage the data for the bean correctly?

I am a little bit lost here.

One more thing. If I hit reload (F5) in my browser IceFaces reloads the bean correctly an I can again edit the values and save them to the database. A second shot isn't possible until refresh (F5).

I would be very happy about some advice!

Greetings,
Steffen George
dsinotte

Joined: 14/Nov/2006 00:00:00
Messages: 33
Offline


A couple of questions:

What scope is your backing bean? Does changing the scope of the bean change the behaviour?

If you take the same page and bean and run them in a non-portlet environment (just a regular web app), does the same thing happen? Just trying to gauge whether or not it's a portlet-specific issue.
starzlordb

Joined: 03/Nov/2010 01:24:34
Messages: 3
Offline


The scope of my backing bean is set to SESSION. I tried also REQUEST but that doesn't made a difference.

I haven't tried it in a non portlet environment. Will try again, as soon as I have some time.

Thanks in advance.
 
Forum Index -> Portals & Portlets
Go to:   
Powered by JForum 2.1.7ice © JForum Team