matheus
Posts: 386
|
Posted: 10/14/2005, 11:23 AM |
|
Hi, in a textbox I need change format pattern with a value from session.
To show It's okay, I change the format pattern no before show from control.
But in validation it use default.
Some tip?
_________________
Matheus Trevizan
Dynamix Software Ltda.
Blumenau SC Brasil
www.dynamix.com.br |
|
|
miko
Posts: 50
|
Posted: 10/16/2005, 11:03 PM |
|
I resolved such problem some time ago:
it is need to modify com.codecharge.components.Control.setValueFromRequest method and to add following code to it:
if ("sess".equals(this.formatPattern)) {
this.formatPattern = (String) this.getPage().getRequest().getSession().getAttribute(this.name+"Format");
}
after "try {"
I am not sure if it the only place to modify but I get result in my case.
in BeforeShow you write code (I use Control.beforeShow)
e.getControl().setFormatPattern("<yourFormat>");
e.getPage().getRequest().getSession().setAttribute(e.getControl().getName()+"Format", "<yourFormat>");
Note:
1. I use "sess" instead of "session" because "n" is replaced by "m" in format strings during generation for Date formats ("n" - minutes in CCS formats, "m" - the same in Java)
2. In property window you sholud specify "sess" as format for each control with dynamic formats.
_________________
Regards,
Michael |
|
|
matheus
Posts: 386
|
Posted: 10/17/2005, 10:27 AM |
|
Thanks, It works.
_________________
Matheus Trevizan
Dynamix Software Ltda.
Blumenau SC Brasil
www.dynamix.com.br |
|
|
|