Is this a typo?
<h:inputTextarea id="txt" value="#{email.bodyEmail}"
cols="70" rows="15" rendered="#{ email.htmlOrText == 'text'}" />
<t:inputHtml id="htm" value="#{email.bodyEmail}"
addKupuLogo="false" rendered="#{email.htmlOrText == 'text'}" />
You have 'rendered=#{email.htmlOrText == text}' on both
-Richard
On Jan 5, 2008 7:34 AM, Damar Thapa <[EMAIL PROTECTED]> wrote:
> Hi,
>
> Thanks for your message.
>
> I am seeing a weird situation!
>
> The following snapshot works fine (can display the required output
> correctly!):
>
> <h:selectOneMenu id="htmlOrText" value="#{email.htmlOrText}" >
> > <f:selectItem itemValue="text" itemLabel="Text"/>
> > <f:selectItem itemValue="html" itemLabel="Html"/>
> > <a4j:support event="onchange"
> > reRender="txt,isTxt,isHtml" ajaxSingle="true"/>
> > </h:selectOneMenu>
> >
> > <h:outputText id="txtHtml" value="#{ email.htmlOrText}"/>
> >
> >
> > Text:
> > <h:outputText id="isTxt" value="#{email.htmlOrText ==
> > 'text'}"/>
> >
> > Html:
> > <h:outputText id="isHtml" value="#{email.htmlOrText ==
> > 'html'}"/>
> >
>
> But, when I try the following (ironically, the real code that I need!), it
> does not render:
>
> <h:selectOneMenu id="htmlOrText" value="#{email.htmlOrText}" >
> > <f:selectItem itemValue="text" itemLabel="Text"/>
> > <f:selectItem itemValue="html" itemLabel="Html"/>
> > <a4j:support event="onchange" reRender="txt, htm"
> > ajaxSingle="true"/>
> > </h:selectOneMenu>
> >
> >
> > <h:inputTextarea id="txt" value="#{email.bodyEmail}"
> > cols="70" rows="15" rendered="#{ email.htmlOrText == 'text'}" />
> > <t:inputHtml id="htm" value="#{email.bodyEmail}"
> > addKupuLogo="false" rendered="#{email.htmlOrText == 'text'}" />
> >
> >
>
> Any pointers on this?
> Thanks once again.
>
> With regards,
> DT
>
> On Jan 5, 2008 1:52 AM, simon <[EMAIL PROTECTED]> wrote:
>
> >
> > On Sat, 2008-01-05 at 00:44 +0800, Damar Thapa wrote:
> > > Hi,
> > >
> > > I have the following snapshot:
> > >
> > > <h:selectOneRadio id="myRadio" value="#{email.htmlOrText}" >
> > > <f:selectItem itemValue="text" itemLabel="Text"/>
> > > <f:selectItem itemValue="html" itemLabel="Html"/>
> > > <a4j:support event="onchange" reRender="body" />
> > > </h:selectOneRadio>
> > >
> > > <div id="body">
> > > <c:if test="{$email.htmlOrText = 'text'}">
> > > <h:inputTextarea value="#{email.bodyEmail }"
> > > cols="70" rows="15" />
> > > </c:if>
> > > <c:if test="{$email.htmlOrText = 'html'}">
> > > <t:inputHtml value="#{ email.bodyEmail}"
> > > addKupuLogo="false"/>
> > > </c:if>
> > > </div>
> > >
> > > What I am trying to do is: when the value of radio button is
> > > changed, it should render "body" part, in which ther are two <c:ifs.
> > >
> > > How can I force it to render the body part as the user changes the
> > > value of oneselectRadio button?
> >
> > Do not use c:if. Do this instead:
> > <h:inputTextarea rendered="#{email.htmlOrText == 'text'}" .../>
> > <h:inputHtml rendered="#{email.htmlOrText == 'html'}" .../>
> >
> > Regards,
> >
> > Simon
> >
> >
>
>
> --
> With regards,
>
> Damar Thapa, Hong Kong
> (http://damarsblog.blogspot.com)