Hi all,
I have a question: Does anyone have an example of how to paint a JSP from a
Backing Bean ( I´m using myfaces tomahawk.)? I have a table in the db that
indicades what types of fields the JSP will have.
For example
1 = <t:inputText
1= <t:inputText
2= <h:selectOneMenu
3= <t:commandLink
I think i can do it using some scriptless (I do not like this solution) I
can put all the fields types in an arrayList in the backingBean and then
with a for sentence paint the controls in the JSP:
<%
for(fieldsObject)
{
if(type == 1){
%><t:inputText...<%
}else if (type == 2){
%><h:selectOneMenu...<%
}else if (type == 3){
%><t:commandLink...<%
}
}
%>
Anyone have a better solution?. If not, I also have a problem with the
solution with scriptless: I recived an error message when I put the id to
the field, that said that I can´t put an id in execution time, Im tried to
put the ids in the following way:
<%
for(i= 0; i <fieldsObject, i++)
{
if(type == 1){
String inputId = "Input_" + i;
%><t:inputText... id='<%=inputId %>' <%
}else if (type == 2){
String selectOneId = "SelectOneMenu_" + i;
%><h:selectOneMenu...id='<%=selectOneId %>' <%
}else if (type == 3){
String commandLinkId= "CommandLink_" + i;
%><t:commandLink...id='<%=commandLinkId%>' <%
}
}
%>
I hope anyone can help me, Thanks!!