You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by skp <fo...@opensymphony.com> on 2006/05/28 02:15:18 UTC

Issue while displaying value from nested bean object

Hi,

I have a top level "Part" Bean which has a child  Bean "Called rPart". I am setting up the collection and forwarding the collection  called "familylist" to my dis.jsp


Code Snippet of dis.jsp
-----------------------------------------------------------------------------------------------------------------------------


<logic:iterate name="familylist" id="familylist" type="com.skp.skp.refbom.api.Part" indexId="ctr">
   <logic:notEmpty name="familylist" property="refurbishedPart"> 

<!-- Repair Flag -->
      <td class="borderedtd">
      [u]<html:text name="familylist"  property="rPart[0].repair"/></td>[/u]
      </td>
</logic:notEmpty> 
   </logic:iterate>

-------------------------------------------------------------------------------------------------------------------------------
The abv fetches the value and display it properly. 

However, that becomes "EDITABLE"  and that is something not desirable.

If I change the underline to

<td><bean:write name="familylist" property="rPart[0].repair"/></td>

I do not get anything in the screen. This problem is happening only for child object.


The propertis of Parent object "Part" works fine. so 
<td><bean:write name="familylist" property="npi"/></td> works ok considering "npi" is an attribute of parent object.

Please let me know if there is something fundamentally wrong with this approach. 
OR I can use someother way to display non-editable and display (read-only) value.

Best Regds,
SKP
---------------------------------------------------------------------
Posted via Jive Forums
http://forums.opensymphony.com/thread.jspa?threadID=32516&messageID=63009#63009


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


Re: Issue while displaying value from nested bean object

Posted by skp <fo...@opensymphony.com>.
Thanks a Ton Siva !!

Regds,
SKP
---------------------------------------------------------------------
Posted via Jive Forums
http://forums.opensymphony.com/thread.jspa?threadID=32516&messageID=63391#63391


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


Re: Issue while displaying value from nested bean object

Posted by Siva Sajja <sa...@gmail.com>.
Change your line <html:text name="familylist"  property="rPart[0].repair"/>
to
<html:text name="familylist"  property="rPart[0].repair" readonly="true"/>

For ur reference
http://struts.apache.org/struts-doc-1.2.7/userGuide/struts-html.html#text

The problem with your bean:write tag could be it doesn't accept a
collection.

Cheers,
Siva.

On 5/28/06, skp <fo...@opensymphony.com> wrote:
>
> Hi,
>
> I have a top level "Part" Bean which has a child  Bean "Called rPart". I
> am setting up the collection and forwarding the collection  called
> "familylist" to my dis.jsp
>
>
> Code Snippet of dis.jsp
>
> -----------------------------------------------------------------------------------------------------------------------------
>
>
> <logic:iterate name="familylist" id="familylist" type="
> com.skp.skp.refbom.api.Part" indexId="ctr">
>    <logic:notEmpty name="familylist" property="refurbishedPart">
>
> <!-- Repair Flag -->
>       <td class="borderedtd">
>       [u]<html:text
> name="familylist"  property="rPart[0].repair"/></td>[/u]
>       </td>
> </logic:notEmpty>
>    </logic:iterate>
>
>
> -------------------------------------------------------------------------------------------------------------------------------
> The abv fetches the value and display it properly.
>
> However, that becomes "EDITABLE"  and that is something not desirable.
>
> If I change the underline to
>
> <td><bean:write name="familylist" property="rPart[0].repair"/></td>
>
> I do not get anything in the screen. This problem is happening only for
> child object.
>
>
> The propertis of Parent object "Part" works fine. so
> <td><bean:write name="familylist" property="npi"/></td> works ok
> considering "npi" is an attribute of parent object.
>
> Please let me know if there is something fundamentally wrong with this
> approach.
> OR I can use someother way to display non-editable and display (read-only)
> value.
>
> Best Regds,
> SKP
> ---------------------------------------------------------------------
> Posted via Jive Forums
>
> http://forums.opensymphony.com/thread.jspa?threadID=32516&messageID=63009#63009
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> For additional commands, e-mail: dev-help@struts.apache.org
>
>