A jsp:include tag will definitely NOT allocate a JSF component id.
You don't show all of your included page but it must be a tag in there
somewhere that's causing it. And only a small subset of JSF tags are
"naming containers" that add their id into their child component path as
shown here: f:subview and h:table are the main ones.
Regards,
Simon
sL07 wrote:
hi jeff,
thanks for the great link, never would have found that!
Looking at the generated html the following is produced in the label for all
the input controls on the subview
assetForm:tab1:_idJsp39:entitySubForm
Everything following the naming rules bellow except for the '_idJsp39'. It
seems to much up with the <jsp:include> tag. Do u agree?
I guess it is autogenerated which makes explicit naming of it not possible.
Any ideas are most welcome.
-lp
Jeff Bischoff wrote:
lp,
This is not a bug.
When referencing components in different naming containers in a "for"
attribute, a simple id is not sufficient. The component will be looked
up using the algorithm defined in findComponent() of UIComponent class.
See [1](tinyurl) or [2](full url).
In your case, try the following:
actionFor="tab1:entitySubForm"
You could also do something like:
actionFor=":MyFormName:tab1:entitySubForm"
[1] http://tinyurl.com/2k8yzn
[2]
http://java.sun.com/javaee/javaserverfaces/1.1_01/docs/api/javax/faces/component/UIComponent.html#findComponent(java.lang.String)
Regards,
Jeff Bischoff
Kenneth L Kurz & Associates, Inc.
sL07 wrote:
hi all,
i have subforms within subview. However when using the actionFor in a
commandButton that is outside the subview it seems to ignore the
validation
phase. The subforms work fine when the command button is within the
subview.
see snippet below.
Is this a known issue?
Is there a way to reference the subform name within a subview. ie
subview.formname
<f:subview id="tab1" >
<jsp:include page="assetEntityDetail.jsp"/> <----- subform
entitySubForm in here
</f:subview>
<f:subview id="tab2" >
<jsp:include page="assetLocationDetail.jsp"/>
</f:subview>
<h:panelGroup>
.....
<t:commandButton id="save" immediate="false"
action="#{assetForm.save}"
value="#{example_messages['button_save']}"
disabled="#{assetForm.mode==1}"
actionFor="entitySubForm"/>
<f:verbatim> </f:verbatim>
any help appreciated
-lp