[ http://issues.apache.org/jira/browse/MYFACES-437?page=all ]
Bruno Aranda closed MYFACES-437:
--------------------------------
Resolution: Invalid
This does not work for you because you are doing a bad use of jsf. You are
calling to submit() directly from the onclick attribute of the
selectBooleanCheckbox component. If you call to submit() directly the
parameters are not passed. You should use a tecnique explained in the wiki [1]
to submit the form when the value of the selectBooleanCheckbox is changed.
[1] http://wiki.apache.org/myfaces/SubmitPageOnValueChange
> <f:attribute> does not work with <x:dataTable>
> ------------------------------------------------
>
> Key: MYFACES-437
> URL: http://issues.apache.org/jira/browse/MYFACES-437
> Project: MyFaces
> Type: Bug
> Components: General
> Versions: 1.0.9m9
> Environment: jdk1.4.2 ,tomcat 5.0
> Reporter: lantian
>
> I found that <f:attribute> doese not work with <x:dataTable> .
> the following is my JSF page Code:
> <x:dataTable id="dt_account" headerClass="standardTable_Header"
> footerClass="standardTable_Header"
> rowClasses="standardTable_Row1,standardTable_Row2"
>
> columnClasses="standardTable_ColumnCentered,standardTable_ColumnCentered"
> value="#{pc_GrantFunctionHasOperate.functionOperateListToGrant}"
> var="row"
> preserveDataModel="true">
> <f:facet name="header">
> <h:outputText value="?????????????????????"
> style="font-size:9pt" />
> </f:facet>
> <h:column>
> <h:selectBooleanCheckbox id="sbc_operate"
> value="#{row.selected}"
>
> valueChangeListener="#{pc_GrantFunctionHasOperate.onOperateSelectedChange}"
> onclick="submit();">
> <f:attribute name="operateCode" value="#{row.operateCode}"
> />
> </h:selectBooleanCheckbox>
> </h:column>
> <h:column >
> <f:facet name="header">
> <h:outputLabel for="sbc_operate" id="header_funName"
> style="font-size:9pt" value="????" />
> </f:facet>
> <h:outputText id="opt_accountCode" value="#{row.operateName}" />
> </h:column>
> </x:dataTable>
> the following code is backingBean's method of valueChangeListener :
> public void onOperateSelectedChange(ValueChangeEvent event)
> {
>
> String
> operateCode=(String)event.getComponent().getAttributes().get("operateCode");
> return;
>
> }
> i found that the operateCode is null when the valueChange Event occured .
> but if i set the value of <f:attribute> to a const value ,then i can got it
> when the valueChange Event occured .
> for example :
> <h:column>
> <h:selectBooleanCheckbox id="sbc_operate"
> value="#{row.selected}"
>
> valueChangeListener="#{pc_GrantFunctionHasOperate.onOperateSelectedChange}"
> onclick="submit();">
> <f:attribute name="operateCode" value="0001" />
> </h:selectBooleanCheckbox>
> </h:column>
>
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira