java - p:ajax using an global HTML id to reference to an <h:messages> attribute -
I am currently working on a project for which some "reconstruction" is needed, but still it There is no money - so I have to deal with him who is in front of me. I need to display a message on each change of the radio button as you can see in this code example:
Lt; H: form & gt; & Lt; H: Message id = "msg" / & gt; & Lt; P: accordionPanel value = "# {exerciseBean.getCategoriesInGrade (5)}" var = "category" & gt; & Lt; P: tab title = "# {category.categoryName}" & gt; & Lt; H: Panel grid column = "1" cellpadding = "5" & gt; & Lt; Ui: Recurrence value = "# {exerciseBean.getSingleChoiceInGrade (5, category.CategoryName)}" var = "exercise" & gt; & Lt; Div & gt; # {Exercise.getText ()} & lt; / Div & gt; & Lt; P: selectOneRadio value = "# {exerciseBean.data}" & gt; & Lt; F: selectItems value = "# {exercise.getChoices ()}" var = "c" itemLabel = "# {c.id}" item value = "# {c.id}" /> & Lt; P: Ajax event = "change" process = "@ this" listener = "# {exerciseBean.validateInput (exercise.getId ())}" update = "msg" /> & Lt; / P: selectOneRadio & gt; & Lt; / Ui: Repeat & gt; & Lt; / H: panelGrid & gt; & Lt; / P: Tab & gt; & Lt; / P: accordionPanel & gt; & Lt; / H: form & gt;
As you can see - inside it and j: form & gt; ID
message
with a and
right now: I still get the error: "Not identifiers 'msg' with component Can get it". Now I have tried it with the prefix :
, but still this is the problem. What is the way to get the primetime / JSF in terms of this "global ID"?
In my backend, I send a message like this:
Fascades Message Chemesses = New Facemess ("Correct Answer!"); FacesContext.getCurrentInstance (). AddMessage (empty, Chemmesme);
Thanks.
- You need an ID
- Then you will be in the Ajax update feature The context of
msg
will need to be modified.
then the following code should change
1. & lt; H: form id = "formID" & gt;
2. & lt; P: Ajax event = "change" process = "@ this" listener = "# {exerciseBean.validateInput (exercise.getId ())}" update = ": formID: msg" / & gt;
Comments
Post a Comment