Xpages ViewPanel在对话框中打开选定的文档

发布于 2025-01-21 15:49:04 字数 12482 浏览 2 评论 0原文

我一直在尝试打开ViewPanel的对话框。此对话框打开了,这里没有问题,但是我想在ViewPanel中加载所选文档。当我尝试这样做时。我单击的哪个文件无关紧要。最新的(底部)文档始终加载在对话框中。我的问题是(我无法解决)如何在ViewPanel中选择文档进入对话框中。如果有一个示例,或者如果有人可以解释我需要遵循的方式。我真的很感激。

更新:我在表中列出了所有文档,然后双击打开对话框的文档时。

<xp:table id="viewPanela" styleClass="xspRepeatTable" cellpadding="0" cellspacing="0" style="width:98%"> <xp:tr styleClass="xspHeaderRow">
<xp:td style="width:2%"></xp:td>
<xp:td>
<xp:label value="Title" id="label2"></xp:label></xp:td>
<xp:td><xp:label value="Abteilung" id="label3"></xp:label>
</xp:td>
</xp:tr>
<xp:repeat id="repeatList" value="#{javascript:dominoView}" var="ordnerData" rows="10" indexVar="repeatIndex">
<xp:tr id="tr1"><xp:td></xp:td><xp:td><xp:div id="div1"><xp:this.style> <![CDATA[#{javascript:var level = ordnerData.getIndentLevel(); 
if(level != null && level > 0){
 return "padding-left:" + (level * 10) + "px !important";}else{return ""; }}]]></xp:this.style>
