Do not use on any
shared computer
July 24, 2008 09:11pm pdt
null
[x]
Attachment Details

Struts: nesting <bean:write>tag in a <logic:equal> tag (inside a javascript)

Tags: struts
I have a javascript that makes a 'tree-view' for me. I managed to already get the tree-view to build trees whose values are taken from my db. The problem is, I want to be able to check the bean of the 'first' array such that if it equals the one located in the second array, it will print/iterate.

Here's a short explanation of my code: the changeItemProducts array is only used to get the 'subject' names. Inside each 'subject' are sub-entries. (For example, Paint has sub-entries like: watercolor, etc). Now, the changeItems array contains the sub-entries (I also added in this array from what 'subject' they come are from).

Now I want to check that if the value of the subject in the changeItems array = value of the subject in the changeItemProducts array, print all the sub-entries. If not, skip it (because it may not have any sub-entries yet in the db) and check the next entries.

Here's my Javascript code for it:

<logic:iterate id="changeItemProduct" name="changeItemProducts">

      folCA = insFld(foldersTree, gFld("<bean:write name="changeItemProduct" property="productName" />", ""))
            headCA = insDoc(folCA, gLnk("S", makeHeader("Title","#cccccc"), "",makeHeader("CR#","#cccccc"),makeHeader("Date Submitted","#cccccc"),makeHeader("Target Date","#cccccc"),makeHeader("Phase","#cccccc")))
            headCA.iconSrc = ICONPATH + "ftv2blank.gif"
               
            <logic:iterate id="changeItem" name="changeItems">
                <logic:equal name="changeItem" property="productName" value="<bean:write name="changeItemProduct" property="productName" /> ">
                    insDoc(folCA, gLnk("S", "<bean:write name="changeItem" property="title" />", "/ADM/GetWorkOrders.do?changeItemNumber=<bean:write name="changeItem" property="changeItemNumber" />", "<bean:write name="changeItem" property="changeItemNumber" />", "<bean:write name="changeItem" property="dateSubmitted" />", "<bean:write name="changeItem" property="targetDate" />", "<bean:write name="changeItem" property="phaseNumber" />"))
                </logic:equal>
            </logic:iterate>
               
</logic:iterate>

The error I get is: equal symbol expected

on this part of the code(at least I think it is this part of the code):

<logic:equal name="changeItem" property="productName" value="<bean:write name="changeItemProduct" property="productName" /> ">

I heard that nesting within a struts tag is not possible. Is there a way to do this? Thanks in advance!
Start your free trial to view this solution
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

Question Stats
Zone: Programming
Question Asked By: cicoii
Solution Provided By: kennethxu
Participating Experts: 2
Solution Grade: A
Views: 525
Translate:
Loading Advertisement...
 
[+][-]Expert Comment by kennethxu

Rank: Wizard

Expert Comment by kennethxu:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Author Comment by cicoii
Author Comment by cicoii:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Expert Comment by kennethxu

Rank: Wizard

Expert Comment by kennethxu:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Assisted Solution by znaps
Assisted Solution by znaps:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Expert Comment by znaps
Expert Comment by znaps:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Author Comment by cicoii
Author Comment by cicoii:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Expert Comment by kennethxu

Rank: Wizard

Expert Comment by kennethxu:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Author Comment by cicoii
Author Comment by cicoii:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Expert Comment by znaps
Expert Comment by znaps:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Expert Comment by kennethxu

Rank: Wizard

Expert Comment by kennethxu:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Author Comment by cicoii
Author Comment by cicoii:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Expert Comment by kennethxu

Rank: Wizard

Expert Comment by kennethxu:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Author Comment by cicoii
Author Comment by cicoii:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Expert Comment by kennethxu

Rank: Wizard

Expert Comment by kennethxu:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Author Comment by cicoii
Author Comment by cicoii:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Expert Comment by kennethxu

Rank: Wizard

Expert Comment by kennethxu:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Expert Comment by kennethxu

Rank: Wizard

Expert Comment by kennethxu:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Author Comment by cicoii
Author Comment by cicoii:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Accepted Solution by kennethxu

Rank: Wizard

Accepted Solution by kennethxu:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Author Comment by cicoii
Author Comment by cicoii:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Expert Comment by znaps
Expert Comment by znaps:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Expert Comment by kennethxu

Rank: Wizard

Expert Comment by kennethxu:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
Loading Advertisement...
20080723-EE-VQP-34