[Logo] Enterprise Client Community
  [Search] Search   [Recent Topics] Recent Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
Textfield flush on modify  XML
Forum Index -> Development
Author Message
mhanke

Active

Joined: 14/07/2015 13:06:09
Messages: 10
Offline

Hi, I would like to implement "flush on modify" with a textfield. Is it possible?
CaptainCasa

Power User
[Avatar]

Joined: 21/11/2007 12:23:06
Messages: 5533
Offline

...there are two attributes:

FLUSH => if set to true => if the user changes the text AND leaves the field then there is a flush to the server side

FLUSHTIMER => if set to a certain number of milliseconds (e.g. 1000) then the field content will be flushed if changed and if the duration was passed without the user continuing to key in further characters...

So, I believe this is exactly what you need for responsive field input (AND for not having tooooo many roundtrips). What we do not want to do is: have a roundtrip per key stroke...

Regards, Björn


Björn Müller, CaptainCasa GmbH
mhanke

Active

Joined: 14/07/2015 13:06:09
Messages: 10
Offline

Thank you for your quick reply. I've tested the FLUSHTIMER but it's not working correctly. If I set the FLUSHTIMER to 500 millis, it is not sent immediately.
CaptainCasa

Power User
[Avatar]

Joined: 21/11/2007 12:23:06
Messages: 5533
Offline

500 means: if you keep you fingers away from the keyboard for 500ms, then the rountrip is triggered.

As long as the user keys in like a monkey, there is no need for a roundtrip because the data changes anyway... - so we wait for the user to relax a bit.

But, important! You never get lost any data change. If the user hacks in the data and then jumps to the next field (not waiting 500ms) then the normal FLUSH=true triggers a roundtrip.

Regards, Björn

Björn Müller, CaptainCasa GmbH
mhanke

Active

Joined: 14/07/2015 13:06:09
Messages: 10
Offline

I understand how it works but it does not work as expected.
CaptainCasa

Power User
[Avatar]

Joined: 21/11/2007 12:23:06
Messages: 5533
Offline

Please add more details, maybe a mini-layout with some mini-processing.

Thanks! Björn

Björn Müller, CaptainCasa GmbH
mhanke

Active

Joined: 14/07/2015 13:06:09
Messages: 10
Offline

I've made a really simple example. It's not updating the label on every change and wait.

Code:
 @CCGenClass(expressionBase = "#{d.TestUI}")
 public class TestUI extends PageBean implements Serializable {
 
     private String text;
 
     @Override
     public String getRootExpressionUsedInPage() {
         return "#{d.TestUI}";
     }
 
     @Override
     public String getPageName() {
         return "/test.jsp";
     }
 
     public String getText() {
         return text;
     }
 
     public void setText(String text) {
         this.text = text;
     }
 
 }
 


Code:
 <f:view>
 <h:form>
 <f:subview id="testg_sv">
 <t:rowtitlebar id="g_2" />
 <t:rowheader id="g_3" />
 <t:rowbodypane id="g_4" >
 <t:row id="g_1" >
 <t:field id="g_7" flush="true" flushtimer="1000" text="#{d.TestUI.text}" width="100" />
 <t:label id="g_8" text="#{d.TestUI.text}" />
 </t:row>
 </t:rowbodypane>
 <t:rowstatusbar id="g_5" />
 <t:pageaddons id="g_pa"/>
 </f:subview>
 </h:form>
 </f:view>
 
CaptainCasa

Power User
[Avatar]

Joined: 21/11/2007 12:23:06
Messages: 5533
Offline

...during direct conversation we found the following situation:

There is an additional attribute FLUSHCONDITION which was set by style management. Via FLUSHCONDIITION you can fine-tune the flushing, so that changes are only flushed if the value is changing from "empty to something".

After changing the FLUSHCONDITION things work as expected.

Regards, Björn

Björn Müller, CaptainCasa GmbH
mhanke

Active

Joined: 14/07/2015 13:06:09
Messages: 10
Offline

Thank you for the really nice support.
 
Forum Index -> Development
Go to:   
Powered by JForum 2.1.6 © JForum Team