on 02-18-2013 5:18 PM
Hi All,
I created a new xhtml page with input fields of datatype alpha-numeric, email etc in a panel grid and also created a managed bean.
In order to validate the user input, in xhtml page i registered PostValidateEvent system event in the panel grid which contains all the input fields
<f:event listener="#{beanName.validateFields}" type="postValidate" />
and a “listener” method with signature public void method-name(ComponentSystemEvent event) in the bean.
public void validateFields((ComponentSystemEvent event){
// field validations
}
I didnot get any build or deploy error related to the event registered. But the postvalidate event is not triggered and validation is not done.
Please help me to validate the user inputs in the bean.
Thanks,
Nithya
Hi Nithya,
I have just tried your event listener coding in an example Web Channel Application and it works perfect.
I assume, that something with your DC setup is not correct. To ensure, that JSF 2 is working correct, the following preconditions have to be fulfilled:
Please check, if all these preconditions are fulfilled. I assume, that 3. and/or 4. are not fulfilled.
Please keep me informed, if this solves the problem.
Ralf
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Nithya
Can you check the below link, hope it will help you?
http://www.mkyong.com/jsf2/multi-components-validator-in-jsf-2-0/
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
There is different ways on see why this is an issue. IMO, issue lies in Eclipse WebChannel Builder plugin. But then again, this is my personal opinion..
To use the <f:event listener..> you need to be running JSF 2 - but the NW AS has a 1.2 deployed which is loaded 'by default' - and the WCEM has a DC called "wec/frw/tc/jsf/lib" which contains the JSF 2 library.
As far I'm concerned, as soon we create a 'new module' using the plugin we should get a reference to the JSF 2 library in the dpu file "application-j2ee-engine.xml" - but this would probably lead SAP to maintain two versions of the plugin, to keep WCEM 1 and WCEM 2 working.
All you have to do to use JSF 2 library you need to open your custom DC dpu (related to the UI part in question) and add into the "application-j2ee-engine.xml" the following:
<reference reference-type="hard" prepend="true">
<reference-target provider-name="sap.com"
target-type="library">wec~frw~tc~jsf~lib</reference-target>
</reference>
This way your DPU will be using JSF2 and your code should work just fine.
Hope it helps,
D.
Hi,
I dont have NWDS open to check - could it be due the fact you have JSF 2.0 and the "type" was introduced in 2.1?
I'm not too sure if I have ever used it before in WCEM - I would suggest you override the impl. supplied by SAP with your own DC/SDA containing the latest impl. plus latest el-api/impl too.
Please let me know once you have tried.
D.
Hi Nithya,
where did you place the <f:event> tag?
Did you debug or how did you make sure that your method is getting called?
Are you using WCEM 2.0?
Regards,
Elena
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Elena,
Thanks for your interest in helping me.
I am using WCEM 2.0. I placed <f:event> tag within <wec:panelGrid> which contains all the components i need to validate. when i debug, the control is not breaking in validateField(
ComponentSystemEvent event) method, which means postValidateevent is not getting triggered.
Please let me know is there any alternative way to validate input data?
Regards,
Nithya
User | Count |
---|---|
5 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.