I have a requirement to add row on a tab which does not exist by OOB. Hence in order to achieve this I mapped psdi.webclient.system.beans.DataBean bean class to the table and then added new row button. Now on click of new row button the new row doesn't show however when I click on "there is no rows to display" then the newly added row is displayed.
<tab id="actuals_actuals_acservices" label="Services">
<table id="actuals_actuals_acservices_acservices_table" label="Services" relationship="SHOWACTUALSERVICE">
<tablebody displayrowsperpage="6" filterable="true" id="actuals_actuals_acservices_acservices_table_tablebody">
<tablecol filterable="false" id="actuals_actuals_acservices_acservices_table_tablebody_1" mxevent="toggledetailstate" mxevent_desc="Show Detail" sortable="false" type="event"/>
<tablecol dataattribute="actualstaskid" id="actuals_actuals_acservices_acservices_table_tablebody_2" linkedcontrolid="actuals_actuals_acservices_acservices_table_1_grid7_1" sortable="false"/>
<tablecol dataattribute="itemnum" id="actuals_actuals_acservices_acservices_table_tablebody_3" label="Service" rechover="item_recordhover"/>
<tablecol dataattribute="description" id="actuals_actuals_acservices_acservices_table_tablebody_4" lookup="longdesc"/>
<tablecol dataattribute="quantity" id="actuals_actuals_acservices_acservices_table_tablebody_5" linkedcontrolid="actuals_actuals_acservices_acservices_table_1_grid8_1"/>
<tablecol dataattribute="unitcost" id="actuals_actuals_acservices_acservices_table_tablebody_6" linkedcontrolid="actuals_actuals_acservices_acservices_table_1_grid8_2"/>
<tablecol dataattribute="loadedcost" id="actuals_actuals_acservices_acservices_table_tablebody_7" linkedcontrolid="actuals_actuals_acservices_acservices_table_1_grid8_3"/>
<tablecol filterable="false" id="actuals_actuals_acservices_acservices_table_tablebody_8" mxevent="toggledeleterow" mxevent_desc="Mark Row for Delete" mxevent_icon="btn_garbage.gif" sortable="false" type="event"/>
</tablebody>
<tabledetails id="actuals_actuals_acservices_acservices_table_1">
<section id="actuals_actuals_acservices_acservices_table_1_sec1" label="Details">
<sectionrow id="actuals_actuals_acservices_acservices_table_1_sec1row1">
<sectioncol id="actuals_actuals_acservices_acservices_table_1_sec1row1_1">
<section id="actuals_actuals_acservices_acservices_table_1_grid7">
<textbox dataattribute="actualstaskid" id="actuals_actuals_acservices_acservices_table_1_grid7_1" inputmode="readonly" sizeintable="4"/>
<combobox dataattribute="linetype" id="actuals_actuals_acservices_acservices_table_1_grid7_3"/>
<multiparttextbox dataattribute="itemnum" descdataattribute="description" id="actuals_actuals_acservices_acservices_table_1_grid7_2" inputmode="readonly" label="Service" longdescreadonly="true" rechover="item_recordhover"/>
</section>
</sectioncol>
<sectioncol id="actuals_actuals_acservices_acservices_table_1_sec1row1_2">
<section id="actuals_actuals_acservices_acservices_table_1_grid8">
<textbox dataattribute="quantity" dynamic="true" id="actuals_actuals_acservices_acservices_table_1_grid8_1" inputmode="readonly" sizeintable="9"/>
<textbox dataattribute="unitcost" dynamic="true" id="actuals_actuals_acservices_acservices_table_1_grid8_2" inputmode="readonly"/>
<textbox dataattribute="poline.orderunit" dynamic="true" id="actuals_actuals_acservices_acservices_table_1_grid8_5" inputmode="readonly"/>
<textbox dataattribute="loadedcost" dynamic="true" id="actuals_actuals_acservices_acservices_table_1_grid8_3" inputmode="readonly"/>
<textbox dataattribute="transdate" dynamic="true" id="actuals_actuals_acservices_acservices_table_1_grid8_4" inputmode="readonly"/>
</section>
</sectioncol>
<sectioncol id="actuals_actuals_acservices_acservices_table_1_sec1row1_3">
<section id="actuals_actuals_acservices_acservices_table_1_grid10">
<textbox dataattribute="gldebitacct" dynamic="true" id="actuals_actuals_acservices_acservices_table_1_grid10_1" inputmode="readonly" lookup="glnavigator"/>
<textbox dataattribute="glcreditacct" dynamic="true" id="actuals_actuals_acservices_acservices_table_1_grid10_2" inputmode="readonly" lookup="glnavigator"/>
<textbox applink="po" dataattribute="ponum" dynamic="true" id="actuals_actuals_acservices_acservices_table_1_grid10_5" inputmode="readonly" menutype="normal"/>
<textbox dataattribute="polinenum" dynamic="true" id="actuals_actuals_acservices_acservices_table_1_grid10_6" inputmode="readonly"/>
<textbox dataattribute="enterby" dynamic="true" id="actuals_actuals_acservices_acservices_table_1_grid10_3" inputmode="readonly"/>
<textbox dataattribute="enterdate" dynamic="true" id="actuals_actuals_acservices_acservices_table_1_grid10_4" inputmode="readonly"/>
</section>
</sectioncol>
</sectionrow>
</section>
</tabledetails>
</table>
</tab>
This is basically the actuals tab services section in work order . I see that it works in other instance but for some reason not in the particular instance that I'm working on. The record gets saved in the DB however it's not coming up in the UI
Related
I'm very new to nativescript, and I'm lost with the container layout. How can I set a webview in fullscreen with 2 floating bottoms, over the webview, fixed at the bottom of the app ?
!https://imgur.com/a/TMi3IQz
I tried at this time 2 solutions :
Can you help me please ?
https://play.nativescript.org/?template=play-js&id=QIXiNZ
With this, the second element is at 60px height, and in CSS, I tried to translate it to top (-60px)... But it disappears behind webview.
<GridLayout rows="*,60">
<WebView left="0" top="0" width="100%" height="100%" loaded="onWebViewLoaded"
id="webViewID" width="100%" src="https://www.stackoverflow.com" />
<AbsoluteLayout class="mywidget" row="1" orientation="horizontal">
<Button class="btn-promo" text="Promos" left="0" bottom="0" height="55" />
<Button class="btn-espacepro" text="Espace pro" right="10" bottom="0"
height="55" />
</AbsoluteLayout>
</GridLayout>
https://play.nativescript.org/?template=play-js&id=aPtpmB
I tried to tweak it with html, position relative for the parent, position obsolute with bottom:0px to the Stacklayout with absolut-it class.
<GridLayout class="relative-it" rows="*">
<ScrollView row="0">
<WebView left="0" top="0" width="100%" height="100%" loaded="onWebViewLoaded"
id="webViewID" width="100%" src="https://www.stackoverflow.com" />
</ScrollView>
<StackLayout class="absolute-it" row="1">
<Button class="btn-promo" text="Promos" left="0" bottom="0" height="55" />
<Button class="btn-espacepro" text="Espace pro" right="10" bottom="0"
height="55" />
</StackLayout>
</GridLayout>
Try this,
<GridLayout rows="*,auto" columns="*,*">
<WebView src="https://www.nativescript.org" colSpan="2" />
<Button row="1" col="0" text="Button 1" class="btn btn-primary" />
<Button row="1" col="1" text="Button 2" class="btn btn-primary" />
</GridLayout>
Updated Playground
I am having one button. On click of that button. I am opening the stackpane which is right below it. For StackPane hard coded x layout values. So at first click the stackpane shows right below the button. The prob is when I maximize or resize the window it is not adjusting it's position(x).
FXML
<Button fx:id="searchCriteriaBtn" mnemonicParsing="false" onAction="#searchCriteriaAction" styleClass="redButton" text="Search Criteria">
<StackPane fx:id="searchCriteriaPane" alignment="TOP_RIGHT" prefHeight="150.0" prefWidth="200.0" styleClass="redBorder" translateX="239.0" translateY="-6.0" visible="false">
JAVA
#FXML
private void searchCriteriaAction(ActionEvent event){
searchCriteriaPane.visibleProperty().setValue(true);
searchCriteriaBtn.layoutXProperty().bind(searchCriteriaPane.layoutXProperty());
searchCriteriaBtn.layoutYProperty().bind(searchCriteriaPane.layoutYProperty());
}
I have found out the solution of overlay dropdown menu.
<MenuButton mnemonicParsing="false" nodeOrientation="LEFT_TO_RIGHT"
styleClass="redButton" text="Search Criteria" textFill="WHITE">
<items>
<MenuItem mnemonicParsing="false"
style="-fx-background-color: transparent; -fx-padding: 0; -fx-margin: 0;">
<AnchorPane minHeight="0.0" minWidth="0.0"
prefHeight="500.0" prefWidth="345.0" styleClass="noborder">
<children>
<HBox layoutY="156.0" minHeight="185.0" minWidth="345.0"
prefHeight="185.0" prefWidth="357.0" />
<HBox layoutX="5.0" layoutY="316.0" prefHeight="35.0"
prefWidth="348.0">
<children>
<Text layoutX="7.0" layoutY="335.0" strokeType="OUTSIDE"
strokeWidth="0.0" text="Template Name">
<HBox.margin>
<Insets right="5.0" top="9.0" />
</HBox.margin>
</Text>
<ComboBox fx:id="templateNameComboBox" layoutX="94.0"
layoutY="330.0" prefWidth="248.0" promptText="Select Template Name">
<HBox.margin>
<Insets left="7.0" />
</HBox.margin>
</ComboBox>
</children>
</HBox>
</children>
</AnchorPane>
</MenuItem>
</items>
<HBox.margin>
<Insets left="6.0" />
</HBox.margin>
<cursor>
<Cursor fx:constant="HAND" />
</cursor>
</MenuButton>
I need to lay out 4 buttons in 2x2 grid. All buttons must have the same size and change it when window changes it's size.
I use the following FXML now but buttons don't change their size.
<GridPane xmlns:fx="http://javafx.com/fxml">
<Button fx:id="btnLogin" text="Login" GridPane.rowIndex="0" GridPane.columnIndex="0"/>
<Button fx:id="btnLibrary" text="Library" GridPane.rowIndex="0" GridPane.columnIndex="1"/>
<Button fx:id="btnRegister" text="Register" GridPane.rowIndex="1" GridPane.columnIndex="0"/>
<Button fx:id="btnHelp" text="Help" GridPane.rowIndex="1" GridPane.columnIndex="1"/>
</GridPane>
That's how I managed to do it.
<GridPane xmlns:fx="http://javafx.com/fxml">
<columnConstraints>
<ColumnConstraints percentWidth="50"/>
<ColumnConstraints percentWidth="50"/>
</columnConstraints>
<rowConstraints>
<RowConstraints percentHeight="50"/>
<RowConstraints percentHeight="50"/>
</rowConstraints>
<Button fx:id="btnLogin" text="Login" GridPane.rowIndex="0" GridPane.columnIndex="0" maxWidth="10000" maxHeight="10000"/>
<Button fx:id="btnLibrary" text="Library" GridPane.rowIndex="0" GridPane.columnIndex="1" maxWidth="10000" maxHeight="10000"/>
<Button fx:id="btnRegister" text="Register" GridPane.rowIndex="1" GridPane.columnIndex="0" maxWidth="10000" maxHeight="10000"/>
<Button fx:id="btnHelp" text="Help" GridPane.rowIndex="1" GridPane.columnIndex="1" maxWidth="10000" maxHeight="10000"/>
</GridPane>
I had the same problem with a ComboBox and solved it this way:
<ComboBox hgrow="ALWAYS" maxWidth="Infinity" />
Having a GridPane with 2 rows and 2 columns, setting the row constraints to 50 percent height results in unwanted behaviour.
Code:
<BorderPane xmlns:fx="http://javafx.com/fxml" fx:controller="..." stylesheets="#general.css" prefWidth="800" prefHeight="600">
<top>
<VBox>
<!-- ... -->
</VBox>
</top>
<bottom>
<HBox>
<!-- ... -->
</HBox>
</bottom>
<center>
<GridPane >
<children>
<ScrollPane fx:id="tilePane" GridPane.columnIndex="0" GridPane.rowIndex="0">
<content>
</content>
<GridPane.margin>
<Insets bottom="2" left="2" right="2" top="2" />
</GridPane.margin>
</ScrollPane>
<TreeView fx:id="listPane" GridPane.columnIndex="0" GridPane.rowIndex="1">
<root>
<TreeItem value="Stages" />
</root>
<GridPane.margin>
<Insets bottom="2" left="2" right="2" top="2" />
</GridPane.margin>
</TreeView>
<ScrollPane fx:id="mapPane" GridPane.columnIndex="1" GridPane.rowIndex="0" GridPane.rowSpan="2">
<content>
</content>
<GridPane.margin>
<Insets bottom="2" left="2" right="2" top="2" />
</GridPane.margin>
</ScrollPane>
</children>
<columnConstraints>
<ColumnConstraints hgrow="ALWAYS" percentWidth="25"/>
<ColumnConstraints hgrow="ALWAYS" />
</columnConstraints>
<rowConstraints>
<RowConstraints vgrow="ALWAYS" percentHeight="50" />
<RowConstraints vgrow="ALWAYS" percentHeight="50" />
</rowConstraints>
</GridPane>
</center>
</BorderPane>
(mentioned attribute at the bottom)
I expected that the two rows would share their available height at a 50% rate. They do this, but they also consume a lot more space than needed.
Picture of the result with, and without percentHeight specified:
Do I understand percentHeight wrong, or is there another approach?
I have a RadGrid with KeyboardNavigation allowed, RowSelection enabled.
When i click on a row using the mouse, the post back happens and i perform the necessary operations that i wish to do.
Now, when i use the keyboard up/down keys to change the row selection, the grid does change the SelectedRow (the display shows the selection happening). But the control does not post back in this case.
Anybody know how to create a postback after a row is changed by the keyboard?
jai telengana
function keyPress(sender, args) {
if (args.get_keyCode() == 13) {
args.set_cancel(true);
if (sender._activeRow) {
sender._activeRow.click();
}
}
}
<telerik:RadGrid ID="Manage_Group_RadGrid" AllowFilteringByColumn="true" OnItemCommand="Manage_Group_RadGrid_ItemCommand" AllowPaging="true" AllowMultiRowSelection="true" OnItemDataBound="Manage_Group_RadGrid_ItemDataBound" ShowStatusBar="true"
AllowSorting="true" OnDataBinding="Manage_Group_RadGrid_DataBinding" OnNeedDataSource="Manage_Group_RadGrid_NeedDataSource" GroupingEnabled="true" ShowGroupPanel="true" OnGroupsChanging="Manage_Group_RadGrid_GroupsChanging"
PagerStyle-AlwaysVisible="true"
PageSize="15" Height="440px"
DataKeyNames="cn" runat="server">
<EditItemStyle BackColor="green" />
<MasterTableView DataKeyNames="cn" AutoGenerateColumns="false"
PagerStyle-AlwaysVisible="true" GroupsDefaultExpanded="false" CommandItemDisplay="Top">
<Columns>
<telerik:GridBoundColumn DataField="cn" HeaderText="cn" SortExpression="cn" UniqueName="cn"
ItemStyle-Width="200px" HeaderStyle-Width="200px" />
<telerik:GridBoundColumn DataField="cn" HeaderText="sAMAccountName" SortExpression="sAMAccountName" UniqueName="sAMAccountName"
ItemStyle-Width="200px" HeaderStyle-Width="200px" />
</Columns>
<CommandItemSettings ShowAddNewRecordButton="false" />
</MasterTableView>
<GroupingSettings CaseSensitive="false" />
<GroupingSettings ShowUnGroupButton="true"></GroupingSettings>
<ClientSettings AllowKeyboardNavigation="true" EnablePostBackOnRowClick="false">
**<ClientEvents OnKeyPress="keyPress" />**
<Selecting AllowRowSelect="true" />
</ClientSettings>
</telerik:RadGrid>