Update: code reduced and further description about this web application that I am trying to do.
<xp:text escape="true" id="computedField1">
<xp:this.value><![CDATA[#{javascript: sessionScope.DishNameValue;
}]]></xp:this.value>
</xp:text>
<xp:br></xp:br>
<xp:br></xp:br>
 <xp:table style="width:636.0px">
<xp:tr>
<xp:td style="width:250.0px">
<xp:inputTextarea id="inputTextarea2">
<xp:this.value><![CDATA[#{javascript:
var selectedDishNameRestaurant = @DbLookup(@DbName(),"RestaurantDishNameView", (getComponent("computedField1").getValue()),3)
if(selectedDishNameRestaurant != null)
{
return selectedDishNameRestaurant;
}
else
{
return "nothing here"
}
}]]></xp:this.value>
<xp:this.multipleSeparator><![CDATA[#{javascript:"\n"}]]></xp:this.multipleSeparator>
<xp:this.rendered><![CDATA[#{javascript:if(getComponent("computedField1").getValue() != null)
{
return true;
}}]]></xp:this.rendered>
</xp:inputTextarea>
</xp:td>
<xp:td style="width:250.0px">
<xp:inputTextarea id="inputTextarea4">
<xp:this.value><![CDATA[#{javascript:var selectedDishNameRestaurant = @DbLookup(@DbName(),"RestaurantDishNameView", (getComponent("computedField1").getValue()),3)
var createdDishValue = @DbLookup(@DbName(),"CreatedDishView", selectedDishNameRestaurant,2);
var restaurantDishValue = @DbLookup(@DbName(),"RestaruantDishView", createdDishValue,1);
if(creatededDishValue !=null){
return "Yes";
}
else
{
return "No";
}
}]]></xp:this.value>
<xp:this.multipleSeparator><![CDATA[#{javascript:"\n"}]]></xp:this.multipleSeparator>
<xp:this.rendered><![CDATA[#{javascript:if(getComponent("computedField1").getValue() != null)
{
return true;
}}]]></xp:this.rendered>
</xp:inputTextarea>
</xp:td>
<xp:td style="width:250.0px">
<xp:inputTextarea id="inputTextarea6">
<xp:this.value><![CDATA[#{javascript:var selectedDishNameRestaurant = @DbLookup(@DbName(),"RestaurantDishNameView", (getComponent("computedField1").getValue()),3)
var createdDishValue = @DbLookup(@DbName(),"CreatedDishView", selectedDishNameRestaurant,2);
var restaurantDishValue = @DbLookup(@DbName(),"RestaruantDishView", createdDishValue,1);
var createdDate = @DbLookup(@DbName(),"RestaruantDishView", createdDishValue,2);
if(createdDishValue !=null){
return createdDate;
}
else
{
return "";
}
}]]></xp:this.value>
<xp:this.multipleSeparator><![CDATA[#{javascript:"\n"}]]></xp:this.multipleSeparator>
<xp:this.rendered><![CDATA[#{javascript:if(getComponent("computedField1").getValue() != null)
{
return true;
}}]]></xp:this.rendered>
</xp:inputTextarea>
</xp:td>
</xp:tr>
</xp:table>
In the first page:
- The user will select the dish name or style (use radio button group and combo box) for the display it in the second page. (This part works fine)
In the second page:
There will be a computed field to display the selected value.(This part works fine because I use session variable to store the value)
There is a multi line edit box, it will display values in separate lines depends on the computed field's value. For example if the user select the dish name, then it will display which restaurant(s) has this dish. In this part, I use @DbLookup to achieve at this stage, the program still works fine).
There is another multi line edit box. it display values depends on the first multi line edit box. For example, the first multi line edit box can display a list of restaurants that has the specific dish name(selected by the user). The second multi line edit box will display the value that whether the restaurant has created the dish or not, if the the restaurant created the dish, the value return "Yes", otherwise return "No".
In this part, no matter how many values in the first multi line edit box, I could only get one "Yes" or one "No" in the second multi line edit box.
Would someone let me know how to make the second multi line edit box to display all values please? Thank you.
I tried to use for loop but not work.
for (i = getComponent("inputTextarea2").getValue(); i < getComponent("inputTextarea2").length; i++)