1
votes

In one of my XPages I got a radio button. If I choose value of the radio button, a partial refresh is called.

  • Value 1 of the radio button only displays a new button in the same line
  • Value 2 adds some more fields beneath the radio button group

Beneath this new fields there is a Dojo filtering select field to choose from a list of employees.

If I select value 1, the filtering select works fine. If I select value 2, the filtering select still starts at the "old" position, without recognizing the space, the new fields need

enter image description here

How can I update the position of the filtering select list? The partial refresh is for the complete content of the page, but does not seem to work here.

Here is the code of the radio group, which does the partial refresh on change:

            <xp:radioGroup id="rbgSelectEducationType" layout="pageDirection" 
        value="#{docApplication.EducationType}">
            <xp:this.readonly>
    <![CDATA[#{javascript:docApplication.getItemValueString("ZwfStepName") != "Start"}]]></xp:this.readonly>
            <xp:selectItem itemLabel="ESG Veranstaltung aus dem Katalog" 
        itemValue="ESG-Veranstaltung">
            </xp:selectItem>
            <xp:selectItem itemLabel="Externe Veranstaltung" 
        itemValue="Externe-Veranstaltung">
            </xp:selectItem>
            <xp:eventHandler event="onclick" submit="true" 
        refreshMode="partial" refreshId="wcEventDetails">
</xp:eventHandler>
            </xp:radioGroup>

And here is the code of the filtering select dropdown:

<xe:djFilteringSelect id="Approver" value="#{docApplication.Approver}" ignoreCase="true">
<xe:this.rendered><![CDATA[#javascript:docApplication.getItemValueString("ZwfStepName")=="Start"}]]></xe:this.rendered>
<xp:selectItems id="selectItems2">

<xp:this.value><![CDATA[#{javascript:if(docApplication.isEditable()){
        getComponent("AllUsersLastFirst").getValue().split("#");
    }}]]></xp:this.value>
</xp:selectItems>
<xp:eventHandler event="onChange" submit="true" refreshMode="partial" refreshId="panelBody" id="eventHandler2">
<xp:this.action><![CDATA[#{javascript:var dbPR = new Array(applicationScope.srv, applicationScope.pathPR);
    var Approver:com.ibm.xsp.extlib.component.dojo.form.UIDojoFilteringSelect = getComponent("Approver");
    var lookup=@DbLookup(dbPR,applicationScope.xpPersonByLastNameFirstName,Approver.getValue(),2);
    lookup=@If(@IsError(lookup),"error",lookup);
    if (lookup=="error") {
        errormsg = valstrings.getString("ccEsgDocWflContentApprover.lookup1");
        globalScriptErrors.add(errormsg);
        requestScope.put("scriptErrors", globalScriptErrors);
    }   
        @SetField("NotesNameApprover", lookup);}]]></xp:this.action>
</xp:eventHandler>
</xe:djFilteringSelect>
1
Mi Matthias, could you please paste some of the related code? To be honest, I don't quite get what you're trying to achieve ;)Lothar Mueller
Ah, at second thought I think that now I've got what you mean: the selection box of the approver field shows at the wrong position, correct? - Are you using the ExtLib's version of filteringSelect, or the standard dojo one? And: do you see this effect only if you change you radio value in an open page, or also right after opening a new page?Lothar Mueller
It's the standard filtering select control and as far as I know, this effect only shows up in this case here with the partial refresh and not when opening a new pageM. Schaetzl
This is weird indeed. Can you try the Extlib version just to see if it behaves the same way?Lothar Mueller
Hm, which element of the Extension Library do you mean? I can't find anything like this dropdown boxM. Schaetzl

1 Answers

1
votes

The filtering select is composed of a number of HTML elements (Firebug is your friend here). When you do a partial refresh that doesn't include the select itself, it isn't drawn again, thus the dropdown stays at the same position. The short answer: include the dropdown in the partial refresh.