voyent
partial rendering?  XML
Forum Index -> Woodstock to ICEfaces Migration Go to Page: 1, 2 Next 
Author Message
autozoom

Joined: 28/Dec/2007 00:00:00
Messages: 80
Offline


I know Icefaces doesn't do a full refresh, but how can I just re-render the components I choose, leaving the others with their previous values?
I mean: imagine a form with a button and 2 labels. One label is bound to a counter and another one to the current time.
I want the button to refresh just the counter but leave the current time untouched.
In woodstock I could use $("form1:label").refresh() or use ajax transactions to just refresh the components I want.
How can I do the same with icefaces? I know there must be a simple way to do it, but cannot find it

thanks a lot
Mauro
frank.ye

Joined: 26/Oct/2004 00:00:00
Messages: 709
Offline


not sure if I understand the question, but is this means that the other label should not submit data, ie only the button and the other label?

[Email]
calm

Joined: 05/Jan/2009 00:00:00
Messages: 1
Offline


You can achieve this by adding partialSubmit="true" to the component which you want to get updated with the new value.
Note: rendered and partialSubmit are two different attributes. "Rendered" if "true", only then the component is eligible for rendering.
karinchen

Joined: 21/Nov/2008 00:00:00
Messages: 14
Offline


Should I understand from the above that something like:

Code:
 <ice:selectOneMenu id="id1" 
 value="#{MyController.items}"
 valueChangeListener="#{MyController.OnChangeItem}" 
 partialSubmit="true">
        <f:selectItems value="#{MyController.items}"/>
 </ice:selectOneMenu>
 


would only update the drop down menu if its current selection is changed and has no effect upon the rest of the page?

Thank you,
Karina
autozoom

Joined: 28/Dec/2007 00:00:00
Messages: 80
Offline


I am sorry but that doesn't seem to be the solution:
I am attaching a Visual Icefaces project for Netbeans; it has 1 button and 2 output texts.
I would like to only apply an effect to the first one without the second one being refreshed as well.
My goal is to partially refresh the page when some action happens.

Any hints appreciated

Mauro
 Filename WebApplication2.zip [Disk] Download
 Description
 Filesize 31 Kbytes
 Downloaded:  6181 time(s)

frank.ye

Joined: 26/Oct/2004 00:00:00
Messages: 709
Offline


the second value is binding to a back bean value which always changes.

<ice:outputText id="outputText1" style="left: 48px; top: 204px; position: absolute; width: 382px" value="#{Page1.date}"/>

So the value is updated correctly. Do you need a more static value for the second outputText?
[Email]
autozoom

Joined: 28/Dec/2007 00:00:00
Messages: 80
Offline


That's exactly what I need.
I want the second text not to be updated even if the binding value changes.
I need a way to partially refresh page components, so that I decide if and when to update a part of the view, even if the data changes.

With woodstock (using javascript) you can $(id).refresh() a single component (for example on a onClick event or something else).
frank.ye

Joined: 26/Oct/2004 00:00:00
Messages: 709
Offline


Since you have control of back bean, so could use a static value instead.

private Date date;
public String getDate() {
if(date == null){
return (new Date()).toString();
}else{
return "";
}
//return (new Date()).toString();
}

Since the real date might pick up from Command Button onclick.

I am not clear why you need to show a static date?
[Email]
autozoom

Joined: 28/Dec/2007 00:00:00
Messages: 80
Offline


I need this simply because it's a requirement of my application, and from what you say it's something you can do with woodstock (and with richfaces and ajax4jsf for example) that cannot be achieved by Icefaces.

Suppose you have a static text and a heavy table or tree that takes seconds to be rendered.
Why do I need to refresh everything and wait seconds when I know that only the static text is the thing I am interested in?

From what I understand, Icefaces *does* a complete re-rendering of every component on the page, and this is very close to a full postback refresh.

Am I wrong?
frank.ye

Joined: 26/Oct/2004 00:00:00
Messages: 709
Offline


static text needs to binding to a static value which does not change, hence when ICEfaces doing DOM diff, it is not refresh on the page.

the back bean in your sample does not have a static value, but rather automatically instantiate a new value. This is where the problem. If you have a JavaBean and place it in the request or session scope which has a static value, no whole page refresh is required.

as an example: you could simply drop a datatable on the page and give it a try.

[Email]
autozoom

Joined: 28/Dec/2007 00:00:00
Messages: 80
Offline


I don't think it's a "problem", but rather it's a limitation of the Icefaces framework, meaning that there's no easy way to refresh some components and leave other alone, regardless of the backing bean values.

I think this is a thing that should be pointed out in your migration documentation, because when developing non-trivial woodstock applications, usage of ajaxtransactions and partial components refresh is quite common.

thanks
ken.fyten

Joined: 26/Oct/2004 00:00:00
Messages: 1302
Offline


Hi,

Just to clarify, ICEfaces will always do a full component-tree render but will then only update those elements on the page that have actually changed, via our DOMdiff technology. The DOM diff works hierarchically so the parent element(s) of any content that has changed since the last render will be updated in the page. If you are seeing more elements being updated in the page than seems necessary you may want to tweak your page organization by wrapping the changing elements in a ice:panelGroup.

It seems that the ability being levered in some Woodstock apps. to have the client state not always reflect the server bean state for certain components is the difference here, ICEfaces will always keep the client in-sync with the server, but will only update the elements in the client DOM that have changed. The new partial-page rendering feature in the JSF 2.0 spec is very similar to this and ICEfaces 2.0 will support this as well as its traditional "full-page render, partial DOM update" mode of operation in the future.

You raise a good point about explaining these differences for those migrating from Woodstock. I'll see that we add some content to address this issue.

Regards,
Ken

Ken Fyten
VP Product Development
ICEsoft Technologies, Inc.
barmaglot

Joined: 07/Oct/2008 00:00:00
Messages: 21
Offline


ken.fyten wrote:
The new partial-page rendering feature in the JSF 2.0 spec is very similar to this and ICEfaces 2.0 will support this as well as its traditional "full-page render, partial DOM update" mode of operation in the future.  


can you explain this a little more? Does it mean that ICEFaces 2.0 will support partial processing during invoke application phase?

This functionality seems to be very significant for high-load application because for complex pages it is too expensive to re-render full-page on a server on each AJAX call, and AJAX4JSF/RichFaces still has great advantage over ICEFaces on this.
qihe229

Joined: 09/Aug/2009 00:00:00
Messages: 5
Offline


So, ICEFACES does this "full-page render, partial DOM update",

it will update *ALL* the elements in the client DOM that have changed. What if I want only some of the elements to be updated?

say there's a clock in my user login page.
an error msg appears when user type wrong username.

but clock ticks, full page is rendered, the error msg is updated to nothing!

Is there away to solve this or this is a limitation of ICEFACES?
futhark77

Joined: 18/Sep/2009 00:00:00
Messages: 56
Offline


[ please delete , reply posted to wrong thread ]
 
Forum Index -> Woodstock to ICEfaces Migration Go to Page: 1, 2 Next 
Go to:   
Powered by JForum 2.1.7ice © JForum Team