You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Adam <ad...@softfab.com> on 2006/02/27 16:39:12 UTC
Confused wrt inputText
Dear All,
I am trying to build a jsf page which can alternate between showing
input & output text elements dependant upon a boolean (i.e. if you are
allowed to edit the data).
e.g.
<tr>
<td halign='left'><h:outputText value=" Type"
title="The Type of the Element" />
</td>
<td width="10">:</td>
<td halign='left'><h:outputText value="#{MIFExternal.type}"
rendered="#{!treeBacker.editState}" />
<h:inputText value="#{MIFExternal.type}"
rendered="#{treeBacker.editState}" />
</td>
</tr>
Basically the OutputText works fine, it calls "getType" & shows the
value in the bean however the inputText never calls "getType".
I have tried simply using an inputText (i.e. w/o any "rendered" & yet
nothing....)
Any ideas why the inputText should not be getting any values from the
backing bean?
Some of the fields are always ineligible for editing & thus are always
outputText & they work fine where the inputText fields are always empty.
TIA
Adam
Re: Confused wrt inputText
Posted by Grant Smith <wo...@gmail.com>.
That should occur automatically.
On 2/27/06, Adam <ad...@softfab.com> wrote:
>
> BTW all this is to pre-populate the inputText element with the values
> already contained in the bean.
>
> TIA
>
> Adam
>
> Adam wrote:
> > Dear All,
> >
> > I am trying to build a jsf page which can alternate between showing
> > input & output text elements dependant upon a boolean (i.e. if you are
> > allowed to edit the data).
> >
> > e.g.
> >
> > <tr>
> > <td halign='left'><h:outputText value=" Type"
> > title="The Type of the Element" />
> > </td>
> > <td width="10">:</td>
> > <td halign='left'><h:outputText value="#{MIFExternal.type}"
> > rendered="#{!treeBacker.editState}" />
> > <h:inputText value="#{MIFExternal.type}"
> > rendered="#{treeBacker.editState}" />
> > </td>
> > </tr>
> >
> >
> > Basically the OutputText works fine, it calls "getType" & shows the
> > value in the bean however the inputText never calls "getType".
> >
> > I have tried simply using an inputText (i.e. w/o any "rendered" & yet
> > nothing....)
> >
> > Any ideas why the inputText should not be getting any values from the
> > backing bean?
> >
> > Some of the fields are always ineligible for editing & thus are always
> > outputText & they work fine where the inputText fields are always empty.
> >
> > TIA
> >
> >
> > Adam
> >
> >
>
>
--
Grant Smith
Re: Confused wrt inputText
Posted by Adam <ad...@softfab.com>.
BTW all this is to pre-populate the inputText element with the values
already contained in the bean.
TIA
Adam
Adam wrote:
> Dear All,
>
> I am trying to build a jsf page which can alternate between showing
> input & output text elements dependant upon a boolean (i.e. if you are
> allowed to edit the data).
>
> e.g.
>
> <tr>
> <td halign='left'><h:outputText value=" Type"
> title="The Type of the Element" />
> </td>
> <td width="10">:</td>
> <td halign='left'><h:outputText value="#{MIFExternal.type}"
> rendered="#{!treeBacker.editState}" />
> <h:inputText value="#{MIFExternal.type}"
> rendered="#{treeBacker.editState}" />
> </td>
> </tr>
>
>
> Basically the OutputText works fine, it calls "getType" & shows the
> value in the bean however the inputText never calls "getType".
>
> I have tried simply using an inputText (i.e. w/o any "rendered" & yet
> nothing....)
>
> Any ideas why the inputText should not be getting any values from the
> backing bean?
>
> Some of the fields are always ineligible for editing & thus are always
> outputText & they work fine where the inputText fields are always empty.
>
> TIA
>
>
> Adam
>
>
Re: Confused wrt inputText
Posted by Grant Smith <wo...@gmail.com>.
Adam,
Things to try:
1. use <t:saveState id="type" value="#{treeBacker.editState}" />
2. instead of using an input & output container, try: <t:inputText value="#{
MIFExternal.type}"
displayValueOnly="#{treeBacker.editState}" />
Out of curiousity, what is the scope of your backing bean ?
-Grant
On 2/27/06, Adam <ad...@softfab.com> wrote:
>
> Dear All,
>
> I am trying to build a jsf page which can alternate between showing
> input & output text elements dependant upon a boolean (i.e. if you are
> allowed to edit the data).
>
> e.g.
>
> <tr>
> <td halign='left'><h:outputText value=" Type"
> title="The Type of the Element" />
> </td>
> <td width="10">:</td>
> <td halign='left'><h:outputText value="#{MIFExternal.type}"
> rendered="#{!treeBacker.editState}" />
> <h:inputText value="#{MIFExternal.type}"
> rendered="#{treeBacker.editState}" />
> </td>
> </tr>
>
>
> Basically the OutputText works fine, it calls "getType" & shows the
> value in the bean however the inputText never calls "getType".
>
> I have tried simply using an inputText (i.e. w/o any "rendered" & yet
> nothing....)
>
> Any ideas why the inputText should not be getting any values from the
> backing bean?
>
> Some of the fields are always ineligible for editing & thus are always
> outputText & they work fine where the inputText fields are always empty.
>
> TIA
>
>
> Adam
>
>
--
Grant Smith