Unable to set value from a Custom dialog to a field in Maximo - maximo

n work order tracking application on Vendor field we need to have a custom look up that would display vendor details based on some condition. I have created a custom dialog in order to display this custom look up. This custom dialog maps to a relationship between WORKORDER and CXDEMO object (CXDEMO holds the data based on custom condition). Now when user clicks on the navigation menu on WORKORDER.VENDOR field then the custom look up appears and the data also gets displayed in the dialog however after selecting the value it does not get persisted to the WORKORDER.VENDOR field. I do understand that this can be achieved using bean class however I would like to understand whether there is any other way to achieve the same. Below is the dialog,
<dialog id="CXDEMO" label="Frame agreement vendors" relationship='CXDEMO'>
<table id="CXDEMO_1" label="Vendors" inputmode="readonly" selectmode="single">
<tablebody displayrowsperpage="6" filterable="true" filterexpanded="true" id="CXDEMO_grid1_1_1_pmalert_table_tablebody">
<tablecol dataattribute="vendor" id="CXDEMO_grid1_1_1_pmalert_table_tablebody_2" mxevent="selectrecord" mxevent_desc="Go To %1" sortable="true" type="link"/>
</tablebody>
</table>
<buttongroup id="CXDEMO_2">
<pushbutton default="true" id="CXDEMO_2_2" label="Cancel" mxevent="dialogcancel"/>
</buttongroup>
</dialog>

You need to specify a bean class to manage your dialog but I don't think you need to create a new one. You should only change your definition to use the lookup bean.
Like this:
<dialog id="CXDEMO" label="Frame agreement vendors" relationship='CXDEMO' beanclass="psdi.webclient.system.beans.LookupBean">
By referencing this bean you tell Maximo what class to use for the important selectrecord event/method.

Related

Hide columns in a ViewPanel

I'm using a standard viewPanel to display view data in an XPage.
The application is using the Bootstrap3.2.0.
To make the rendered table responsive, I added some bootstrap classes to both header and column.
<xp:viewColumn columnName="StatusDescription"
id="viewColumn4" styleClass="hidden-xs hidden-sm">
<xp:viewColumnHeader value="Status"
id="viewColumnHeader4" styleClass="hidden-xs hidden-sm">
</xp:viewColumnHeader>
</xp:viewColumn>
When I resize my browser window, the column is hidden correctly, but the header remains. Apparantly, the styleClasses are not added to the th tag, but to tags inside the th.
<th role="columnheader" scope="col">
<div class="hidden-xs hidden-sm">
<span>
<span
id="view:_id1:_id2:facetMiddle:pnlViewPanl:viewColumn4:__internal_header_title_id"
class="hidden-xs hidden-sm">Status
</span>
</span>
</div>
</th>
The result is that the table header is out of sync with the displayed data.
Does anybody know how I get the style class in the th tag?
It looks to me that either the view class renderer or the view column definition properties, or both, are messed up.
You would expect that <xp:viewColumnHeader styleClass="hidden-xs hidden-sm"> controlled the th style class but as you have seen it doesn't.
In order to achieve what you are trying to do you could try to extend the renderer class for the viewPanel that is DataTableRendererEx. But the approach might appear outlandish to you and, personally, way overkill considered that IBM has many of the class' methods declared as private and that would force you to rewrite the greater part of the class' code just to get your hands on the bit you need to change.
There would be some hope, in the sense that the code actually looks for the presence of a headerClass property for the xp:viewColumn. But, lo and behold, the property is not explicitly defined for the component and, in fact, you don't see it among the other properties of the viewColumn from Designer. Even if you were to explicitly write it through the xsp source code perspective Designer would not let you do it, it would not compile. You could ask IBM to fix the property definition file for the viewColumn component but frankly I don't know how feasible that is: XPages is in disrepair.
So what I can offer you is a workaround. There's a way to sneak in properties via theme definition (I wrote a bit about it in this blog article). So, in order to use this workaround, you have to use a theme. If you already have it you can simply add this rule:
<control>
<name>Column.View.Hidden</name>
<property>
<name>headerClass</name>
<value>hidden-xs hidden-sm</value>
</property>
<property>
<name>styleClass</name>
<value>hidden-xs hidden-sm</value>
</property>
</control>
The control name is arbitrary. Generally I use the original name of the control family -Column.View - and append the name of the variation - .Hidden in this case. If it were just Column.View the rule would apply to all the viewColumns everywhere. With Column.View.Hidden I have a rule I can apply on a per case basis.
At this point I just have to specify a different theme Id (themeId property) for the column I want to behave differently.
<xp:viewColumn columnName="columnName" id="viewColumn1" themeId="Column.View.Hidden">
<xp:viewColumnHeader value="columnHeaderName" id="viewColumnHeader1" />
</xp:viewColumn>

