Hi all, I found the issue but I don’t know how to solve it. The problem is that the commandLink I’m invoking is included by an :

 

          <f:subview id="Documents">

               <f:verbatim>

                 <jsp:include page="Documents.jsp" />

               </f:verbatim>

            </f:subview>

 

In the Documents jsp, I define a form and that’s it, with the command link, and it’s not working but when I copy-pasted the hole jsp insead of the jsp:include, the backingbean method was called successfully, any clues?

 

Thanks a lot

 

Matias Gomez Carabias

 

-----Original Message-----
From: Emily Gu [mailto:[EMAIL PROTECTED]]
Sent
:
Monday, December 19, 2005 2:32 AM
To: MyFaces Discussion
Subject: Re: Submit and h:commandLink question

 

Yeah, that was it. Thank you very much!!

 

One more question, if I put that SelectOneRadio template into an include file as

<f:view>

  <h:form>

       <%@ include file="myTemp.jspf" %>

       <h:commandLink immediate= "false" action="#{choice.createEntry} ">

            <h:outputText value= "Create" />

        </h:commandLink>

  </h:form>

</f:view>

 

Since it will be reused over several pages. The CommandLink has no effect to it. That is no matter what I change in selection, it never reflect in backing bean. Only when I remove the include file, put it into the form directly, everything worked as expected.

 

Thanks!!

 

On 12/18/05, Simon Kitching <[EMAIL PROTECTED]> wrote:

Hi,

The h:commandLink is immediate. That means that it is *completely*
processed before the h:selectOneRadio component gets processed at all.

So you won't see any updated model values in the actionListener method
associated with the commandLink. In fact, as the commandLink always does
navigation to the action destination, the radio value will *never* get
pushed into the model.

If you want to validate your components and push them into the model
before doing any navigation, set immediate to false.

Regards,

Simon

Emily Gu wrote:
> Sorry, that was a typo. It is a setter method. Do you see anything else
> wrong?
>
> Thanks!!
>
>
> On 12/18/05, *Simon Kitching* <[EMAIL PROTECTED]
> <mailto: [EMAIL PROTECTED]>> wrote:
>
>     Emily Gu wrote:
>      > Here is my code:
>      >
>      > jsp page:
>      >
>      > <f:view>
>      >    <h:form>
>      >        <h:selectOneRadio value=" #{choice.choiceEntry}">
>      >           <f:selectItems value="#{choiceList.choiceMap} "/>
>      >       </h:selectOneRadio>
>      >
>      >       <h:commandLink immediate= "true" value="Create"
>      > action="" " />
>      >
>      >    </h:form>
>      > </f:view>
>      >
>      > Bean:
>      >
>      > public class Choice {
>      >    private String choiceEntry;
>      >
>      >    public Choice () { }
>      >    public void getChoiceEntry () { return choiceEntry;}
>      >    public String getChoiceEntry (String e) ( choiceEntry = e;}
>      >
>      >    public void createEntry () { System.out.println (choiceEntry); }
>      > }
>      >
>      > In the createEntry method, I just want to see the value of changed
>      > choices. It is always null. The initial value is null, that is
>     fine, why
>      > after I made selection, then click the "Create" command link,
>      > the returned page had correctly remembered the selection, but the
>      > console printout is null all the time. Thanks for your help.
>
>     Is this really what's in your code:
>      >    public String getChoiceEntry (String e) ( choiceEntry = e;}
>
>     If so, that would explain your problem: no setter method.
>
>     Cheers,
>
>     Simon
>
>

 

Reply via email to