简体   繁体   English

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

[英]Xpages viewPanel open selected Document in Dialog

I have been trying to open a dialog from viewPanel.我一直在尝试从 viewPanel 打开一个对话框。 This dialog is opened There is no problem here but I want to load selected document in viewPanel.这个对话框打开这里没有问题,但我想在 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.我的问题是(我无法解决)如何将 viewPanel 中的选定文档放入对话框。 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.我非常感谢。

viewPanel 底部的文档正在打开

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更新 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 did not use rowAttributes to open document from the viewPanel.我没有使用 rowAttributes 从 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.我将打开模态的代码放在列后面(我使用了 viewPanel 中的第一列),在从 viewPanel 打开的对话框中,我有一个带有数据源的面板。 Document ID of Datasource is viewScope.DocUNId. Datasource 的文档 ID 是 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..当我点击一个文档(来自 viewPanel 的选定文档)时,我将选定文档的 UniqueId 分配给 viewScope.docUNID 然后它工作得很好..

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM