[hotjoe.com] HotJoe Java Help Forums
  [Search] Search   [Recent Topics] Recent Topics   [Hottest Topics] Hottest Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
Visit java.com
Please send email if you are having login problems - see the posts below for more info.
Hotmail and Yahoo! users - please see the Hotmail post or the Yahoo! post for information on lost emails.
JSF problem - Validation error  XML
Forum Index » J2EE Application Development
Author Message
karl

Newbie

Joined: 01/07/2006 07:56:42
Messages: 38
Offline

In my sample project the UI is powered by JSF, overall application architecture is J2EE.
In a scenario,we have a page where we toggle between radio buttons and page reloads everytime we toggle, with different forms.
In specific we have three radion buttons namely x ,y and z.
When the default page loads x is selected and when i shift my selection to y the page reloads with different forms and no error is seen.
Next when i select z page reloads with different forms but error is displayed on the top of the page as below
"Validation error:Value is not valid."
Once the error is dispalyed on the page the error continues to remain eventhough we revert back the radio selection.
In the above case jsp calls the js and the snippet of the same is as below

JSP snippet:
-------------------
<TD><h:selectOneRadio styleClass="selectOneRadio" id="radio1"
value="#{sessionScope.sameJam}"
onclick=return jump_onclick(this,event);>
<f:select itemValue="x"
itemLabel="#{labels.label_x}" />
<f:select itemValue="y"
itemLabel="#{labels.label_y}" />
<f:select itemValue="z"
itemLabel="#{labels.label_z}" />
</h:selectOneRadio></TD>

JS snippet:
-----------------
function jump_onclick(thisObj,thisEvent){
thisObj.form.submit();
}

Java code:
-------------
protected HtmlSelectOneRadio getRadio1() {
if (radio1 == null) {
radio1 = (HtmlSelectOneRadio) findComponentInRoot("radio1");
}

return radio1;

Thanks in advance.

This message was edited 1 time. Last update was at 11/13/2007 20:15:43

stdunbar

Newbie
[Avatar]

Joined: 06/22/2005 14:51:37
Messages: 849
Location: Superior, CO, USA
Offline

I feel like I don't have enough information to answer what is going on. Can you post some more information? Specifically, it seems like the error you're getting is "internal" - that is, you're letting JSF do the validation but I don't see any validation type code.

Can you post a bit more?

Thanks for using the forums at hotjoe.com
[WWW] [Yahoo!] [ICQ]
karl

Newbie

Joined: 01/07/2006 07:56:42
Messages: 38
Offline

I do not have any validation code as such.

Few more details..

sameJam is a String, there is no method implementation.

Below is sameJam code snippet:

private static final String SAME_JAM = "SameJam";
private static final String S_T_B = "th";
.
.
.
.
public SSR() {

String sameJam = (String) sessionScope.get(SAME_JAM);

if (sameJam == null) {
sessionScope.put(SAME_JAM, S_T_B);
}
.
.
.
.
String sameJam = (String) sessionScope.get(SAME_JAM);

if (sameJam.equalsIgnoreCase(SAME_JAM_x)) {
abc.setabcType(SEARCH_x);
abc.setabcObject(x_B_OBJ);
this.populate_x(abc);
} else if (sameJam.equalsIgnoreCase(SAME_JAM_y)) {
abc.setabcType(SEARCH_y);
abc.setabcObject(y_B_OBJ);
this.populate_y(abc);
} else {
abc.setabcType(z_TX);
abc.setabcObject(z_B_OBJ);
this.populate_z(abc);
}

Problem i am facing is:
- Form not loading properly.
- When i toggle between radio buttons, the radio retains the same value irrespective of button selected.
This was verified with some debug statements as below:
radio----------> x
radio----------> x
radio----------> x

Expected result:

--------------------------------------------------------------------------------
radio should have populated different values.

If you need further details i can let you know...
 
Forum Index » J2EE Application Development
Go to:   
Powered by JForum 2.1.9 © JForum Team
This site run by Scott Dunbar of Xigole Systems. © 2005-2011 - Scott Dunbar
Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners
hotjoe.com, xigole.com, and Scott Dunbar have no affiliation with Oracle