How to populate name of all Site Members in "Viewable by" dropdown list of Calendar portlet?

In Calendar portlet "Add Event", we can set view permissions. But by default it is showing three options namely in "Viewable by" drop down, "Any One(Guest Role), Site Members and Owner".
With these options i want to list name of all site members also....And when adding new event, if I selected a user, the event should be viewable by that particular user only...and if i selected "Site Members" it should be visible for all....
One solution i am thinking is by editing "edit_event.jsp". Created a hook for that...
The following code is giving the drop down of "Viewable by".... Here how can i add all site members name also? And will it check automatically hile showing events? Please help.....
<c:if test="<%= event == null %>">
<aui:field-wrapper label="permissions">
<liferay-ui:input-permissions
modelName="<%= CalEvent.class.getName() %>"
/>
</aui:field-wrapper>
</c:if>

How to get document datasource in another Custom Control?

I have an xPage with this content:
<div class="lotusFrame">
<xc:layoutCommonBanner />
<xp:callback facetName="facetTitleBar" id="callbackTitleBar" />
<xc:layoutDiscrepancyPlaceBar />
<div class="lotusMain">
<div class="lotusColLeft">
<xp:callback facetName="facetColLeft" id="callbackColLeft" />
</div>
<div class="lotusColRight">
<xp:callback facetName="facetColRight" id="callbackColRight" />
</div>
<div class="lotusContent">
<xp:callback facetName="facetContent" id="callbackContent" />
</div>
</div>
<xc:layoutCommonFooter />
<xc:layoutCommonLegal />
</div>
As you can see, there are several custom controls in it composing layout. In the facetContent, there is a document with document datasource. It's the only document in the page. I need to get this document somehow in the layoutDiscrepancyPlaceBar custom control.
I found some old articles on the web with undocumented feature called currentDocument. It should be on every page with document datasource. But it doesn's work. I have Domino 8.5.2 and currentDocument seems to be no longer supported.
Can you help me out? How can I get document datasource from one custom control in another custom control. Is it even possible?
Thanks in advance, Jiří
EDIT: OK, it is still supported, but it only works in custom control, that is included inside the one with document datasource. In the case scenario above it doesn't work.
Your best option is to hand over the binding name in a custom property. (lets call it bindto. Then you bind your field to
"${#{"+compositeData.bindto+"}}"
See details here (inside the prezi)
P.S. currentDocument is documented somewhere.
You can also pass a handle on the data source directly to the custom control, as well as the name of the item to bind to on the data source. Because EL supports array syntax as well as dot syntax, this allows you to define expressions like this:
#{compositeData.dsn[compositeData.fieldName]}
(where "dsn" is the property being passed the handle on the data source, and "fieldName" is the property being passed the name of the item to bind to on that data source.)
More details on this approach can be found here.

How to make "SharePoint:FormField" required?

I'm making a SharePoint 2010 new/edit item custom form.
I have a title field:
<SharePoint:FormField runat="server" ID="fieldFileLeafRef" ControlMode="Edit" FieldName="FileLeafRef" />
How to make this field required?
FormField is a Control that would render the UI for any of the Field you assign it to , it doesn't not represent any field Statically. In your code you are refering or pointing the FormField to point to FieldName="FileLeafRef", so in this case you will need to set the Field as Required in your Content Type or List so that FormField will render a validator or do validations.

How to set <aui:button> icon in Liferay without using Javascript?

I'm trying to set icon to <aui:button> like on this tutorial.
But solution described there doesn't work well in my case, because I have a table and on each row I have a button with different resourceUrl. Like this:
<portlet:resourceURL id="saveReport" var="saveReportURL">
<portlet:param name="reportId" value="${report.reportId}" />
</portlet:resourceURL>
<aui:button onclick="location.href = '${saveReportURL}'">
Is it possible to set icon in <aui:button> without using JavaScript as described in tutorial?
Thanks
You can write this below code for setting icon in liferay alloy button
<aui:button type="cancel" cssClass="btn-info" icon="icon-upload-alt" iconAlign="right" value="upload" />
you need to use the icon attribute for this setting "Icon glyphs"
you need to use cssClass for adding extra design button class for the designing
you need to set iconAlign attribute for left or right side of the button text value
You should be able to add an icon to a button without using JavaScript by adding one of these Icon CSS classes to your button. For example, if you wanted to create a button with a calendar icon, your code should look something like this:
<aui:button class="icon-calendar" ... />

Resources