gn:act_copyDataNew
- Description
- Action used to copy content from source to target. Content that is copied ALWAYS REPLACES the content in target. Source and target have to be of same datatype unless there is a supported conversion.
- For supported conversions see table below.
- Action returns
- boolean,
true
if content was successfully copied otherwisefalse
Source Target pointer
text
text
pointer
email
pointer
number
pointer
text
number
date
long
dateTime
long
Action signatures
Copy data
[gn:act_copyDataNew]|[source(indexSource)(columnSource),target(indexTarget)(columnTarget)]
Parameter Description source
source from where the value will be copied target
target where the value will be stored indexSource
indexTarget
optionalsource or target which will be used as index for source and target, needs to be an integer
columnSource
columnTarget
optionalsource or target which will be used as column name within a row or complex datatype.
- Examples of row operation signatures from rows to rows datatype with index
[gn:act_copyDataNew]|[@variable/rows,@variable/targetRows]
[gn:act_copyDataNew]|[@variable/rows(indexSource)(),@variable/targetRows]
[gn:act_copyDataNew]|[@variable/rows(indexSource)(),@variable/targetRows(indexTarget)()]
- Examples of row operation signatures from rows to rows datatype with column
[gn:act_copyDataNew]|[@variable/rows()(columnSource),@variable/targetRows()(columnTarget)]
source and target have single row
- Examples of row operation signatures from rows to rows datatype with index and column
[gn:act_copyDataNew]|[@variable/rows(indexSource)(columnSource),@variable/targetRows(indexTarget)(columnTarget)]
[gn:act_copyDataNew]|[@variable/rows()(columnSource),@variable/targetRows(indexTarget)(columnTarget)]
source has single row[gn:act_copyDataNew]|[@variable/rows(indexSource)(columnSource),@variable/targetRows()(columnTarget)]
target has single row
- Examples of datatype internal operation signatures with index and column
[gn:act_copyDataNew]|[@variable/emails,@variable/emailsNew]
[gn:act_copyDataNew]|[@variable/emails(indexSource)(columnSource),@variable/text]
[gn:act_copyDataNew]|[@variable/emails()(columnSource),@variable/text]
source has single row[gn:act_copyDataNew]|[@variable/emails(indexSource)(),@variable/emailsNew]
Example2
initial value
@variable/allReportRows
- 3 rows with 10 columns each@variable/allReportRowsCopy
- empty
variables.xml
<variable id="allReportRows" type="rows"/> <variable id="allReportRowsCopy" type="rows"/>
screen.xml
<com.ginstr.widgets.GnEditText android:id="@+id/screen_integerNumberLabel_input" android:layout_height="wrap_content" android:layout_width="match_parent" gn:dataType="number" gn:inputType="NUMBER" gn:s_decimalFormat="#" gn:s_sourceType="input" gn:style="@style/numberInteger_input"/> <FrameLayout android:id="@+id/exampleFrame" android:layout_width="wrap_content" android:layout_height="wrap_content" android:visibility="gone" gn:act_set="[gn:act_copyDataNew]|[@variable/allReportRows(@+id/screen_integerNumberLabel_input)(),@variable/allReportRowsCopy]" />
after action execution
if numerical value i.e. 0 was defined at widget @+id/screen_integerNumberLabel_input
@variable/allReportRowsCopy
- 0'th row from@variable/allReportRows
Example
initial value
@variable/allReportRows
- 3 rows with 10 columns each@variable/allReportRowsCopy
- empty
variables.xml
<variable id="allReportRows" type="rows"/> <variable id="allReportRowsCopy" type="rows"/>
screen.xml
<com.ginstr.widgets.GnEditText android:id="@+id/screen_integerNumberLabel_input" android:layout_height="wrap_content" android:layout_width="match_parent" gn:dataType="number" gn:inputType="NUMBER" gn:s_decimalFormat="#" gn:s_sourceType="input" gn:style="@style/numberInteger_input"/> <FrameLayout android:id="@+id/exampleFrame" android:layout_width="wrap_content" android:layout_height="wrap_content" android:visibility="gone" gn:act_set="[gn:act_copyDataNew]|[@variable/allReportRows(@+id/screen_integerNumberLabel_input)(),@variable/allReportRowsCopy]" />
after action execution
if numerical value i.e. 0 was defined at widget @+id/screen_integerNumberLabel_input
@variable/allReportRowsCopy
- 0'th row from@variable/allReportRows
if widget@+id/screen_integerNumberLabel_input
is empty
@variable/allReportRowsCopy
- all rows from@variable/allReportRows
Example2
initial value
@+id/screen_mediaPhotoLabel_button
- widget contains 3 images loaded from database@+id/screen_textLabel_fileInfo
- empty input field
screen.xml
<com.ginstr.widgets.GnMediaAction android:id="@+id/screen_mediaPhotoLabel_button" android:layout_height="wrap_content" android:layout_width="wrap_content" gn:act_setAfterMediaTaken="[gn:act_copyDataNew]|[@+id/screen_mediaPhotoLabel_button,@+id/screen_mediaPhotoLabel_gallery]" gn:dataType="pictures" gn:maxMediaTaken="5" gn:s_actionType="photo" gn:singleValueMode="false" gn:style="@style/mediaPhoto_button"/> <com.ginstr.widgets.GnEditText android:id="@+id/screen_textLabel_fileInfo" android:layout_height="wrap_content" android:layout_width="match_parent" gn:dataType="text" gn:s_hint="@string/fileInfo" gn:s_sourceType="input" gn:style="@style/textEditable_input"/> <FrameLayout android:id="@+id/exampleFrame" android:layout_width="wrap_content" android:layout_height="wrap_content" android:visibility="gone" gn:act_set="[gn:act_copyDataNew]|[@+id/screen_mediaPhotoLabel_button(0)(filename),@+id/screen_textLabel_fileInfo]" />
after action execution
@+id/screen_textLabel_fileInfo
- input field will show name of the first file that is stored in@+id/screen_mediaPhotoLabel_button
widget