<xp:text escape="true" id="computedField3"><xp:this.value><![CDATA[#{javascript:return "  " +ordnerData.getColumnValue('$92')}]]></xp:this.value></xp:text></xp:div></xp:td><xp:td><xp:text escape="true" id="computedField4" value="#{javascript:ordnerData.getColumnValue('$95')}"></xp:text>
 </xp:td>
 <xp:eventHandler event="ondblclick" submit="false">
<xp:this.script><![CDATA[var docid="{javascript:ordnerData.getDocument().getUniversalID()}";var link=""; var typee='#{javascript:viewScope.docUNID = ordnerData.getDocument().getUniversalID()}';
return XSP.openDialog('#{id:inPlaceDialog1}')  ]]></xp:this.script> </xp:eventHandler> </xp:tr> </xp:repeat>
<xp:tr styleClass="xspPagerRow"><xp:td colspan="4" align="right" style="width:100%"> <xp:pager xp:key="headerPager" for="repeatList" id="pagerTop" partialRefresh="true" style="font-weight:inherit;margin-right:0.0px" layout="SeparatorPage Status FirstArrow Separator PreviousArrow Separator SeparatorPage Group Separator NextArrow Separator LastArrow"> </xp:pager>
 </xp:td></xp:tr></xp:table>

更新2:这是我尝试将文档加载到中的对话框代码

<xe:dialog id="inPlaceDialog1" title="Edit User"> 
        <xp:panel>
            <xp:this.data>
                <xp:dominoDocument var="document1" formName="Reports"
                    action="editDocument" ignoreRequestParams="true">
                    <xp:this.documentId><![CDATA[#{javascript:viewScope.docUNID}]]></xp:this.documentId>
                </xp:dominoDocument>
            </xp:this.data>
            <div class="modal-dialog modal-lg">
                <div class="modal-content">
                    <div class="card-header bg-primary header-elements-inline">
                        <h5 class="modal-title">
                            <xp:text id="docUNID" value="#{viewScope.docUNID}"
                                escape="false">
                            </xp:text>
                            <xp:text escape="false" id="computedField1">
                                <xp:this.value><![CDATA[#{javascript:var txt = "YENİ RAPOR"; print(viewScope.docUNID);
if (viewScope.docUNID!=null)
    txt = document1.getItemValueString("StatuText");
return txt;}]]></xp:this.value>
                            </xp:text>
                        </h5>
                        <div class="header-elements">
                            <div class="list-icons">
                                <div class="">
                                     
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="modal-header  text-white header-elements-inline">
                    </div>
                    <xp:div styleClass="modal-body" id="divBody">
                        <h6 class="font-weight-semibold"></h6>
                        <!-- <input type="text" name="" id="txtId"></input> -->
                        <xp:div styleClass="form-group">
                            <xp:label value="Rapor Türü:" id="label1"
                                styleClass="text-uppercase col-form-label  font-weight-bold">
                            </xp:label>
                            <xp:radioGroup id="RaporTuru" enabledClass="form-control border-primary">
                                <xp:this.value><![CDATA[#{javascript:var key = viewScope.docUNID;
                                
if (key!=null)
{
    var viewName = database.getView("viewReportsUnids")
    var doc:NotesDocument = viewName.getDocumentByKey(key, true);
    if (doc!=null)
    {
        return doc.getItemValueString("RaporTuru");
    }
}}]]></xp:this.value>
                                <xp:selectItems>
                                    <xp:this.value><![CDATA[#{javascript:try 
{
    var rListe:Array = [];
    rListe[0] = "Giriş Hareketleri";
    rListe[1] = "Çıkış Hareketleri";
    rListe[2] = "Giriş/Çıkış Hareketleri";
    rListe[3] = "Güncel Stok Raporu";
    return rListe;
}

catch(e)
{
    logError(e.toString(),
                session.getEffectiveUserName(),
                facesContext.getExternalContext().getRequest().getRequestURL(), 
                this.getParent().getId(), 
        "xspFrmRapor"); 
}}]]></xp:this.value>
                                </xp:selectItems>
                                <xp:eventHandler event="onchange" submit="true"
                                    refreshMode="partial" refreshId="divBody">
                                </xp:eventHandler>
                            </xp:radioGroup>

                        </xp:div>
                        <xp:div styleClass="form-group">
                            <xp:label value="Zaman Aralığı:" id="label4"
                                styleClass="text-uppercase col-form-label font-weight-bold">
                            </xp:label>
                            <xp:radioGroup id="RaporTipi" value="#{document1.RaporTipi}"
                                enabledClass="form-control border-primary">

                                <xp:selectItems>
                                    <xp:this.value><![CDATA[#{javascript:try 
{
    var rListe:Array = [];
    rListe[0] = "Tümü";
    rListe[1] = "Tarih Aralığı";
    return rListe;
}

catch(e)
{
    logError(e.toString(),
                session.getEffectiveUserName(),
                facesContext.getExternalContext().getRequest().getRequestURL(), 
                this.getParent().getId(), 
        "xspFrmRapor"); 
}}]]></xp:this.value>
                                </xp:selectItems>
                                <xp:eventHandler event="onchange" submit="true"
                                    refreshMode="partial" refreshId="divBody">
                                </xp:eventHandler>
                            </xp:radioGroup>

                        </xp:div>
                        <xp:div styleClass="form-group">
                            <xp:label value="Lokasyon (Şantiye):" id="label6"
                                styleClass="text-uppercase col-form-label  font-weight-bold">
                            </xp:label>
                            <xp:comboBox id="Lokasyon" value="#{document1.Lokasyon}"
                                styleClass="form-control">
                                <xp:selectItems>
                                    <xp:this.value><![CDATA[#{javascript:return "";}]]></xp:this.value>
                                </xp:selectItems>
                                <xp:selectItems id="selectItems6">
                                    <xp:this.value><![CDATA[#{javascript:var rList = @DbColumn(sessionScope.personel_db_Path, "viewLokasyon01", 1);
return rList;}]]></xp:this.value>
                                </xp:selectItems>
                                <xp:selectItems>
                                    <xp:this.value><![CDATA[#{javascript:return "TÜMÜ";}]]></xp:this.value>
                                </xp:selectItems>

                            </xp:comboBox>
                        </xp:div>

                        <xp:div styleClass="form-group">
                            <xp:label value="Stok Kategorisi:" id="label7"
                                styleClass="text-uppercase col-form-label  font-weight-bold">
                            </xp:label>
                            <xp:checkBoxGroup id="StokKategori" value="#{document1.StokKategori}"
                                enabledClass="form-control">
                                <xp:selectItems>
                                    <xp:this.value><![CDATA[#{javascript:var rList:java.util.Vector = new java.util.Vector();
rList.add("Parça");
rList.add("İşçilik");
rList.add("Yakıt");
rList.add("Yağ ve Adblue");
rList.add("Lastik");
return rList;}]]></xp:this.value>
                                </xp:selectItems>
                            </xp:checkBoxGroup>
                        </xp:div>
                        <xp:div styleClass="form-group">
                             
                            <xp:label value="Başlangıç Tarihi:" id="label8"
                                styleClass="text-uppercase col-form-label  font-weight-bold">
                            </xp:label>
                            <br></br>

                            <xe:djDateTextBox id="baslangicTarihi"
                                value="#{document1.baslangicTarihi}">
                                <xe:this.converter>
                                    <xp:convertDateTime type="date" dateStyle="short">
                                    </xp:convertDateTime>
                                </xe:this.converter>
                                <xe:this.dojoAttributes>
                                    <xp:dojoAttribute name="placeholder" value="01.01.2022">
                                    </xp:dojoAttribute>
                                </xe:this.dojoAttributes>
                                 
                            </xe:djDateTextBox>
                        </xp:div>
                        <xp:div styleClass="form-group">
                             
                            <xp:label value="Bitiş Tarihi" id="label10"
                                styleClass="text-uppercase col-form-label  font-weight-bold">
                            </xp:label>
                            <br></br>
                            <xe:djDateTextBox id="bitisTarihi" value="#{document1.bitisTarihi}"
                                styleClass="border-teal">
                                <xe:this.converter>
                                    <xp:convertDateTime type="date" dateStyle="short">
                                    </xp:convertDateTime>
                                </xe:this.converter>
                                <xe:this.dojoAttributes>
                                    <xp:dojoAttribute name="placeholder" value="01.01.2022">
                                    </xp:dojoAttribute>
                                </xe:this.dojoAttributes>
                                 
                            </xe:djDateTextBox>
                        </xp:div>

                    </xp:div>
                     
                </div>
            </div>
        </xp:panel>

         
    </xe:dialog>

I have been trying to open a dialog from viewPanel. This dialog is opened There is no problem here but I want to load selected document in viewPanel. When I try to do it. Which document I click It does not matter. The latest(at the bottom) document is always loaded in Dialog. My problem is (I could not solve) how to get selected document in viewPanel into Dialog. If There is an example how to do it or If someone can explaing the way I need to follow please. I really appreciate that.

The document which is bottom of viewPanel is opening

UPDATE: I have listes all of document in a table then When i double click on a document which opens dialog box.

<xp:table id="viewPanela" styleClass="xspRepeatTable" cellpadding="0" cellspacing="0" style="width:98%"> <xp:tr styleClass="xspHeaderRow">
<xp:td style="width:2%"></xp:td>
<xp:td>
<xp:label value="Title" id="label2"></xp:label></xp:td>
<xp:td><xp:label value="Abteilung" id="label3"></xp:label>
</xp:td>
</xp:tr>
<xp:repeat id="repeatList" value="#{javascript:dominoView}" var="ordnerData" rows="10" indexVar="repeatIndex">
<xp:tr id="tr1"><xp:td></xp:td><xp:td><xp:div id="div1"><xp:this.style> <![CDATA[#{javascript:var level = ordnerData.getIndentLevel(); 
if(level != null && level > 0){
 return "padding-left:" + (level * 10) + "px !important";}else{return ""; }}]]></xp:this.style>
<xp:text escape="true" id="computedField3"><xp:this.value><![CDATA[#{javascript:return "  " +ordnerData.getColumnValue('$92')}]]></xp:this.value></xp:text></xp:div></xp:td><xp:td><xp:text escape="true" id="computedField4" value="#{javascript:ordnerData.getColumnValue('$95')}"></xp:text>
 </xp:td>
 <xp:eventHandler event="ondblclick" submit="false">
<xp:this.script><![CDATA[var docid="{javascript:ordnerData.getDocument().getUniversalID()}";var link=""; var typee='#{javascript:viewScope.docUNID = ordnerData.getDocument().getUniversalID()}';
return XSP.openDialog('#{id:inPlaceDialog1}')  ]]></xp:this.script> </xp:eventHandler> </xp:tr> </xp:repeat>
<xp:tr styleClass="xspPagerRow"><xp:td colspan="4" align="right" style="width:100%"> <xp:pager xp:key="headerPager" for="repeatList" id="pagerTop" partialRefresh="true" style="font-weight:inherit;margin-right:0.0px" layout="SeparatorPage Status FirstArrow Separator PreviousArrow Separator SeparatorPage Group Separator NextArrow Separator LastArrow"> </xp:pager>
 </xp:td></xp:tr></xp:table>

UPDATE 2: Here is the dialog code that I try to load the document into

<xe:dialog id="inPlaceDialog1" title="Edit User"> 
        <xp:panel>
            <xp:this.data>
                <xp:dominoDocument var="document1" formName="Reports"
                    action="editDocument" ignoreRequestParams="true">
                    <xp:this.documentId><![CDATA[#{javascript:viewScope.docUNID}]]></xp:this.documentId>
                </xp:dominoDocument>
            </xp:this.data>
            <div class="modal-dialog modal-lg">
                <div class="modal-content">
                    <div class="card-header bg-primary header-elements-inline">
                        <h5 class="modal-title">
                            <xp:text id="docUNID" value="#{viewScope.docUNID}"
                                escape="false">
                            </xp:text>
                            <xp:text escape="false" id="computedField1">
                                <xp:this.value><![CDATA[#{javascript:var txt = "YENİ RAPOR"; print(viewScope.docUNID);
if (viewScope.docUNID!=null)
    txt = document1.getItemValueString("StatuText");
return txt;}]]></xp:this.value>
                            </xp:text>
                        </h5>
                        <div class="header-elements">
                            <div class="list-icons">
                                <div class="">
                                     
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="modal-header  text-white header-elements-inline">
                    </div>
                    <xp:div styleClass="modal-body" id="divBody">
                        <h6 class="font-weight-semibold"></h6>
                        <!-- <input type="text" name="" id="txtId"></input> -->
                        <xp:div styleClass="form-group">
                            <xp:label value="Rapor Türü:" id="label1"
                                styleClass="text-uppercase col-form-label  font-weight-bold">
                            </xp:label>
                            <xp:radioGroup id="RaporTuru" enabledClass="form-control border-primary">
                                <xp:this.value><![CDATA[#{javascript:var key = viewScope.docUNID;
                                
if (key!=null)
{
    var viewName = database.getView("viewReportsUnids")
    var doc:NotesDocument = viewName.getDocumentByKey(key, true);
    if (doc!=null)
    {
        return doc.getItemValueString("RaporTuru");
    }
}}]]></xp:this.value>
                                <xp:selectItems>
                                    <xp:this.value><![CDATA[#{javascript:try 
{
    var rListe:Array = [];
    rListe[0] = "Giriş Hareketleri";
    rListe[1] = "Çıkış Hareketleri";
    rListe[2] = "Giriş/Çıkış Hareketleri";
    rListe[3] = "Güncel Stok Raporu";
    return rListe;
}

catch(e)
{
    logError(e.toString(),
                session.getEffectiveUserName(),
                facesContext.getExternalContext().getRequest().getRequestURL(), 
                this.getParent().getId(), 
        "xspFrmRapor"); 
}}]]></xp:this.value>
                                </xp:selectItems>
                                <xp:eventHandler event="onchange" submit="true"
                                    refreshMode="partial" refreshId="divBody">
                                </xp:eventHandler>
                            </xp:radioGroup>

                        </xp:div>
                        <xp:div styleClass="form-group">
                            <xp:label value="Zaman Aralığı:" id="label4"
                                styleClass="text-uppercase col-form-label font-weight-bold">
                            </xp:label>
                            <xp:radioGroup id="RaporTipi" value="#{document1.RaporTipi}"
                                enabledClass="form-control border-primary">

                                <xp:selectItems>
                                    <xp:this.value><![CDATA[#{javascript:try 
{
    var rListe:Array = [];
    rListe[0] = "Tümü";
    rListe[1] = "Tarih Aralığı";
    return rListe;
}

catch(e)
{
    logError(e.toString(),
                session.getEffectiveUserName(),
                facesContext.getExternalContext().getRequest().getRequestURL(), 
                this.getParent().getId(), 
        "xspFrmRapor"); 
}}]]></xp:this.value>
                                </xp:selectItems>
                                <xp:eventHandler event="onchange" submit="true"
                                    refreshMode="partial" refreshId="divBody">
                                </xp:eventHandler>
                            </xp:radioGroup>

                        </xp:div>
                        <xp:div styleClass="form-group">
                            <xp:label value="Lokasyon (Şantiye):" id="label6"
                                styleClass="text-uppercase col-form-label  font-weight-bold">
                            </xp:label>
                            <xp:comboBox id="Lokasyon" value="#{document1.Lokasyon}"
                                styleClass="form-control">
                                <xp:selectItems>
                                    <xp:this.value><![CDATA[#{javascript:return "";}]]></xp:this.value>
                                </xp:selectItems>
                                <xp:selectItems id="selectItems6">
                                    <xp:this.value><![CDATA[#{javascript:var rList = @DbColumn(sessionScope.personel_db_Path, "viewLokasyon01", 1);
return rList;}]]></xp:this.value>
                                </xp:selectItems>
                                <xp:selectItems>
                                    <xp:this.value><![CDATA[#{javascript:return "TÜMÜ";}]]></xp:this.value>
                                </xp:selectItems>

                            </xp:comboBox>
                        </xp:div>

                        <xp:div styleClass="form-group">
                            <xp:label value="Stok Kategorisi:" id="label7"
                                styleClass="text-uppercase col-form-label  font-weight-bold">
                            </xp:label>
                            <xp:checkBoxGroup id="StokKategori" value="#{document1.StokKategori}"
                                enabledClass="form-control">
                                <xp:selectItems>
                                    <xp:this.value><![CDATA[#{javascript:var rList:java.util.Vector = new java.util.Vector();
rList.add("Parça");
rList.add("İşçilik");
rList.add("Yakıt");
rList.add("Yağ ve Adblue");
rList.add("Lastik");
return rList;}]]></xp:this.value>
                                </xp:selectItems>
                            </xp:checkBoxGroup>
                        </xp:div>
                        <xp:div styleClass="form-group">
                             
                            <xp:label value="Başlangıç Tarihi:" id="label8"
                                styleClass="text-uppercase col-form-label  font-weight-bold">
                            </xp:label>
                            <br></br>

                            <xe:djDateTextBox id="baslangicTarihi"
                                value="#{document1.baslangicTarihi}">
                                <xe:this.converter>
                                    <xp:convertDateTime type="date" dateStyle="short">
                                    </xp:convertDateTime>
                                </xe:this.converter>
                                <xe:this.dojoAttributes>
                                    <xp:dojoAttribute name="placeholder" value="01.01.2022">
                                    </xp:dojoAttribute>
                                </xe:this.dojoAttributes>
                                 
                            </xe:djDateTextBox>
                        </xp:div>
                        <xp:div styleClass="form-group">
                             
                            <xp:label value="Bitiş Tarihi" id="label10"
                                styleClass="text-uppercase col-form-label  font-weight-bold">
                            </xp:label>
                            <br></br>
                            <xe:djDateTextBox id="bitisTarihi" value="#{document1.bitisTarihi}"
                                styleClass="border-teal">
                                <xe:this.converter>
                                    <xp:convertDateTime type="date" dateStyle="short">
                                    </xp:convertDateTime>
                                </xe:this.converter>
                                <xe:this.dojoAttributes>
                                    <xp:dojoAttribute name="placeholder" value="01.01.2022">
                                    </xp:dojoAttribute>
                                </xe:this.dojoAttributes>
                                 
                            </xe:djDateTextBox>
                        </xp:div>

                    </xp:div>
                     
                </div>
            </div>
        </xp:panel>

         
    </xe:dialog>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

九八野马 2025-01-28 15:49:04

我没有使用RowAttributes从ViewPanel打开文档。我将代码放置在列后(我使用ViewPanel中的第一列)的代码,然后在对话框中从ViewPanel打开的对话框中,我有一个带有DataSourse的面板。 DataSource的文档ID是ViewScope.docunid。当我单击DOCUMETN(从ViewPanel中选出的文档)时,我将Selected Document的唯一dife to ViewScope.docunid condection.docunid,然后效果很好。

I did not use rowAttributes to open document from the viewPanel. I put the code which opens modal behind a column(I used the first column in the viewPanel) and in the dialog that is beeing opened from the viewPanel I have a Panel with datasourse. Document ID of Datasource is viewScope.DocUNId. When i click on a documetn (Selected document from viewPanel) I assing selected document's UniqueId to viewScope.docUNID and then It works very well..

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文