myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From danielitob <gbatt...@aliceposta.it>
Subject Re: t:columns myFaces...please help me
Date Thu, 14 Sep 2006 14:04:04 GMT

Hi Volker,
thank for your reply,i hope in your help to solve my infinite problem...
I have a datatable with a fixed number of columns,and others variable
columns(depending of a number chosen by user).
I had to insert each row of datatable in this manner:
the values of fixed columns into a table,the others as differente rows of
another table.
Example

italy french spain england(4 fixed) rome naples(2 dynamic)

i want
Nation(table)
italy french spain england

Italy(table)
rome
naples

Is clear my problem?
With datatable using i'm able to send fixed values columns into a table.
What i want is inserting dynamic values.
How can i do it?
I have two bean,Biosample and BiosampleProperties.
The fixed columns's values are binded to Biosample and it works.
Now i have to send the dynamic columns(for each row for which button is
clicked) as different rows(so i need more queries,but it's not a problem)
into another table.
BiosampleProperties has val attribute that store these values.
This is my jsp page
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t"%>
<html>
  <head>
    <title>
    </title>
  </head>
  <body>

    <f:view>
    <h:form>
    	
   
		<t:dataTable
    value="#{biosamplesTable.biosamples}" 
    var="biosampleItem"
	binding="#{biosamplesTable.biosampleDataTable}" border="3" bgcolor="pink" >
    <h:column >
        <f:facet name="header">
            <h:outputText value="Organism" />
        </f:facet>
       <h:selectOneMenu value="#{biosampleItem.organism}">
       	<f:selectItems value="#{getDropList.selectOrganism}"/>
       	   
       </h:selectOneMenu>
    </h:column>
    
    <h:column>
        <f:facet name="header">
            <h:outputText value="Treatment Protocol" />
        </f:facet>
        <h:inputText value="#{biosampleItem.treatmentProtocol}" />
    </h:column>

    <h:column >
        <f:facet name="header">
            <h:outputText value="Extraction Method" />
        </f:facet>
        <h:inputText value="#{biosampleItem.extractionMethod}" />
    </h:column>
    
    <h:column >
        <f:facet name="header">
            <h:outputText value="Label"/>
            </f:facet>
        <h:inputText value="#{biosampleItem.label}" />
    </h:column>
    <h:column>
        <f:facet name="header">
            <h:outputText value="Hybridation" /></f:facet>
        <h:inputText value="#{biosampleItem.hybridation}" />
    </h:column>
    <h:column>
        <f:facet name="header">
            <h:outputText value="Amplification" /></f:facet>
        <h:inputText value="#{biosampleItem.amplification}" />
    </h:column>
    <t:columns value="#{biosamplesTable.columns}" var="col">
    	<f:facet name="header">
                  <h:outputText value="Nuova" />
                  
        </f:facet>
              <!-- row is also available -->
        <h:inputText value="#{biosampleProperties.val}" />
    	
    </t:columns>
    
     <h:column>
        <f:facet name="header">
            <h:outputText value="Actions" />
        </f:facet>
        
        	
        
        <h:commandButton
        value="Invia dati biosample"
actionListener="#{biosamplesTable.editBiosample}" id="editBiosample">
    
        </h:commandButton>
    

    </h:column>
    <h:column>
    <h:messages globalOnly="true"/>
    </h:column>
    
</t:dataTable>	
 </h:form>		
		<h:form id="form2">
		<h:commandButton action="analysis" value="Inserisci"/>
     
     	</h:form>
		
		
    </f:view>
  </body>
</html>

Question1)
In the t:columns i've put
                     <h:inputText value="#{biosampleProperties.val}" />

that is an attribute of biosampleProperties(String).Is it right?
I post you my code,please help me,i'm in panic...ask me explanations if you
need it and excuse me for my english...
please help me..
In summary i need to retrieve correctly the dynamic values into a datatable
row for binding them(each value) to a bean(BiosampleProperties) for
inserting them into a table later...thanks
http://www.nabble.com/user-files/236015/code.doc code.doc 
-- 
View this message in context: http://www.nabble.com/t%3Acolumns-myFaces...please-help-me-tf2270642.html#a6306622
Sent from the MyFaces - Users forum at Nabble.com.


Mime
View raw message