You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by CAMILO GONZALEZ <ca...@hotmail.com> on 2011/01/28 00:26:06 UTC

camilo gonzalez



Hello friends
 I'm working on an xhtml page in this site is built RichFaces 3.3.3 final, with trinidad v 13.
 The page shows the rich but the bean invocation is made with trinidad, this bean makes a call to a popup.
 This worked with previous DepNet.com for the version 8 of Trinidad, was changed by strong and afflicting motives of explorer 8.
 My problem is that running you do it right and into the bean but when he sent the sample popupno page.
 In the case of the trinidad code I put there as partialSubmit = false displays the popup but if I lose my main page.
 I hope I have understood
 add code



**************bean**********************************
public void editFieldLaunchHandler(LaunchEvent event) {
    facesUtil.removePageFlowScopeAttribute(CHANGED_FIELD);
    FieldDTO currentField = getSelectedField();
    event.getDialogParameters().put(WebRenderUtil.ACTION_ID, Action.UPDATE);
    FieldDTO editField = new FieldDTO(currentField);
    editField.setNew(currentField.isNew());
    for (FieldPropertyDTO prop : currentField.getFieldpropertiesDTO()) {
        List<FieldPropertyDTO> fieldProp = editField.getFieldpropertiesDTO();
        FieldPropertyDTO fp = new FieldPropertyDTO(prop);
        fp.setRecordStatus(prop.getRecordStatus());
        fieldProp.add(fp);
    }

    event.getDialogParameters().put(ADFieldViewConstants.BEAN_FIELD, editField);
    
    }



public String editFieldAction() {
    FieldDTO currentField = getSelectedField();
    if (currentField == null) {
        showException(Level.ERROR, "NoRowSelectedException", (Object[]) null);
        return null;
    }

    
    return "dialog:entityField";
    }


 /**
     * Al retornar de editar lanza un script para actualizar los datos cambiados
     * @param event
     */
    public void returnEditField(ReturnEvent event) {
    logger.info("returnEditField");
    FieldDTO resp = null;
    resp = (FieldDTO) event.getReturnParameters().get(ADFieldViewConstants.BEAN_FIELD);

    changedField = null;
    if (resp != null) {
        //i18n changes
        resp.setPromptAux(resp.getPrompt());
        resp.setDescriptionAux(resp.getDescription());
        changedField = new ChangedField(fields.indexOf(getSelectedField()), resp);
        facesUtil.setPageFlowScopeAttribute(CHANGED_FIELD, changedField);
        this.refreshTableScript.setText("replaceTableField()");
        facesUtil.addPartialTarget(refreshTableScript);
    }
    RequestContext.getCurrentInstance();
    }
***************************page*******************************

<rich:toolBar itemSeparator="disc" width="100%">
            <rich:toolBarGroup >
                <a4j:commandLink id="addFieldButton" oncomplete="#{rich:element('commonAddFieldButton')}.click();" 
                    title="#{EntityFieldBean.i18nItems.sys['ESS_G_ADD']}"
                    disabled="#{EntityFieldBean.pageDisabled}">
                    <af:image source="/common/images/add.png" inlineStyle="border-style: none;" />
                </a4j:commandLink>
                <a4j:commandLink id="editFieldButton"   oncomplete="#{rich:element('commonEditFieldButton')}.click();"
                    title="#{EntityFieldBean.i18nItems.sys['ESS_G_EDIT']}"
                    disabled="#{EntityFieldBean.pageDisabled}" >
                    <af:image source="/common/images/edit.png" inlineStyle="border-style: none;" />
                    
                </a4j:commandLink>
        
                <!-- <a4j:jsFunction id="jsFun" name="jsFun" reRender="commonEditFieldButton" oncomplete="#{rich:element('commonEditFieldButton')}.click();">
                </a4j:jsFunction> 
                
                <a4j:jsFunction id="jsFun" name="jsFun" ajaxSingle="true" oncomplete="Richfaces.hideModalPanel('commonEditFieldButton');" reRender="commonEditFieldButton"></a4j:jsFunction>
                -->
                
                
                <!-- por un bug no funciona el rerender, por eso llamo a rebuildTable -->
                <a4j:commandLink id="deleteFieldButton" binding="#{EntityFieldBean.deleteFieldCommand}"
                    action="#{EntityFieldBean.removeField}" oncomplete="rebuildTable()" 
                    reRender="fieldId,name,prompt,dbDataType,defaultValue,outDescription,inDescription,format,textTransform,insert,update,minimunLength,maximumLengthPanel,complement,pkOrder,persistent,priority,local,dataType,basicProcess,aditionalInfo,multiLanguage"  
                    title="#{EntityFieldBean.i18nItems.sys['ESS_G_REMOVE']}" ajaxSingle="true"
                    style="display:none"
                    disabled="#{EntityFieldBean.pageDisabled}">
                    <af:image source="/common/images/erase.png" inlineStyle="border-style: none;" />
                </a4j:commandLink>
            </rich:toolBarGroup>
            <rich:toolBarGroup location="right">
                <rich:datascroller id="fieldsDataScroller" binding="#{EntityFieldBean.dataScroller}" for="fieldsTable" align="left" renderIfSinglePage="false" style="width:350px"/>
            </rich:toolBarGroup>            
        </rich:toolBar>



     <!-- botones ocultos -->
            <h:panelGroup style="display:block; position:absolute">
            
            <af:commandLink id="commonDataType"
                action="#{EntityFieldBean.callDataTypeLov}"
                returnListener="#{EntityFieldBean.returnDataTypeLov}"
                partialSubmit="true" useWindow="true" windowHeight="500" windowWidth="600">
            </af:commandLink>    
            
            <af:commandLink id="commonBasicProcess" 
                action="#{EntityFieldBean.callBasicProcessLov}"
                returnListener="#{EntityFieldBean.returnBasicProcessLov}"
                partialSubmit="true" useWindow="true" windowHeight="500" windowWidth="600">
            </af:commandLink>
              <af:commandLink id="commonEditFieldButton" 
                 useWindow="true" immediate="true"    
                windowHeight="500" windowWidth="600" partialSubmit="true"
                action="#{EntityFieldBean.editFieldAction}" launchListener="#{EntityFieldBean.editFieldLaunchHandlerRich}"
                returnListener="#{EntityFieldBean.returnEditField}" >
            </af:commandLink>  
                
            
            <af:commandLink id="commonAddFieldButton" 
                partialSubmit="true" useWindow="true" immediate="true"
                windowHeight="500" windowWidth="600" 
                action="dialog:entityField" launchListener="#{EntityFieldBean.newFieldLaunchHandler}" 
                returnListener="#{EntityFieldBean.returnAddField}">            
            </af:commandLink>        
            
        </h:panelGroup>
********************************************faces config**********************************************************

<navigation-rule>
  <navigation-case>
   <from-outcome>dialog:entityField</from-outcome>
   <to-view-id>/jsp/adWizard/tapdField/edition.jsp</to-view-id>
  </navigation-case>
 </navigation-rule>